Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/issue/40' into issue/43
Browse files Browse the repository at this point in the history
  • Loading branch information
elagergren-spideroak committed Jan 8, 2025
2 parents 6d04f85 + 5eb4692 commit 6c76f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
13 changes: 0 additions & 13 deletions crates/aranya-crypto-core/.gitignore

This file was deleted.

12 changes: 6 additions & 6 deletions crates/aranya-crypto-core/src/csprng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,20 @@ pub(crate) mod trng {
/// Sanity check that two [`ThreadRng`]s are different.
#[test]
fn test_thread_rng() {
fn get_bytes(rng: &ThreadRng) -> [u8; 32] {
fn get_bytes(rng: &mut ThreadRng) -> [u8; 32] {
let mut b = [0; 32];
rng.fill_bytes(&mut b);
b
}
let mut rng = thread_rng();
assert_ne!(get_bytes(&mut rng), get_bytes(&mut rng));
assert_ne!(get_bytes(&thread_rng()), get_bytes(&thread_rng()));
assert_ne!(get_bytes(&thread_rng()), [0; 32]);
assert_ne!(get_bytes(&mut thread_rng()), get_bytes(&mut thread_rng()));
assert_ne!(get_bytes(&mut thread_rng()), [0; 32]);

let rng = thread_rng();
let a = rng.clone();
let b = thread_rng();
assert_ne!(get_bytes(&a), get_bytes(&b));
let mut a = rng.clone();
let mut b = thread_rng();
assert_ne!(get_bytes(&mut a), get_bytes(&mut b));
}
}
}

0 comments on commit 6c76f0c

Please sign in to comment.