Module EverCrypt.DRBG
Agile, multiplexing interface for HMAC-DRBG
The supported hashing algorithms are SHA2-256, SHA2-384, SHA2-512.
Users first need to instantiate an internal state with a compatible hashing algorithm and an optional but recommended personalization string. The generate or Noalloc.generate functions can then be called any number of times.
Users have the possibility to reseed, but it is not required.
val is_supported_alg : SharedDefs.HashDefs.alg -> boolis_supported_alg algreturns true if the hashing algorithmalgis supported in the agile HMAC-DRBG interface.
val instantiate : ?personalization_string:bytes -> SharedDefs.HashDefs.alg -> t optioninstantiate ?personalization_string algallocates the internal state for algorithmalgusing the optionalpersonalization_stringand returns at.
val generate : ?additional_input:bytes -> t -> int -> bytes optiongenerate ?additional_input st sizetakes optionaladditional_input, a statestandsize, the desired number of random bytes, and returns such a buffer if successful.
val reseed : ?additional_input:bytes -> t -> boolreseed ?additional_input stattempts to reseedst, using the optionaladditional_inputand returns true if successful.
module Noalloc : sig ... endVersions of these functions which write their output in a buffer passed in as an argument