Skip to content

Commit

Permalink
deps/ring: upgrade to 0.17.6
Browse files Browse the repository at this point in the history
Signed-off-by: Jiaqi Gao <[email protected]>
  • Loading branch information
gaojiaqi7 authored and jyao1 committed Dec 1, 2023
1 parent 678aa98 commit bf33d12
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cc-measurement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
sha2 = { version = "0.10.6", default-features = false, features = ["force-soft"], optional = true }
ring = { version = "0.17.5", default-features = false, features = ["alloc"], optional = true }
ring = { version = "0.17.6", default-features = false, features = ["alloc"], optional = true }
zerocopy = "0.6.0"

[features]
Expand Down
35 changes: 1 addition & 34 deletions library/patches/ring.diff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/Cargo.toml b/Cargo.toml
index 3378dc84b..f65fd70bd 100644
index 2c8ba6964..209c3d4a1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -171,7 +171,7 @@ all-features = true
Expand Down Expand Up @@ -74,36 +74,3 @@ index f7b94108b..3bdc8cd29 100644
let _ = c
.arg("-o")
.arg(out_file.to_str().expect("Invalid path"))
diff --git a/src/rand.rs b/src/rand.rs
index 78f4bdc3c..2d1028b84 100644
--- a/src/rand.rs
+++ b/src/rand.rs
@@ -148,6 +148,7 @@ impl crate::sealed::Sealed for SystemRandom {}
all(target_os = "unknown", feature = "wasm32_unknown_unknown_js")
)
),
+ all(target_arch = "x86_64", target_os = "none"),
))]
impl sealed::SecureRandom for SystemRandom {
#[inline(always)]
diff --git a/third_party/fiat/curve25519_64_adx.h b/third_party/fiat/curve25519_64_adx.h
index 9dcbb69fa..0906fda81 100644
--- a/third_party/fiat/curve25519_64_adx.h
+++ b/third_party/fiat/curve25519_64_adx.h
@@ -1,7 +1,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <immintrin.h>
-#include <string.h>

typedef uint64_t fe4[4];
typedef uint8_t fiat_uint1;
@@ -469,7 +468,7 @@ __attribute__((target("adx,bmi2")))
void x25519_scalar_mult_adx(uint8_t out[32], const uint8_t scalar[32],
const uint8_t point[32]) {
uint8_t e[32];
- memcpy(e, scalar, 32);
+ OPENSSL_memcpy(e, scalar, 32);
e[0] &= 248;
e[31] &= 127;
e[31] |= 64;
2 changes: 1 addition & 1 deletion library/ring
Submodule ring updated 74 files
+8 −0 BUILDING.md
+4 −3 Cargo.toml
+17 −2 bench/Cargo.toml
+80 −135 bench/aead.rs
+84 −0 bench/agreement.rs
+ bench/data/rsa-2048-3-public-key.der
+1 −0 bench/data/rsa-2048-3-signature.bin
+ bench/data/rsa-2048-65537-public-key.der
+1 −0 bench/data/rsa-2048-65537-signature.bin
+ bench/data/rsa-3072-3-public-key.der
+ bench/data/rsa-3072-3-signature.bin
+ bench/data/rsa-4096-3-public-key.der
+4 −0 bench/data/rsa-4096-3-signature.bin
+ bench/data/rsa-8192-3-public-key.der
+ bench/data/rsa-8192-3-signature.bin
+53 −0 bench/data/rsa-generate.sh
+49 −0 bench/digest.rs
+73 −0 bench/ecdsa.rs
+80 −0 bench/rsa.rs
+0 −63 bench/x25519.rs
+3 −1 crypto/crypto.c
+1 −0 crypto/curve25519/curve25519.c
+13 −9 crypto/fipsmodule/ec/gfp_p256.c
+36 −28 crypto/fipsmodule/ec/gfp_p384.c
+116 −0 crypto/fipsmodule/ec/make_ec_scalar_base_mult_tests.go
+1 −0 crypto/internal.h
+517 −0 mk/generate_curves.py
+4 −2 src/aead/aes.rs
+2 −2 src/aead/aes_gcm.rs
+1 −0 src/aead/chacha.rs
+4 −6 src/aead/chacha20_poly1305_openssh.rs
+2 −2 src/aead/gcm.rs
+1 −0 src/aead/gcm/gcm_nohw.rs
+8 −8 src/agreement.rs
+0 −3 src/arithmetic.rs
+156 −243 src/arithmetic/bigint.rs
+6 −24 src/arithmetic/bigint/boxed_limbs.rs
+82 −133 src/arithmetic/bigint/modulus.rs
+1 −10 src/arithmetic/bigint/private_exponent.rs
+35 −36 src/arithmetic/bigint_elem_reduced_once_tests.txt
+15 −0 src/arithmetic/bigint_elem_reduced_tests.txt
+22 −6 src/arithmetic/montgomery.rs
+1 −1 src/arithmetic/n0.rs
+0 −70 src/arithmetic/nonnegative.rs
+1 −9 src/cpu.rs
+27 −14 src/cpu/arm.rs
+24 −20 src/digest.rs
+9 −8 src/digest/sha1.rs
+1 −1 src/digest/sha2.rs
+1 −6 src/ec/suite_b/ecdsa/digest_scalar.rs
+3 −1 src/ec/suite_b/ecdsa/signing.rs
+24 −53 src/ec/suite_b/ops.rs
+10 −2 src/ec/suite_b/ops/p256.rs
+0 −4 src/ec/suite_b/ops/p256_point_mul_serialized_tests.txt
+0 −1,665 src/ec/suite_b/ops/p256_point_mul_tests.txt
+13 −14 src/ec/suite_b/ops/p384.rs
+0 −1,664 src/ec/suite_b/ops/p384_point_mul_tests.txt
+0 −28 src/endian.rs
+1 −0 src/io/der_writer.rs
+26 −1 src/lib.rs
+24 −22 src/limb.rs
+1 −4 src/polyfill.rs
+0 −31 src/polyfill/chunks_fixed.rs
+7 −16 src/prefixed.rs
+2 −0 src/rand.rs
+0 −1 src/rsa.rs
+147 −152 src/rsa/keypair.rs
+17 −0 src/rsa/keypair_private_exponentiate_tests.txt
+72 −28 src/rsa/public_key.rs
+2 −2 src/rsa/public_key_components.rs
+18 −8 src/rsa/public_modulus.rs
+2 −2 src/rsa/verification.rs
+2 −2 tests/rsa_from_pkcs8_tests.txt
+1 −2 third_party/fiat/curve25519_64_adx.h
2 changes: 1 addition & 1 deletion sh_script/preparation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
preparation() {
# apply the patch set for ring
pushd library/ring
git reset --hard c3fda8b4dd57d658923c397c6cfaa33591f6f256
git reset --hard 464d367252354418a2c17feb806876d4d89a8508
git clean -f -d
patch -p 1 -i ../patches/ring.diff
popd
Expand Down
2 changes: 1 addition & 1 deletion td-shim-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ der = { version = "0.4.5", features = ["oid"], optional = true }
env_logger = { version = "0.9.0", optional = true }
log = { version = "0.4.5", optional = true }
td-loader = { path = "../td-loader", optional = true }
ring = { version = "0.17.5", optional = true }
ring = { version = "0.17.6", optional = true }
serde_json = { version = "1.0", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
hex = { version = "0.4", features = ["serde"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion td-shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ zerocopy = "0.6.0"
td-loader = { path = "../td-loader", optional = true }
linked_list_allocator = { version = "0.10", optional = true }
log = { version = "0.4.13", features = ["release_max_level_off"], optional = true }
ring = { version = "0.17.5", default-features = false, features = ["alloc"], optional = true }
ring = { version = "0.17.6", default-features = false, features = ["alloc"], optional = true }
spin = { version = "0.9.2", optional = true }
td-exception = { path = "../td-exception", features = ["tdx"], optional = true }
td-logger = { path = "../td-logger", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion tests/test-td-payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ scroll = { version = "0.10.0", default-features = false, features = ["derive"]}
serde = { version = "1.0", default-features = false, features = ["derive"]}
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
x86 = { version = "0.47.0" }
ring = { version = "0.17.5", default-features = false, features = ["alloc"] }
ring = { version = "0.17.6", default-features = false, features = ["alloc"] }
td-shim = { path = "../../td-shim" }
td-payload = { path = "../../td-payload", features = ["tdx","cet-shstk","stack-guard"] }
zerocopy = "0.6.0"
Expand Down

0 comments on commit bf33d12

Please sign in to comment.