Skip to main content

NonceSource

Trait NonceSource 

Source
pub trait NonceSource {
    // Required method
    fn fill(&self, out: &mut [u8]);
}
Expand description

Per-kind nonce generator. Production uses OsNonceSource (the getrandom syscall wrapper baked into the AEAD crates). Tests plug in a fixed value for bit-identical fixtures.

Required Methods§

Source

fn fill(&self, out: &mut [u8])

Fill out with len fresh nonce bytes. len matches NonceBytes::expected_len for the active AEAD kind; panics / short writes are illegal — return an error via the caller’s wrapper if needed.

Implementors§