Skip to content

Commit 4b8dee5

Browse files
authored
chore(deps): bump rand_core to 0.10.0-rc-5 (#1161)
1 parent 187bcbe commit 4b8dee5

File tree

9 files changed

+79
-56
lines changed

9 files changed

+79
-56
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ lms-signature = { path = "./lms" }
2525
ml-dsa = { path = "./ml-dsa" }
2626
rfc6979 = { path = "./rfc6979" }
2727
slh-dsa = { path = "./slh-dsa" }
28+
29+
crypto-primes = { git = "https://github.com/baloo/crypto-primes.git", branch = "baloo/push-zlqkpkvxqksw" }
30+
rand = { git = "https://github.com/rust-random/rand.git", branch = "push-nzsxxkozrnpy" }

dsa/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ zeroize = { version = "1", default-features = false, features = ["alloc"] }
2929
pkcs8 = { version = "0.11.0-rc.8", optional = true, default-features = false, features = ["alloc"] }
3030

3131
[dev-dependencies]
32-
chacha20 = { version = "0.10.0-rc.6", features = ["rng"] }
32+
chacha20 = { version = "0.10.0-rc.7", features = ["rng"] }
3333
hex = "0.4"
3434
hex-literal = "1"
3535
pkcs8 = { version = "0.11.0-rc.8", default-features = false, features = ["pem"] }
3636
proptest = "1"
3737
getrandom = { version = "0.4.0-rc.0", features = ["sys_rng"] }
3838
sha1 = "0.11.0-rc.2"
3939
der = { version = "0.8.0-rc.10", features = ["derive"] }
40-
rand_core = "0.10.0-rc-3"
40+
rand_core = "0.10.0-rc-5"
4141

4242
[features]
4343
default = ["pkcs8"]

lms/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ hybrid-array = { version = "0.4", features = ["extra-sizes", "zeroize"] }
1717
getrandom = { version = "0.4.0-rc.0", features = ["sys_rng"] }
1818
sha2 = "0.11.0-rc.3"
1919
static_assertions = "1.1"
20-
rand_core = "0.10.0-rc-3"
20+
rand_core = "0.10.0-rc-5"
2121
signature = { version = "3.0.0-rc.6", features = ["alloc", "digest", "rand_core"] }
2222
typenum = { version = "1.17", features = ["const-generics"] }
2323
zeroize = "1.8"

lms/src/ots/mod.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ pub mod tests {
2727
private::SigningKey,
2828
},
2929
};
30+
use core::convert::Infallible;
3031
use digest::{Digest, OutputSizeUser};
3132
use hex_literal::hex;
3233
use hybrid_array::{Array, ArraySize};
33-
use rand_core::{CryptoRng, RngCore, TryRngCore};
34+
use rand_core::{TryCryptoRng, TryRngCore};
3435
use signature::{RandomizedSignerMut, Verifier};
3536
use std::{matches, ops::Add};
3637
use typenum::{Sum, U2};
@@ -128,28 +129,31 @@ pub mod tests {
128129
/// Constant RNG for testing purposes only.
129130
pub struct ConstantRng<'a>(pub &'a [u8]);
130131

131-
impl RngCore for ConstantRng<'_> {
132-
fn next_u32(&mut self) -> u32 {
132+
impl TryRngCore for ConstantRng<'_> {
133+
type Error = Infallible;
134+
135+
fn try_next_u32(&mut self) -> Result<u32, Self::Error> {
133136
let (head, tail) = self.0.split_at(4);
134137
self.0 = tail;
135-
u32::from_be_bytes(head.try_into().unwrap())
138+
Ok(u32::from_be_bytes(head.try_into().unwrap()))
136139
}
137140

138-
fn next_u64(&mut self) -> u64 {
141+
fn try_next_u64(&mut self) -> Result<u64, Self::Error> {
139142
let (head, tail) = self.0.split_at(8);
140143
self.0 = tail;
141-
u64::from_be_bytes(head.try_into().unwrap())
144+
Ok(u64::from_be_bytes(head.try_into().unwrap()))
142145
}
143146

144-
fn fill_bytes(&mut self, dest: &mut [u8]) {
147+
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Self::Error> {
145148
let (hd, tl) = self.0.split_at(dest.len());
146149
dest.copy_from_slice(hd);
147150
self.0 = tl;
151+
Ok(())
148152
}
149153
}
150154

151155
/// WARNING: This is not a secure cryptographic RNG. It is only used for testing.
152-
impl CryptoRng for ConstantRng<'_> {}
156+
impl TryCryptoRng for ConstantRng<'_> {}
153157

154158
#[test]
155159
/// Test Case 2, Appendix F. LMS level 2. https://datatracker.ietf.org/doc/html/rfc8554#appendix-F

ml-dsa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ signature = { version = "3.0.0-rc.6", default-features = false, features = ["dig
4040
# optional dependencies
4141
const-oid = { version = "0.10", features = ["db"], optional = true }
4242
pkcs8 = { version = "0.11.0-rc.8", default-features = false, optional = true }
43-
rand_core = { version = "0.10.0-rc-3", optional = true }
43+
rand_core = { version = "0.10.0-rc-5", optional = true }
4444
zeroize = { version = "1.8.1", optional = true, default-features = false }
4545

4646
[dev-dependencies]

slh-dsa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ digest = "0.11.0-rc.5"
2121
hmac = "0.13.0-rc.3"
2222
hybrid-array = { version = "0.4", features = ["extra-sizes"] }
2323
pkcs8 = { version = "0.11.0-rc.8", default-features = false }
24-
rand_core = { version = "0.10.0-rc-3" }
24+
rand_core = "0.10.0-rc-5"
2525
sha2 = { version = "0.11.0-rc.3", default-features = false }
2626
sha3 = { version = "0.11.0-rc.3", default-features = false }
2727
signature = { version = "3.0.0-rc.6", features = ["rand_core"] }

slh-dsa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! to be resistant to quantum computers.
1515
//!
1616
//! While the API exposed by SLH-DSA is the same as conventional signature schemes, it is important
17-
//! to note that the signatures produced by the algorithm are much larger than classical schemes like EdDSA,
17+
//! to note that the signatures produced by the algorithm are much larger than classical schemes like `EdDSA`,
1818
//! ranging from over 7KB for the smallest parameter set to nearly 50KB at the largest
1919
//!
2020
//! This crate currently allocates signatures and intermediate values on the stack, which may cause problems for

0 commit comments

Comments
 (0)