Skip to content

Commit 6f17b32

Browse files
authored
bump crypto-bigint to master, use core naming conventions (#963)
1 parent b66adc0 commit 6f17b32

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ slh-dsa = { path = "./slh-dsa" }
3030
# https://github.com/RustCrypto/traits/pull/1767
3131
# https://github.com/RustCrypto/traits/pull/1774
3232
# https://github.com/RustCrypto/traits/pull/1822
33+
# https://github.com/RustCrypto/traits/pull/1845
3334
elliptic-curve = { git = "https://github.com/RustCrypto/traits.git" }
3435
signature = { git = "https://github.com/RustCrypto/traits.git" }
35-
36+
3637
crypto-primes = { git = "https://github.com/entropyxyz/crypto-primes.git" }

dsa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust-version = "1.85"
1717

1818
[dependencies]
1919
digest = "=0.11.0-pre.10"
20-
crypto-bigint = { version = "=0.7.0-pre.2", default-features = false, features = ["alloc", "zeroize"] }
20+
crypto-bigint = { version = "=0.7.0-pre.3", default-features = false, features = ["alloc", "zeroize"] }
2121
crypto-primes = { version = "=0.7.0-dev", default-features = false }
2222
pkcs8 = { version = "0.11.0-rc.1", default-features = false, features = ["alloc"] }
2323
rfc6979 = { version = "=0.5.0-pre.4" }

dsa/src/generate/secret_number.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ where
4848

4949
let k = BoxedUint::from_be_slice(&buffer, q.bits_precision())
5050
.map_err(|_| signature::Error::new())?;
51-
if let Some(inv_k) = k.inv_mod(q).into() {
51+
if let Some(inv_k) = k.invert_mod(q).into() {
5252
if (bool::from(k.is_nonzero())) && (k < **q) {
5353
return Ok((k, inv_k));
5454
}
@@ -79,7 +79,7 @@ pub fn secret_number<R: TryCryptoRng + ?Sized>(
7979
.expect("[bug] minimum size for q is to 2^(160 - 1)");
8080
let k = (c % rem) + BoxedUint::one();
8181

82-
if let Some(inv_k) = k.inv_mod(q).into() {
82+
if let Some(inv_k) = k.invert_mod(q).into() {
8383
// `k` and `k^-1` both have to be in the range `[1, q-1]`
8484
if (inv_k > BoxedUint::zero() && inv_k < **q) && (k > BoxedUint::zero() && k < **q) {
8585
return Ok(Some((k, inv_k)));

dsa/src/verifying_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl VerifyingKey {
7373
let r = &r.resize(p.bits_precision());
7474
let s = &s.resize(p.bits_precision());
7575

76-
let w: BoxedUint = Option::from(s.inv_mod(q))?;
76+
let w: BoxedUint = Option::from(s.invert_mod(q))?;
7777

7878
let n = q.bits() / 8;
7979
let block_size = hash.len(); // Hash function output size

0 commit comments

Comments
 (0)