diff --git a/Cargo.toml b/Cargo.toml index d0d143be1..444f291aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/briansmith/ring" version = "0.16.20" # Prevent multiple versions of *ring* from being linked into the same program. -links = "ring-asm" +links = "ring_core_dev" include = [ "LICENSE", @@ -95,14 +95,14 @@ include = [ "crypto/cipher_extra/asm/chacha20_poly1305_x86_64.pl", "doc/link-to-readme.md", "examples/checkdigest.rs", - "include/GFp/aes.h", - "include/GFp/arm_arch.h", - "include/GFp/base.h", - "include/GFp/check.h", - "include/GFp/cpu.h", - "include/GFp/mem.h", - "include/GFp/poly1305.h", - "include/GFp/type_check.h", + "include/ring-core/aes.h", + "include/ring-core/arm_arch.h", + "include/ring-core/base.h", + "include/ring-core/check.h", + "include/ring-core/cpu.h", + "include/ring-core/mem.h", + "include/ring-core/poly1305.h", + "include/ring-core/type_check.h", "src/aead.rs", "src/aead/aes.rs", "src/aead/aes_gcm.rs", diff --git a/build.rs b/build.rs index 470631e25..c75827ae0 100644 --- a/build.rs +++ b/build.rs @@ -425,22 +425,24 @@ fn build_c_code(target: &Target, pregenerated: PathBuf, out_dir: &Path) { let test_srcs = RING_TEST_SRCS.iter().map(PathBuf::from).collect::>(); let libs = [ - ("ring-core", &core_srcs[..], &asm_srcs[..]), - ("ring-test", &test_srcs[..], &[]), + ("", &core_srcs[..], &asm_srcs[..]), + ("test", &test_srcs[..], &[]), ]; // XXX: Ideally, ring-test would only be built for `cargo test`, but Cargo // can't do that yet. - libs.iter().for_each(|&(lib_name, srcs, additional_srcs)| { - build_library( - &target, - &out_dir, - lib_name, - srcs, - additional_srcs, - warnings_are_errors, - ) - }); + libs.iter() + .for_each(|&(lib_name_suffix, srcs, additional_srcs)| { + let lib_name = String::from(BORINGSSL_PREFIX_VALUE) + lib_name_suffix; + build_library( + &target, + &out_dir, + &lib_name, + srcs, + additional_srcs, + warnings_are_errors, + ) + }); println!( "cargo:rustc-link-search=native={}", @@ -524,9 +526,7 @@ fn obj_path(out_dir: &Path, src: &Path, obj_ext: &str) -> PathBuf { out_path } -// This is the prefix we've been using for most symbols since we started -// prefixing. -const BORINGSSL_PREFIX_VALUE: &str = "GFp_"; +const BORINGSSL_PREFIX_VALUE: &str = "ring_core_dev_"; fn cc( file: &Path, @@ -595,7 +595,7 @@ fn cc( // TODO: Expand this to non-clang compilers in 0.17.0 if practical. if compiler.is_like_clang() { let _ = c.flag("-nostdlibinc"); - let _ = c.define("GFp_NOSTDLIBINC", "1"); + let _ = c.define("RING_CORE_NOSTDLIBINC", "1"); } } } @@ -836,8 +836,8 @@ fn generate_prefix_symbols_header( writeln!( file, r#" -{pp}ifndef GFp_generated_{filename_ident} -{pp}define GFp_generated_{filename_ident} +{pp}ifndef ring_core_generated_{filename_ident} +{pp}define ring_core_generated_{filename_ident} "#, pp = pp, filename_ident = filename_ident diff --git a/crypto/chacha/asm/chacha-armv4.pl b/crypto/chacha/asm/chacha-armv4.pl index 4595b70dd..bb63413f4 100755 --- a/crypto/chacha/asm/chacha-armv4.pl +++ b/crypto/chacha/asm/chacha-armv4.pl @@ -171,7 +171,7 @@ my @ret; } $code.=<<___; -#include +#include @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. diff --git a/crypto/chacha/asm/chacha-armv8.pl b/crypto/chacha/asm/chacha-armv8.pl index a5296075d..f40d66a88 100755 --- a/crypto/chacha/asm/chacha-armv8.pl +++ b/crypto/chacha/asm/chacha-armv8.pl @@ -120,7 +120,7 @@ my ($a3,$b3,$c3,$d3)=map(($_&~3)+(($_+1)&3),($a2,$b2,$c2,$d2)); } $code.=<<___; -#include +#include .extern OPENSSL_armcap_P .hidden OPENSSL_armcap_P diff --git a/crypto/cpu-intel.c b/crypto/cpu-intel.c index eb2f81e24..b563ea15d 100644 --- a/crypto/cpu-intel.c +++ b/crypto/cpu-intel.c @@ -54,7 +54,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#include +#include #if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) diff --git a/crypto/crypto.c b/crypto/crypto.c index 29e384d5a..7caecc515 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c @@ -12,7 +12,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include "internal.h" // Our assembly does not use the GOT to reference symbols, which means diff --git a/crypto/curve25519/curve25519.c b/crypto/curve25519/curve25519.c index a71784275..0b8b52655 100644 --- a/crypto/curve25519/curve25519.c +++ b/crypto/curve25519/curve25519.c @@ -19,7 +19,7 @@ // // The field functions are shared by Ed25519 and X25519 where possible. -#include +#include #include "internal.h" #include "../internal.h" diff --git a/crypto/curve25519/internal.h b/crypto/curve25519/internal.h index 65b20688f..b040d2e29 100644 --- a/crypto/curve25519/internal.h +++ b/crypto/curve25519/internal.h @@ -15,7 +15,7 @@ #ifndef OPENSSL_HEADER_CURVE25519_INTERNAL_H #define OPENSSL_HEADER_CURVE25519_INTERNAL_H -#include +#include #include "../internal.h" diff --git a/crypto/fipsmodule/aes/aes_nohw.c b/crypto/fipsmodule/aes/aes_nohw.c index bcb3519a8..a6306f049 100644 --- a/crypto/fipsmodule/aes/aes_nohw.c +++ b/crypto/fipsmodule/aes/aes_nohw.c @@ -12,7 +12,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include "../../internal.h" diff --git a/crypto/fipsmodule/aes/asm/aesv8-armx.pl b/crypto/fipsmodule/aes/asm/aesv8-armx.pl index 137104f7f..89cc6c573 100644 --- a/crypto/fipsmodule/aes/asm/aesv8-armx.pl +++ b/crypto/fipsmodule/aes/asm/aesv8-armx.pl @@ -53,7 +53,7 @@ open OUT,"| \"$^X\" $xlate $flavour $output"; $prefix="aes_hw"; $code=<<___; -#include +#include #if __ARM_MAX_ARCH__>=7 .text diff --git a/crypto/fipsmodule/aes/asm/bsaes-armv7.pl b/crypto/fipsmodule/aes/asm/bsaes-armv7.pl index eb3765bfa..062f8f1b8 100644 --- a/crypto/fipsmodule/aes/asm/bsaes-armv7.pl +++ b/crypto/fipsmodule/aes/asm/bsaes-armv7.pl @@ -707,7 +707,7 @@ ___ $code.=<<___; #ifndef __KERNEL__ -# include +# include # define VFP_ABI_PUSH vstmdb sp!,{d8-d15} # define VFP_ABI_POP vldmia sp!,{d8-d15} diff --git a/crypto/fipsmodule/aes/asm/vpaes-armv8.pl b/crypto/fipsmodule/aes/asm/vpaes-armv8.pl index 5aa3e8707..c5f1b49f6 100755 --- a/crypto/fipsmodule/aes/asm/vpaes-armv8.pl +++ b/crypto/fipsmodule/aes/asm/vpaes-armv8.pl @@ -49,7 +49,7 @@ open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; $code.=<<___; -#include +#include .section .rodata diff --git a/crypto/fipsmodule/bn/asm/armv4-mont.pl b/crypto/fipsmodule/bn/asm/armv4-mont.pl index 1e1365c42..f9af79503 100644 --- a/crypto/fipsmodule/bn/asm/armv4-mont.pl +++ b/crypto/fipsmodule/bn/asm/armv4-mont.pl @@ -97,7 +97,7 @@ $_n0="$num,#14*4"; $_num="$num,#15*4"; $_bpend=$_num; $code=<<___; -#include +#include @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. diff --git a/crypto/fipsmodule/bn/asm/armv8-mont.pl b/crypto/fipsmodule/bn/asm/armv8-mont.pl index 7c703122c..f82c495e8 100644 --- a/crypto/fipsmodule/bn/asm/armv8-mont.pl +++ b/crypto/fipsmodule/bn/asm/armv8-mont.pl @@ -64,7 +64,7 @@ $n0="x4"; # const BN_ULONG *n0, $num="x5"; # size_t num); $code.=<<___; -#include +#include .text diff --git a/crypto/fipsmodule/bn/internal.h b/crypto/fipsmodule/bn/internal.h index 5e30422c2..c3ba88e23 100644 --- a/crypto/fipsmodule/bn/internal.h +++ b/crypto/fipsmodule/bn/internal.h @@ -123,7 +123,7 @@ #ifndef OPENSSL_HEADER_BN_INTERNAL_H #define OPENSSL_HEADER_BN_INTERNAL_H -#include +#include #if defined(OPENSSL_X86_64) && defined(_MSC_VER) && !defined(__clang__) #pragma warning(push, 3) diff --git a/crypto/fipsmodule/ec/ecp_nistz.h b/crypto/fipsmodule/ec/ecp_nistz.h index 7548cc825..1e74ce052 100644 --- a/crypto/fipsmodule/ec/ecp_nistz.h +++ b/crypto/fipsmodule/ec/ecp_nistz.h @@ -15,7 +15,7 @@ #ifndef OPENSSL_HEADER_EC_ECP_NISTZ_H #define OPENSSL_HEADER_EC_ECP_NISTZ_H -#include +#include #include "../../limbs/limbs.h" diff --git a/crypto/fipsmodule/ec/p256-x86_64.c b/crypto/fipsmodule/ec/p256-x86_64.c index 90db05bcc..3ddfeb244 100644 --- a/crypto/fipsmodule/ec/p256-x86_64.c +++ b/crypto/fipsmodule/ec/p256-x86_64.c @@ -16,7 +16,7 @@ * 256 Bit Primes" */ -#include +#include #include "../../limbs/limbs.inl" diff --git a/crypto/fipsmodule/ec/p256-x86_64.h b/crypto/fipsmodule/ec/p256-x86_64.h index b911224e8..d76e11a4e 100644 --- a/crypto/fipsmodule/ec/p256-x86_64.h +++ b/crypto/fipsmodule/ec/p256-x86_64.h @@ -19,7 +19,7 @@ #ifndef OPENSSL_HEADER_EC_P256_X86_64_H #define OPENSSL_HEADER_EC_P256_X86_64_H -#include +#include #include "p256_shared.h" diff --git a/crypto/fipsmodule/ec/p256.c b/crypto/fipsmodule/ec/p256.c index 197979ca7..917636781 100644 --- a/crypto/fipsmodule/ec/p256.c +++ b/crypto/fipsmodule/ec/p256.c @@ -16,7 +16,7 @@ // 256-bit Montgomery form for 64 and 32-bit. Field operations are generated by // Fiat, which lives in //third_party/fiat. -#include +#include #include "../../limbs/limbs.h" #include "../../limbs/limbs.inl" @@ -384,7 +384,7 @@ void p256_point_mul(P256_POINT *r, const Limb scalar[P256_LIMBS], // select the point to add or subtract, in constant time. fiat_p256_select_point(digit, 17, - GFp_POINTLESS_ARRAY_CONST_CAST((const fiat_p256_felem(*)[3]))p_pre_comp, + RING_CORE_POINTLESS_ARRAY_CONST_CAST((const fiat_p256_felem(*)[3]))p_pre_comp, tmp); fiat_p256_opp(ftmp, tmp[1]); // (X, -Y, Z) is the negative point. fiat_p256_cmovznz(tmp[1], sign, tmp[1], ftmp); diff --git a/crypto/fipsmodule/ec/p256_shared.h b/crypto/fipsmodule/ec/p256_shared.h index 513b00607..4dd325bee 100644 --- a/crypto/fipsmodule/ec/p256_shared.h +++ b/crypto/fipsmodule/ec/p256_shared.h @@ -19,7 +19,7 @@ #ifndef OPENSSL_HEADER_EC_P256_SHARED_H #define OPENSSL_HEADER_EC_P256_SHARED_H -#include "GFp/base.h" +#include "ring-core/base.h" #include "../bn/internal.h" diff --git a/crypto/fipsmodule/ec/util.h b/crypto/fipsmodule/ec/util.h index 682c0c1e6..ee64a0622 100644 --- a/crypto/fipsmodule/ec/util.h +++ b/crypto/fipsmodule/ec/util.h @@ -12,7 +12,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include #include "../../internal.h" diff --git a/crypto/fipsmodule/modes/asm/ghash-armv4.pl b/crypto/fipsmodule/modes/asm/ghash-armv4.pl index ae831c805..9d2f80920 100644 --- a/crypto/fipsmodule/modes/asm/ghash-armv4.pl +++ b/crypto/fipsmodule/modes/asm/ghash-armv4.pl @@ -104,7 +104,7 @@ $inp="r2"; $len="r3"; $code=<<___; -#include +#include @ Silence ARMv8 deprecated IT instruction warnings. This file is used by both @ ARMv7 and ARMv8 processors and does not use ARMv8 instructions. (ARMv8 PMULL diff --git a/crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl b/crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl index 2f33fad11..4d98bc9a1 100644 --- a/crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl +++ b/crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl @@ -157,7 +157,7 @@ ___ } $code .= <<___; -#include +#include .text diff --git a/crypto/fipsmodule/modes/asm/ghashv8-armx.pl b/crypto/fipsmodule/modes/asm/ghashv8-armx.pl index 9a6e7a72d..03cd322ab 100644 --- a/crypto/fipsmodule/modes/asm/ghashv8-armx.pl +++ b/crypto/fipsmodule/modes/asm/ghashv8-armx.pl @@ -60,7 +60,7 @@ my ($Xl,$Xm,$Xh,$IN)=map("q$_",(0..3)); my ($t0,$t1,$t2,$xC2,$H,$Hhl,$H2)=map("q$_",(8..14)); $code=<<___; -#include +#include .text ___ diff --git a/crypto/fipsmodule/sha/asm/sha256-armv4.pl b/crypto/fipsmodule/sha/asm/sha256-armv4.pl index 8dd181271..63e359ad6 100644 --- a/crypto/fipsmodule/sha/asm/sha256-armv4.pl +++ b/crypto/fipsmodule/sha/asm/sha256-armv4.pl @@ -177,7 +177,7 @@ ___ $code=<<___; #ifndef __KERNEL__ -# include +# include #else # define __ARM_ARCH__ __LINUX_ARM_ARCH__ # define __ARM_MAX_ARCH__ 7 diff --git a/crypto/fipsmodule/sha/asm/sha512-armv4.pl b/crypto/fipsmodule/sha/asm/sha512-armv4.pl index cec161bf0..df59ef524 100644 --- a/crypto/fipsmodule/sha/asm/sha512-armv4.pl +++ b/crypto/fipsmodule/sha/asm/sha512-armv4.pl @@ -200,7 +200,7 @@ ___ } $code=<<___; #ifndef __KERNEL__ -# include +# include # define VFP_ABI_PUSH vstmdb sp!,{d8-d15} # define VFP_ABI_POP vldmia sp!,{d8-d15} #else diff --git a/crypto/fipsmodule/sha/asm/sha512-armv8.pl b/crypto/fipsmodule/sha/asm/sha512-armv8.pl index 14bb7ffc8..5211d28d5 100644 --- a/crypto/fipsmodule/sha/asm/sha512-armv8.pl +++ b/crypto/fipsmodule/sha/asm/sha512-armv8.pl @@ -173,7 +173,7 @@ ___ $code.=<<___; #ifndef __KERNEL__ -# include +# include #endif .text diff --git a/crypto/internal.h b/crypto/internal.h index ce1a0c394..b975c0b53 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -109,9 +109,9 @@ #ifndef OPENSSL_HEADER_CRYPTO_INTERNAL_H #define OPENSSL_HEADER_CRYPTO_INTERNAL_H -#include // Must be first. +#include // Must be first. -#include "GFp/check.h" +#include "ring-core/check.h" #if defined(__GNUC__) && \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 @@ -129,9 +129,9 @@ // reason explained in // https://gustedt.wordpress.com/2011/02/12/const-and-arrays/ #if defined(__clang__) || defined(_MSC_VER) -#define GFp_POINTLESS_ARRAY_CONST_CAST(cast) +#define RING_CORE_POINTLESS_ARRAY_CONST_CAST(cast) #else -#define GFp_POINTLESS_ARRAY_CONST_CAST(cast) cast +#define RING_CORE_POINTLESS_ARRAY_CONST_CAST(cast) cast #endif #if (!defined(_MSC_VER) || defined(__clang__)) && defined(OPENSSL_64_BIT) @@ -268,12 +268,12 @@ static inline uint32_t CRYPTO_bswap4(uint32_t x) { } #endif -#if !defined(GFp_NOSTDLIBINC) +#if !defined(RING_CORE_NOSTDLIBINC) #include #endif static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { -#if !defined(GFp_NOSTDLIBINC) +#if !defined(RING_CORE_NOSTDLIBINC) if (n == 0) { return dst; } @@ -289,7 +289,7 @@ static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { } static inline void *OPENSSL_memset(void *dst, int c, size_t n) { -#if !defined(GFp_NOSTDLIBINC) +#if !defined(RING_CORE_NOSTDLIBINC) if (n == 0) { return dst; } diff --git a/crypto/limbs/limbs.h b/crypto/limbs/limbs.h index 78c4c080d..e51343bb2 100644 --- a/crypto/limbs/limbs.h +++ b/crypto/limbs/limbs.h @@ -15,7 +15,7 @@ #ifndef RING_LIMBS_H #define RING_LIMBS_H -#include +#include #include "../internal.h" diff --git a/crypto/limbs/limbs.inl b/crypto/limbs/limbs.inl index b5c1d75ac..f8d270a25 100644 --- a/crypto/limbs/limbs.inl +++ b/crypto/limbs/limbs.inl @@ -13,7 +13,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "limbs.h" -#include "GFp/check.h" +#include "ring-core/check.h" #if defined(_MSC_VER) && !defined(__clang__) #pragma warning(push, 3) @@ -36,12 +36,12 @@ typedef uint8_t Carry; #if LIMB_BITS == 64 #pragma intrinsic(_addcarry_u64, _subborrow_u64) -#define GFp_ADDCARRY_INTRINSIC _addcarry_u64 -#define GFp_SUBBORROW_INTRINSIC _subborrow_u64 +#define RING_CORE_ADDCARRY_INTRINSIC _addcarry_u64 +#define RING_CORE_SUBBORROW_INTRINSIC _subborrow_u64 #elif LIMB_BITS == 32 #pragma intrinsic(_addcarry_u32, _subborrow_u32) -#define GFp_ADDCARRY_INTRINSIC _addcarry_u32 -#define GFp_SUBBORROW_INTRINSIC _subborrow_u32 +#define RING_CORE_ADDCARRY_INTRINSIC _addcarry_u32 +#define RING_CORE_SUBBORROW_INTRINSIC _subborrow_u32 typedef uint64_t DoubleLimb; #endif #else @@ -58,8 +58,8 @@ typedef uint64_t DoubleLimb; static inline Carry limb_adc(Limb *r, Limb a, Limb b, Carry carry_in) { dev_assert_secret(carry_in == 0 || carry_in == 1); Carry ret; -#if defined(GFp_ADDCARRY_INTRINSIC) - ret = GFp_ADDCARRY_INTRINSIC(carry_in, a, b, r); +#if defined(RING_CORE_ADDCARRY_INTRINSIC) + ret = RING_CORE_ADDCARRY_INTRINSIC(carry_in, a, b, r); #else DoubleLimb x = (DoubleLimb)a + b + carry_in; *r = (Limb)x; @@ -72,8 +72,8 @@ static inline Carry limb_adc(Limb *r, Limb a, Limb b, Carry carry_in) { /* |*r = a + b|, returning carry bit. */ static inline Carry limb_add(Limb *r, Limb a, Limb b) { Carry ret; -#if defined(GFp_ADDCARRY_INTRINSIC) - ret = GFp_ADDCARRY_INTRINSIC(0, a, b, r); +#if defined(RING_CORE_ADDCARRY_INTRINSIC) + ret = RING_CORE_ADDCARRY_INTRINSIC(0, a, b, r); #else DoubleLimb x = (DoubleLimb)a + b; *r = (Limb)x; @@ -88,8 +88,8 @@ static inline Carry limb_add(Limb *r, Limb a, Limb b) { static inline Carry limb_sbb(Limb *r, Limb a, Limb b, Carry borrow_in) { dev_assert_secret(borrow_in == 0 || borrow_in == 1); Carry ret; -#if defined(GFp_SUBBORROW_INTRINSIC) - ret = GFp_SUBBORROW_INTRINSIC(borrow_in, a, b, r); +#if defined(RING_CORE_SUBBORROW_INTRINSIC) + ret = RING_CORE_SUBBORROW_INTRINSIC(borrow_in, a, b, r); #else DoubleLimb x = (DoubleLimb)a - b - borrow_in; *r = (Limb)x; @@ -102,8 +102,8 @@ static inline Carry limb_sbb(Limb *r, Limb a, Limb b, Carry borrow_in) { /* |*r = a - b|, returning borrow bit. */ static inline Carry limb_sub(Limb *r, Limb a, Limb b) { Carry ret; -#if defined(GFp_SUBBORROW_INTRINSIC) - ret = GFp_SUBBORROW_INTRINSIC(0, a, b, r); +#if defined(RING_CORE_SUBBORROW_INTRINSIC) + ret = RING_CORE_SUBBORROW_INTRINSIC(0, a, b, r); #else DoubleLimb x = (DoubleLimb)a - b; *r = (Limb)x; diff --git a/crypto/mem.c b/crypto/mem.c index 69902ee37..fe982b33b 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -54,7 +54,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#include +#include int OPENSSL_memcmp(const uint8_t *a, const uint8_t *b, size_t len) { uint8_t x = 0; diff --git a/crypto/poly1305/internal.h b/crypto/poly1305/internal.h index 98e7a482d..f828e0b3d 100644 --- a/crypto/poly1305/internal.h +++ b/crypto/poly1305/internal.h @@ -15,8 +15,8 @@ #ifndef OPENSSL_HEADER_POLY1305_INTERNAL_H #define OPENSSL_HEADER_POLY1305_INTERNAL_H -#include -#include +#include +#include #if defined(OPENSSL_ARM) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_APPLE) #define OPENSSL_POLY1305_NEON diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c index 0db32cba8..fcf3bc81c 100644 --- a/crypto/poly1305/poly1305.c +++ b/crypto/poly1305/poly1305.c @@ -16,7 +16,7 @@ // (https://github.com/floodyberry/poly1305-donna) and released as public // domain. -#include +#include #include "internal.h" #include "../internal.h" diff --git a/crypto/poly1305/poly1305_arm.c b/crypto/poly1305/poly1305_arm.c index 42fcdac0d..d7d66ff54 100644 --- a/crypto/poly1305/poly1305_arm.c +++ b/crypto/poly1305/poly1305_arm.c @@ -15,7 +15,7 @@ // This implementation was taken from the public domain, neon2 version in // SUPERCOP by D. J. Bernstein and Peter Schwabe. -#include +#include #include "internal.h" #include "../internal.h" diff --git a/crypto/poly1305/poly1305_vec.c b/crypto/poly1305/poly1305_vec.c index 634d5035c..0f257fdd6 100644 --- a/crypto/poly1305/poly1305_vec.c +++ b/crypto/poly1305/poly1305_vec.c @@ -18,7 +18,7 @@ // http://cr.yp.to/papers.html#neoncrypto. Unrolled to 2 powers, i.e. 64 byte // block size -#include +#include #include "internal.h" #include "../internal.h" diff --git a/include/GFp/aes.h b/include/ring-core/aes.h similarity index 99% rename from include/GFp/aes.h rename to include/ring-core/aes.h index d554ae771..5b5130dad 100644 --- a/include/GFp/aes.h +++ b/include/ring-core/aes.h @@ -49,7 +49,7 @@ #ifndef OPENSSL_HEADER_AES_H #define OPENSSL_HEADER_AES_H -#include +#include // Raw AES functions. diff --git a/include/GFp/arm_arch.h b/include/ring-core/arm_arch.h similarity index 100% rename from include/GFp/arm_arch.h rename to include/ring-core/arm_arch.h diff --git a/include/GFp/base.h b/include/ring-core/base.h similarity index 99% rename from include/GFp/base.h rename to include/ring-core/base.h index 3e5669716..f1a027d1a 100644 --- a/include/GFp/base.h +++ b/include/ring-core/base.h @@ -58,7 +58,7 @@ #include -#include +#include #if defined(_MSC_VER) && !defined(__clang__) #pragma warning(push, 3) diff --git a/include/GFp/check.h b/include/ring-core/check.h similarity index 98% rename from include/GFp/check.h rename to include/ring-core/check.h index 4bd257ca3..08cbff3e5 100644 --- a/include/GFp/check.h +++ b/include/ring-core/check.h @@ -23,7 +23,7 @@ // When reviewing uses of |debug_assert_nonsecret|, verify that the check // really does not have potential to leak a secret. -#if !defined(GFp_NOSTDLIBINC) +#if !defined(RING_CORE_NOSTDLIBINC) # include # define debug_assert_nonsecret(x) assert(x) #else diff --git a/include/GFp/cpu.h b/include/ring-core/cpu.h similarity index 99% rename from include/GFp/cpu.h rename to include/ring-core/cpu.h index 29c281c1a..0205c1d29 100644 --- a/include/GFp/cpu.h +++ b/include/ring-core/cpu.h @@ -61,7 +61,7 @@ #ifndef OPENSSL_HEADER_CPU_H #define OPENSSL_HEADER_CPU_H -#include +#include // Runtime CPU feature support diff --git a/include/GFp/mem.h b/include/ring-core/mem.h similarity index 99% rename from include/GFp/mem.h rename to include/ring-core/mem.h index 64d77f627..08e3e3256 100644 --- a/include/GFp/mem.h +++ b/include/ring-core/mem.h @@ -57,7 +57,7 @@ #ifndef OPENSSL_HEADER_MEM_H #define OPENSSL_HEADER_MEM_H -#include +#include // OPENSSL_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. It // takes an amount of time dependent on |len|, but independent of the contents diff --git a/include/GFp/poly1305.h b/include/ring-core/poly1305.h similarity index 97% rename from include/GFp/poly1305.h rename to include/ring-core/poly1305.h index 53c4036c8..af082ca10 100644 --- a/include/GFp/poly1305.h +++ b/include/ring-core/poly1305.h @@ -15,7 +15,7 @@ #ifndef OPENSSL_HEADER_POLY1305_H #define OPENSSL_HEADER_POLY1305_H -#include +#include // Keep in sync with `poly1305_state` in poly1305.rs. typedef uint8_t poly1305_state[512]; diff --git a/include/ring-core/prefix_symbols.h b/include/ring-core/prefix_symbols.h new file mode 100644 index 000000000..e69de29bb diff --git a/include/GFp/type_check.h b/include/ring-core/type_check.h similarity index 99% rename from include/GFp/type_check.h rename to include/ring-core/type_check.h index 0cca158eb..d7e039345 100644 --- a/include/GFp/type_check.h +++ b/include/ring-core/type_check.h @@ -57,7 +57,7 @@ #ifndef OPENSSL_HEADER_TYPE_CHECK_H #define OPENSSL_HEADER_TYPE_CHECK_H -#include +#include #if defined(__cplusplus) || (defined(_MSC_VER) && !defined(__clang__)) diff --git a/src/aead/poly1305.rs b/src/aead/poly1305.rs index f5cae2098..a2cb11e26 100644 --- a/src/aead/poly1305.rs +++ b/src/aead/poly1305.rs @@ -43,7 +43,7 @@ pub struct Context { cpu_features: cpu::Features, } -// Keep in sync with `poly1305_state` in GFp/poly1305.h. +// Keep in sync with `poly1305_state` in ring-core/poly1305.h. // // The C code, in particular the way the `poly1305_aligned_state` functions // are used, is only correct when the state buffer is 64-byte aligned. diff --git a/src/prefixed.rs b/src/prefixed.rs index d84b99a2b..5340c84e7 100644 --- a/src/prefixed.rs +++ b/src/prefixed.rs @@ -68,7 +68,7 @@ macro_rules! prefixed_item { } => { prefixed_item! { $attr - { concat!("GFp_", stringify!($name)) } + { concat!("ring_core_dev_", stringify!($name)) } { $( $item )+ } } };