package mirage-crypto-rng

  1. Overview
  2. Docs
A cryptographically secure PRNG

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-crypto-0.10.7.tbz
sha256=3e818a760c235c5b684c7b6b43b1cdd2a7dd04e0105b680d524f836eb988a69c
sha512=e9c3e6ac0fa3dae2dda9e91d5362ad08aaa65241b968a0c12484db4042146d6af7b46910784ce41bdd68783eede93f35a81aa37a2cd125dfc43503c78007b8b9

doc/mirage-crypto-rng/Mirage_crypto_rng/Hmac_drbg/index.html

Module Mirage_crypto_rng.Hmac_drbgSource

HMAC_DRBG: A NIST-specified RNG based on HMAC construction over the provided hash.

Parameters

Signature

type g

State type for this generator.

val block : int

Internally, this generator's generate always produces k * block bytes.

val create : ?time:(unit -> int64) -> unit -> g

Create a new, unseeded g.

val generate : g:g -> int -> Cstruct.t

generate ~g n produces n uniformly distributed random bytes, updating the state of g.

val reseed : g:g -> Cstruct.t -> unit

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.

val accumulate : g:g -> Entropy.source -> [ `Acc of Cstruct.t -> unit ]

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.

val seeded : g:g -> bool

seeded ~g is true iff operations won't throw Unseeded_generator.

val pools : int

pools is the amount of pools if any.

OCaml

Innovation. Community. Security.