From ac41749a2870e7c8ccf1d90e3dcf6dc733c51c15 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Wed, 6 Nov 2024 23:54:40 +0100 Subject: [PATCH] update to latest crypto bigint --- Cargo.lock | 22 ++++++++++++++++------ Cargo.toml | 6 +++--- src/algorithms/generate.rs | 3 +-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c39bd7..85c6bb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,13 +141,13 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.6.0-rc.2" +version = "0.6.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43027691f1c055da3da4f7d96af09fcec420d435d5616e51f29afd0811c56a7" +checksum = "d748d1f5b807ee6d0df5a548d0130417295c3aaed1dcbbb3d6a2e7106e11fcca" dependencies = [ "num-traits", "rand_core", - "serdect", + "serdect 0.3.0-rc.0", "subtle", "zeroize", ] @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "crypto-primes" -version = "0.6.0-pre.0" +version = "0.6.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31bb1382ea4ef18b2da595f36ca284c7b6366d22264ac02f8baee109361cd6b0" +checksum = "d9fad3f7645c77d3e0269f3e74a8dd25746de992b16bcecbb316059836e0b366" dependencies = [ "crypto-bigint", "rand_core", @@ -523,7 +523,7 @@ dependencies = [ "rand_xorshift", "serde", "serde_test", - "serdect", + "serdect 0.2.0", "sha1", "sha2", "sha3", @@ -618,6 +618,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.3.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a504c8ee181e3e594d84052f983d60afe023f4d94d050900be18062bbbf7b58" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha1" version = "0.11.0-pre.4" diff --git a/Cargo.toml b/Cargo.toml index c9ce416..3400280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,8 +22,8 @@ pkcs8 = { version = "0.11.0-rc.0", default-features = false, features = ["alloc" signature = { version = "=2.3.0-pre.4", default-features = false, features = ["alloc", "digest", "rand_core"] } spki = { version = "0.8.0-rc.1", default-features = false, features = ["alloc"] } zeroize = { version = "1.5", features = ["alloc"] } -crypto-bigint = { version = "0.6.0-rc.2", default-features = false, features = ["zeroize", "alloc"] } -crypto-primes = { version = "0.6.0-pre.0" } +crypto-bigint = { version = "0.6.0-rc.6", default-features = false, features = ["zeroize", "alloc"] } +crypto-primes = { version = "0.6.0-pre.2" } # optional dependencies sha1 = { version = "=0.11.0-pre.4", optional = true, default-features = false, features = ["oid"] } @@ -54,7 +54,7 @@ getrandom = ["rand_core/getrandom", "crypto-bigint/rand_core"] serde = ["dep:serde", "dep:serdect", "crypto-bigint/serde"] pem = ["pkcs1/pem", "pkcs8/pem"] pkcs5 = ["pkcs8/encryption"] -std = ["digest/std", "pkcs1/std", "pkcs8/std", "rand_core/std", "signature/std", "crypto-bigint/std"] +std = ["digest/std", "pkcs1/std", "pkcs8/std", "rand_core/std", "signature/std", "crypto-bigint/rand"] [package.metadata.docs.rs] features = ["std", "pem", "serde", "hazmat", "sha2"] diff --git a/src/algorithms/generate.rs b/src/algorithms/generate.rs index 8d2284b..5b9fa83 100644 --- a/src/algorithms/generate.rs +++ b/src/algorithms/generate.rs @@ -77,8 +77,7 @@ pub(crate) fn generate_multi_prime_key_with_exp( for (i, prime) in primes.iter_mut().enumerate() { let bits = (todo / (nprimes - i)) as u32; - let bits_precision = BoxedUint::zero_with_precision(bits).bits_precision(); - *prime = generate_prime_with_rng(rng, bits, bits_precision); + *prime = generate_prime_with_rng(rng, bits); todo -= prime.bits() as usize; }