package mirage-crypto-rng
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=09542bcd96c1d368ff9ba8853105f4c1781d8c94c2400df9f3ac0610ee07e67e
sha512=1b31c9df0ce774c87a36f714db4ea1f295bc1e2e317d30497523ec03564cace0f64ac4c535aa83c82792aa3331a92efe774e4c3300a6ffe09110ce0efc2ce24b
doc/mirage-crypto-rng.unix/Mirage_crypto_rng_unix/Urandom/index.html
Module Mirage_crypto_rng_unix.Urandom
Source
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
.
State type for this generator.
Internally, this generator's generate always produces k * block
bytes.
generate_into ~g buf ~off n
produces n
uniformly distributed random bytes into buf
at offset off
, updating the state of g
.
Assumes that buf
is at least off + n
bytes long. Also assumes that off
and n
are positive integers. Caution: do not use in your application, use Mirage_crypto_rng.generate_into
instead.
reseed ~g bytes
directly updates g
. Its new state depends both on bytes
and the previous state.
A generator is seded after a single application of reseed
.
accumulate ~g
is a closure suitable for incrementally feeding small amounts of environmentally sourced entropy into g
.
Its operation should be fast enough for repeated calling from e.g. event loops. Systems with several distinct, stable entropy sources should use stable source
to distinguish their sources.
pools
is the amount of pools if any.