12 lines
529 B
Rust
12 lines
529 B
Rust
//! Randomness comes in from the caller, so every test is deterministic.
|
|
|
|
/// A source of random bytes supplied by the caller.
|
|
///
|
|
/// In production this must be a cryptographically secure generator (the OS generator). Tests pass a fixed,
|
|
/// seeded source. DomiStream never reads randomness any other way: salts, challenges, secrets, the client key,
|
|
/// `rikey`, ENet connect ids and PINs all come from here.
|
|
pub trait RandomSource {
|
|
/// Fills `dest` completely with random bytes.
|
|
fn fill(&mut self, dest: &mut [u8]);
|
|
}
|