Skip to content

Commit 16d8eaf

Browse files
authored
Bump crypto-bigint dependency to v0.7.0-rc.26 (#658)
1 parent ca31a4a commit 16d8eaf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exclude = ["marvin_toolkit/", "thirdparty/"]
1515

1616
[dependencies]
1717
const-oid = { version = "0.10", default-features = false }
18-
crypto-bigint = { version = "0.7.0-rc.25", default-features = false, features = ["zeroize", "alloc"] }
18+
crypto-bigint = { version = "0.7.0-rc.26", default-features = false, features = ["zeroize", "alloc"] }
1919
crypto-primes = { version = "0.7.0-pre.8", default-features = false }
2020
digest = { version = "0.11.0-rc.11", default-features = false, features = ["alloc", "oid"] }
2121
rand_core = { version = "0.10", default-features = false }

src/key.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl RsaPrivateKey {
379379
// Check that the product of primes matches the modulus.
380380
// This also ensures that `bit_precision` of each prime is <= that of the modulus,
381381
// and `bit_precision` of their product is >= that of the modulus.
382-
if &primes.iter().fold(BoxedUint::one(), |acc, p| acc * p) != n_c.as_ref() {
382+
if primes.iter().fold(BoxedUint::one(), |acc, p| acc * p) != n_c.as_ref() {
383383
return Err(Error::InvalidModulus);
384384
}
385385
}
@@ -555,12 +555,12 @@ impl RsaPrivateKey {
555555
.ok_or(Error::InvalidPrime)?;
556556
let q_params = BoxedMontyParams::new(q_odd);
557557

558-
let x = NonZero::new(p.wrapping_sub(&BoxedUint::one()))
558+
let x = NonZero::new(p.wrapping_sub(BoxedUint::one()))
559559
.into_option()
560560
.ok_or(Error::InvalidPrime)?;
561561
let dp = d.rem_vartime(&x);
562562

563-
let x = NonZero::new(q.wrapping_sub(&BoxedUint::one()))
563+
let x = NonZero::new(q.wrapping_sub(BoxedUint::one()))
564564
.into_option()
565565
.ok_or(Error::InvalidPrime)?;
566566
let dq = d.rem_vartime(&x);
@@ -769,7 +769,7 @@ fn validate_private_key_parts(key: &RsaPrivateKey) -> Result<()> {
769769
let de = key.d.mul(&key.pubkey_components.e);
770770

771771
for prime in &key.primes {
772-
let x = NonZero::new(prime.wrapping_sub(&BoxedUint::one())).unwrap();
772+
let x = NonZero::new(prime.wrapping_sub(BoxedUint::one())).unwrap();
773773
let congruence = de.rem_vartime(&x);
774774
if !bool::from(congruence.is_one()) {
775775
return Err(Error::InvalidExponent);

0 commit comments

Comments
 (0)