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.
//!
//! SLH-DSA requires a source of cryptographic randomness for key generation and
//! hedged signing. This module provides a simple trait and a default implementation
//! backed by the operating system's entropy source.
use SlhDsaError;
/// Trait for cryptographic random byte generation.
///
/// Implementors must provide bytes that are indistinguishable from uniform random
/// to any computationally bounded adversary. The default implementation ([`OsRng`])
/// reads from `/dev/urandom`.
///
/// Custom implementations can be provided for testing (deterministic RNG) or for
/// environments where `/dev/urandom` is unavailable.
/// 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.
;