package mirage-crypto-rng-mirage

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

module T : Mirage_time.S

Signature

val initialize : ?g:'a -> ?sleep:int64 -> (module Mirage_crypto_rng.Generator with type g = 'a) -> unit Lwt.t

initialize ~g ~sleep rng_module sets the default generator to the rng_module and sets up periodic entropy feeding for that rng. This function fails (Lwt.fail) if it is called a second time. The argument ~sleep is measured in ns, and used as sleep between cpu assisted random number collection. It defaults to one second.

type g

The state of the gnerator.

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

generate ~g n generates a random buffer of length n using g.

OCaml

Innovation. Community. Security.