Skip to content

Commit 916e693

Browse files
committed
Implement CryptoRng for EntropyRng and StdRng
1 parent 4acef1b commit 916e693

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/entropy_rng.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Entropy generator, or wrapper around external generators
1212
13-
use rand_core::{RngCore, Error, impls};
13+
use rand_core::{RngCore, CryptoRng, Error, impls};
1414
use {OsRng, JitterRng};
1515

1616
/// An RNG provided specifically for seeding PRNGs.
@@ -140,6 +140,8 @@ impl RngCore for EntropyRng {
140140
}
141141
}
142142

143+
impl CryptoRng for EntropyRng {}
144+
143145
#[cfg(test)]
144146
mod test {
145147
use super::*;

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ impl SeedableRng for StdRng {
865865
}
866866
}
867867

868+
impl CryptoRng for StdRng {}
869+
868870
/// An RNG recommended when small state, cheap initialization and good
869871
/// performance are required. The PRNG algorithm in `SmallRng` is chosen to be
870872
/// efficient on the current platform, **without consideration for cryptography

0 commit comments

Comments
 (0)