This module provides one-shot RNG seeding from the Unix kernel RNG, typically
Calling initialize is enough to bring the RNG into a working state.
initialize is idempotent as long as the default generator is unchanged.
It is harmless to call it several times.
If you are using lwt, conside using
Nocrypto_entropy_lwt as this
module allows for continuous reseeding.
Unless you want to recover from an unlikely case of missing system RNG, the
recommended way to prime the RNG is to invoke
initialize at the module
let () = Nocrypto_entropy_unix.initialize ()
val initialize :
unit -> unit
This is the closest thing to
Random.self_init and is a good way to prime
val sys_rng :
val reseed :
?bytes:int -> ?device:string -> Nocrypto.Rng.g -> unit
reseed ~bytes ~gmixes in
bytesbytes from the system RNG into the generator
bytes default to a small value reasonable for periodic reseeding.
device defaults to sys_rng.