Skip to content

Commit b831df8

Browse files
authored
chore(deps): bump crypto-bigint to 0.7.0-pre.3; use core naming conventions (#516)
See: - RustCrypto/crypto-bigint#817
1 parent 01c9228 commit b831df8

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Cargo.lock

Lines changed: 10 additions & 3 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
@@ -22,7 +22,7 @@ pkcs8 = { version = "0.11.0-rc.2", default-features = false, features = ["alloc"
2222
signature = { version = "=3.0.0-pre", default-features = false, features = ["alloc", "digest", "rand_core"] }
2323
spki = { version = "0.8.0-rc.1", default-features = false, features = ["alloc"] }
2424
zeroize = { version = "1.5", features = ["alloc"] }
25-
crypto-bigint = { version = "0.7.0-pre.2", default-features = false, features = ["zeroize", "alloc"] }
25+
crypto-bigint = { version = "0.7.0-pre.3", default-features = false, features = ["zeroize", "alloc"] }
2626
crypto-primes = { version = "0.7.0-dev", default-features = false }
2727

2828
# optional dependencies

src/algorithms/rsa.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ fn blind<R: TryCryptoRng + ?Sized, K: PublicKeyParts>(
190190
}
191191

192192
// r^-1 (mod n)
193-
ir = r.inv_mod(key.n()).into();
193+
ir = r.invert_mod(key.n()).into();
194194
}
195195

196196
let blinded = {
@@ -348,7 +348,7 @@ pub(crate) fn compute_private_exponent_euler_totient(
348348

349349
// NOTE: `mod_inverse` checks if `exp` evenly divides `totient` and returns `None` if so.
350350
// This ensures that `exp` is not a factor of any `(prime - 1)`.
351-
match exp.inv_mod(&totient).into_option() {
351+
match exp.invert_mod(&totient).into_option() {
352352
Some(res) => Ok(res),
353353
None => Err(Error::InvalidPrime),
354354
}
@@ -376,7 +376,7 @@ pub(crate) fn compute_private_exponent_carmicheal(
376376
let gcd = p1.gcd(&q1);
377377
let lcm = p1 / NonZero::new(gcd).expect("gcd is non zero") * &q1;
378378
let exp = exp.resize_unchecked(lcm.bits_precision());
379-
if let Some(d) = exp.inv_mod(&lcm).into() {
379+
if let Some(d) = exp.invert_mod(&lcm).into() {
380380
Ok(d)
381381
} else {
382382
// `exp` evenly divides `lcm`

src/key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ impl RsaPrivateKey {
497497
let p = &self.primes[0];
498498
let q = &self.primes[1];
499499

500-
Option::from(q.inv_mod(p))
500+
Option::from(q.invert_mod(p))
501501
}
502502

503503
/// Performs basic sanity checks on the key.

0 commit comments

Comments
 (0)