Expand description
Random number generation.
For most purposes in Arti, we use one of two random number generators:
rand::rng()(formerly calledrand::thread_rng(), up till rand 0.9)- The
CautiousRngimplemented here.
CautiousRng should be used whenever we are generating
a medium- or long-term cryptographic key:
one that will be stored to disk, or used for more than a single communication.
It is slower than rand::rng(),
but is more robust against several kinds of failure.
Re-exportsยง
use std::convert::Infallible;๐use digest::ExtendableOutput;๐use digest::Update;๐use rand::rngs::SysRng;๐use rand_core::TryRng;๐use shake::Shake256;๐use zeroize::Zeroizing;๐pub use testing::FakeEntropicRng;
Modulesยง
- backup ๐
- A backup RNG, independent of other known sources.
- testing ๐
- Functionality for testing Rng code that requires an EntropicRng.
Structsยง
- Cautious
Rng - An exceptionally cautious wrapper for
SysRng
Traitsยง
- Entropic
Rng - Trait representing an Rng where every output is derived from supposedly strong entropy.