Skip to main content

CryptoRng

Trait CryptoRng 

Source
pub trait CryptoRng {
    // Required method
    fn fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), MlDsaError>;
}
Expand description

Trait for cryptographic random byte generation.

Implementors must fill the destination buffer with cryptographically secure random bytes. This trait is used as a trait object (&mut dyn CryptoRng) throughout the ML-DSA API to allow callers to supply their own RNG.

Required Methods§

Source

fn fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), MlDsaError>

Fill dest with cryptographically secure random bytes.

§Errors

Returns MlDsaError::RngFailure if the underlying entropy source is unavailable or fails.

Implementors§

Source§

impl CryptoRng for OsRng

Available on crate feature std only.