pub struct ChaCha20Rng { /* private fields */ }Expand description
A deterministic ChaCha20 generator seeded entirely by its caller.
This type never obtains operating-system entropy. A caller that uses it for cryptography must provide a fresh, unpredictable 32-byte seed and must not reuse that seed across independent generator instances.
The generator intentionally does not implement Clone: duplicating a
stream state can repeat nonces or key material.
ⓘ
use dcrypt_internal::random::ChaCha20Rng;
let generator = ChaCha20Rng::from_seed([7u8; 32]);
let duplicate = generator.clone();Implementations§
Trait Implementations§
impl CryptoRng for ChaCha20Rng
Source§impl Drop for ChaCha20Rng
impl Drop for ChaCha20Rng
Source§impl RngCore for ChaCha20Rng
impl RngCore for ChaCha20Rng
Source§fn try_fill_bytes(&mut self, destination: &mut [u8]) -> Result<(), Error>
fn try_fill_bytes(&mut self, destination: &mut [u8]) -> Result<(), Error>
Fill
destination, propagating failures from the caller’s entropy
source rather than silently substituting weak randomness.fn next_u32(&mut self) -> u32
fn next_u64(&mut self) -> u64
fn fill_bytes(&mut self, destination: &mut [u8])
impl ZeroizeOnDrop for ChaCha20Rng
Auto Trait Implementations§
impl Freeze for ChaCha20Rng
impl RefUnwindSafe for ChaCha20Rng
impl Send for ChaCha20Rng
impl Sync for ChaCha20Rng
impl Unpin for ChaCha20Rng
impl UnsafeUnpin for ChaCha20Rng
impl UnwindSafe for ChaCha20Rng
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more