package nocrypto

  1. Overview
  2. Docs
type t

Hash state.

val digest_size : int

Size of hash results, in bytes.

val init : unit -> t

Create a new hash state.

val feed : t -> Cstruct.t -> unit

Hash the input, updating the state.

val get : t -> Cstruct.t

Extract the digest; state becomes invalid.

val digest : Cstruct.t -> Cstruct.t

Compute the digest.

val digestv : Cstruct.t list -> Cstruct.t

Compute the digest.

val hmac : key:Cstruct.t -> Cstruct.t -> Cstruct.t

hmac ~key bytes is authentication code for bytes under the secret key, generated using the standard HMAC construction over this hash algorithm.