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§
Sourcefn fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), MlDsaError>
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.