From 9aa8bc1047b1e61c9bc810956523af40a776d1f2 Mon Sep 17 00:00:00 2001 From: Jeff Pennington Date: Thu, 17 Dec 2020 20:28:58 -0500 Subject: [PATCH] Modified the StdRng documentation - Correctly identifies the engine used as ChaCha12 (not ChaCha20). - Cites the relevant rand crate issue. --- src/rngs/std.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rngs/std.rs b/src/rngs/std.rs index a90d86f7880..80f84336980 100644 --- a/src/rngs/std.rs +++ b/src/rngs/std.rs @@ -22,9 +22,9 @@ pub(crate) use rand_hc::Hc128Core as Core; /// on the current platform, to be statistically strong and unpredictable /// (meaning a cryptographically secure PRNG). /// -/// The current algorithm used is the ChaCha block cipher with 20 rounds. -/// This may change as new evidence of cipher security and performance -/// becomes available. +/// The current algorithm used is the ChaCha block cipher with 12 rounds. Please +/// see this relevant [rand issue] for the discussion. This may change as new +/// evidence of cipher security and performance becomes available. /// /// The algorithm is deterministic but should not be considered reproducible /// due to dependence on configuration and possible replacement in future @@ -32,6 +32,7 @@ pub(crate) use rand_hc::Hc128Core as Core; /// the [rand_chacha] crate directly. /// /// [rand_chacha]: https://crates.io/crates/rand_chacha +/// [rand issue]: https://github.com/rust-random/rand/issues/932 #[cfg_attr(doc_cfg, doc(cfg(feature = "std_rng")))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct StdRng(Rng);