Skip to content

Commit

Permalink
ReseedingRng: fix doc comment on reseeding behavior after UNIX fork (#…
Browse files Browse the repository at this point in the history
…1317)

It reads "For ChaCha and Hc128 this is a maximum of fifteen `u32` values before
reseeding" while rand_chacha v0.2.0 or higher actually consumes 63 `u32` values
before reseeding.
  • Loading branch information
LiosK committed Jun 4, 2023
1 parent a747b1d commit 51d27a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rngs/adapter/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use rand_core::{CryptoRng, Error, RngCore, SeedableRng};
/// - After `clone()`, the clone will be reseeded on first use.
/// - When a process is forked on UNIX, the RNGs in both the parent and child
/// processes will be reseeded just before the next call to
/// [`BlockRngCore::generate`], i.e. "soon". For ChaCha and Hc128 this is a
/// maximum of fifteen `u32` values before reseeding.
/// [`BlockRngCore::generate`], i.e. "soon". For ChaCha and Hc128, this is a
/// maximum of 63 and 15, respectively, `u32` values before reseeding.
/// - After the PRNG has generated a configurable number of random bytes.
///
/// # When should reseeding after a fixed number of generated bytes be used?
Expand Down

0 comments on commit 51d27a9

Please sign in to comment.