Skip to main content

Rng

Trait Rng 

Source
pub trait Rng {
    // Required method
    fn fill_bytes(&self, dest: &mut [u8]);
}
Expand description

Trait boundary for cryptographically-secure random byte production.

Implementations MUST produce cryptographically strong randomness. Failing to do so defeats replay protection (DPoP nonces) and capability-ID unpredictability. The trait deliberately exposes only fill_bytes so adapters can route to CSPRNG primitives native to their platform without extra shims.

Required Methods§

Source

fn fill_bytes(&self, dest: &mut [u8])

Fill dest with cryptographically secure random bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Rng + ?Sized> Rng for &T

Source§

fn fill_bytes(&self, dest: &mut [u8])

Implementors§