Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump rand_core from 0.9.0-alpha.1 to 0.9.0-alpha.2 #369

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion chacha20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ categories = ["cryptography", "no-std"]
[dependencies]
cfg-if = "1"
cipher = { version = "=0.5.0-pre.7", optional = true }
rand_core = { version = "0.9.0-alpha.1", optional = true, default-features = false }
rand_core = { version = "0.9.0-alpha.2", optional = true, default-features = false }
serde = { version = "1.0", features = ["derive"], optional = true }
zeroize = { version = "1.8.1", optional = true }

Expand Down
10 changes: 4 additions & 6 deletions chacha20/src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use core::fmt::Debug;

use rand_core::{
block::{BlockRng, BlockRngCore, CryptoBlockRng},
CryptoRng, Error, RngCore, SeedableRng,
impl_try_rng_from_rng_core, CryptoRng, RngCore, SeedableRng,
};

#[cfg(feature = "serde1")]
Expand Down Expand Up @@ -382,12 +382,10 @@ macro_rules! impl_chacha_rng {
fn fill_bytes(&mut self, dest: &mut [u8]) {
self.core.fill_bytes(dest)
}
#[inline]
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> {
Ok(self.fill_bytes(dest))
}
}

impl_try_rng_from_rng_core!($ChaChaXRng);

impl $ChaChaXRng {
// The buffer is a 4-block window, i.e. it is always at a block-aligned position in the
// stream but if the stream has been sought it may not be self-aligned.
Expand Down Expand Up @@ -733,7 +731,7 @@ pub(crate) mod tests {
let mut rng1 = ChaChaRng::from_seed(seed);
assert_eq!(rng1.next_u32(), 137206642);

let mut rng2 = ChaChaRng::from_rng(rng1).unwrap();
let mut rng2 = ChaChaRng::from_rng(rng1);
assert_eq!(rng2.next_u32(), 1325750369);
}

Expand Down
Loading