|
29 | 29 | //! platform-dependent.
|
30 | 30 | //!
|
31 | 31 | //! - [`StdRng`] is a CSPRNG chosen for good performance and trust of security
|
32 |
| -//! (based on reviews, maturity and usage). The current algorithm is ChaCha12, |
33 |
| -//! which is well established and rigorously analysed. |
| 32 | +//! (based on reviews, maturity and usage). The current algorithm is |
| 33 | +//! [`ChaCha12Rng`], which is well established and rigorously analysed. |
34 | 34 | //! [`StdRng`] is the deterministic generator used by [`ThreadRng`] but
|
35 | 35 | //! without the periodic reseeding or thread-local management.
|
36 | 36 | //! - [`SmallRng`] is a relatively simple, insecure generator designed to be
|
|
47 | 47 | //! 256 bits of state with good performance in statistical tests of quality
|
48 | 48 | //! - [`Xoshiro128PlusPlus`] is a very fast 32-bit insecure generator using
|
49 | 49 | //! 128 bits of state with good performance in statistical tests of quality
|
| 50 | +//! - [`ChaCha8Rng`], [`ChaCha12Rng`] and [`ChaCha20Rng`] are generators over |
| 51 | +//! the ChaCha stream cipher designed by Daniel J. Bernstein[^1]. |
50 | 52 | //!
|
51 | 53 | //! ### Additional generators
|
52 | 54 | //!
|
|
73 | 75 | //!
|
74 | 76 | //! Use the [`rand_core`] crate when implementing your own RNGs.
|
75 | 77 | //!
|
| 78 | +//! [^1]: D. J. Bernstein, [*ChaCha, a variant of Salsa20*](https://cr.yp.to/chacha.html) |
| 79 | +//! |
76 | 80 | //! [guarantees of reproducibility]: https://rust-random.github.io/book/crate-reprod.html
|
77 | 81 | //! [Types of generators]: https://rust-random.github.io/book/guide-gen.html
|
78 | 82 | //! [Our RNGs]: https://rust-random.github.io/book/guide-rngs.html
|
@@ -122,5 +126,8 @@ pub use self::std::StdRng;
|
122 | 126 | #[cfg(feature = "thread_rng")]
|
123 | 127 | pub use self::thread::ThreadRng;
|
124 | 128 |
|
| 129 | +#[cfg(feature = "chacha")] |
| 130 | +pub use chacha20::{ChaCha8Rng, ChaCha12Rng, ChaCha20Rng}; |
| 131 | + |
125 | 132 | #[cfg(feature = "os_rng")]
|
126 | 133 | pub use rand_core::OsRng;
|
0 commit comments