1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Minimal cryptographic RNG trait and OS-backed implementation.
//!
//! Provides the [`CryptoRng`] trait used by ML-DSA for key generation and
//! hedged signing, along with [`OsRng`], a simple implementation backed by
//! the operating system's entropy source.
use MlDsaError;
/// 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.
/// OS-backed cryptographic RNG reading from `/dev/urandom`.
///
/// Only available with the `std` feature. In `no_std` builds, callers
/// must supply their own [`CryptoRng`] implementation.
;