Skip to content

Commit

Permalink
update to latest crypto bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Nov 6, 2024
1 parent 1794360 commit ac41749
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
22 changes: 16 additions & 6 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down Expand Up @@ -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"]
Expand Down
3 changes: 1 addition & 2 deletions src/algorithms/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ pub(crate) fn generate_multi_prime_key_with_exp<R: CryptoRngCore>(

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;
}

Expand Down

0 comments on commit ac41749

Please sign in to comment.