oxicrypto-core 0.1.1

Pure Rust cryptography trait surface (no_std + alloc)
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::CryptoError;

/// Cryptographically-secure random number generator.
///
/// When the `debug` Cargo feature is enabled this trait gains `Debug` as a
/// supertrait, enabling `Box<dyn Rng>` to be formatted with `{:?}`.
pub trait Rng: Send + Sync + crate::traits::MaybeDebug {
    /// Fill `dst` with cryptographically secure random bytes.
    #[must_use = "result must be checked"]
    fn fill(&mut self, dst: &mut [u8]) -> Result<(), CryptoError>;
}