Skip to content
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
4 changes: 2 additions & 2 deletions src/smallrng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::rng::Rng;
use crate::rng::{RangeFromRng, ValueFromRng};
use crate::xoshiro::Xoshiro256pp;
#[cfg(feature = "std")]
use crate::SecureEntropy;
use crate::DefaultEntropy;
use crate::SplitMix;

/// This is a numerically good PRNG if you need something small and fast
Expand Down Expand Up @@ -37,7 +37,7 @@ impl SmallRng {
#[cfg(feature = "std")]
#[must_use]
pub fn new() -> Self {
Self(Impl::from_entropy(&mut SecureEntropy::new()))
Self(Impl::from_entropy(&mut DefaultEntropy::new()))
}

/// Creates a new random generator with a seed from an [EntropySource].
Expand Down
8 changes: 8 additions & 0 deletions src/stdrng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ impl Rng for StdRng {
impl StdRng {
/// Creates a new random generator with a seed from a [SecureEntropy].
/// This type of entropy source performs health tests on the system entropy source for extra security.
/// Note that [SecureEntropy] has a small false alarm rate, which can cause intermittent fuzz test errors
/// if a new [StdRng] instance is created for each fuzz test vector.
/// If you need to avoid this then create your instances with `from_entropy` and pass in a [DefaultEntropy] instead.
///
/// returns: `StdRng`
#[cfg(feature = "std")]
Expand Down Expand Up @@ -228,6 +231,11 @@ impl StdRng {

#[cfg(feature = "std")]
impl Default for StdRng {
/// Creates a new random generator with a seed from a [SecureEntropy].
/// This type of entropy source performs health tests on the system entropy source for extra security.
/// Note that [SecureEntropy] has a small false alarm rate, which can cause intermittent fuzz test errors
/// if a new [StdRng] instance is created for each fuzz test vector.
/// If you need to avoid this then create your instances with `from_entropy` and pass in a [DefaultEntropy] instead.
fn default() -> Self {
Self::new()
}
Expand Down