package mirage-crypto-rng
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=5430ce3c3e40627d2d67a8decf565a1f612d39bdb33f9b767c3bdb601ff5a196
sha512=de029e01cbb8d49f9b8fbcd02ef4777435927118c9ce7a859a8193fdbec30d1a7b3a2964ee8ec722f5fa74fec1bfdc054dcdc97ad1db6e2ced359d6c010c043a
doc/mirage-crypto-rng.unix/Mirage_crypto_rng_unix/index.html
Module Mirage_crypto_rng_unix
Source
RNG seeding on Unix.
This module initializes a Fortuna RNG with getrandom()
, and CPU RNG. On BSD systems (FreeBSD, OpenBSD, macOS) getentropy ()
is used instead of getrandom ()
. On Windows 10 or higher, BCryptGenRandom()
is used with the default RNG. Windows 8 or lower are not supported by this library.
initialize ~g rng
will bring the RNG into a working state.
getrandom size
returns a buffer of size
filled with random bytes.
A generator that opens /dev/urandom and reads from that file descriptor data whenever random data is needed. The file descriptor is closed in at_exit
.
A generator using getrandom(3)
on Linux, getentropy(3)
on BSD and macOS, and BCryptGenRandom()
on Windows.
use_default ()
initializes the RNG Mirage_crypto_rng.default_generator
with a sensible default, at the moment using Getentropy
.
use_dev_random ()
initializes the RNG Mirage_crypto_rng.default_generator
with the Urandom
generator. This raises an exception if "/dev/urandom" cannot be opened.
use_getentropy ()
initializes the RNG Mirage_crypto_rng.default_generator
with the Getentropy
generator.