Expand description
§Kernel Random Number Generator
This module provides a kernel-level random number generation facility. It abstracts away the underlying entropy sources and provides a unified interface for obtaining random numbers throughout the kernel.
§Architecture
The RNG subsystem consists of:
- A central RNG manager that coordinates entropy sources
- Multiple entropy sources (e.g., virtio-rng, hardware RNG, timer jitter)
- A buffered output that can be accessed via CharDevice interface
§Usage
use crate::random::RandomManager;
// Get random bytes
let mut buffer = [0u8; 32];
RandomManager::get_random_bytes(&mut buffer);Structs§
- Random
Char Device - Character device interface for /dev/random
- Random
Manager - Random number generator manager
Constants§
- RANDOM_
POOL_ 🔒SIZE - Size of the internal random pool buffer
Traits§
- Entropy
Source - Trait for entropy sources that can provide random data