Module random

Module random 

Source
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§

RandomCharDevice
Character device interface for /dev/random
RandomManager
Random number generator manager

Constants§

RANDOM_POOL_SIZE 🔒
Size of the internal random pool buffer

Traits§

EntropySource
Trait for entropy sources that can provide random data