std1.0.0-beta-7 SafeC docs

Module crypto::rng

#include <std/crypto/rng.h> source

Cryptographic RNG A ChaCha20 keystream generator, seeded from the OS's random source (BCryptGenRandom on Windows, getentropy on macOS, getrandom on Linux), else rdrand (x86-64) or /dev/urandom, or from a caller-supplied 32-byte seed. Freestanding-safe with RngCtx::init_seed() or rdrand. Usage: struct RngCtx rng; rng.init(); rng.fill(buf, n);

Structs

RngCtx

Macros

RNG_BLOCK_SIZEChaCha20 output block (bytes)