Core operations
val empty : tempty is the hash of the empty string.
feed t msg adds the information in msg to t.
feed is analogous to appending: feed (feed t msg1) msg2 = feed t (Cstruct.append msg1 msg2).
val get : t -> Mirage_crypto.Hash.digestget t is the digest corresponding to t.
All-in-one
val digest : Cstruct.t -> Mirage_crypto.Hash.digestdigest msg is the digest of msg.
digest msg = get (feed empty msg)
val hmac : key:Cstruct.t -> Cstruct.t -> Mirage_crypto.Hash.digesthmac ~key bytes is the authentication code for bytes under the secret key, generated using the standard HMAC construction over this hash algorithm.
Functions over iterators
val feedi : t -> Cstruct.t Mirage_crypto.Hash.iter -> tfeedi t iter =
(let r = ref t in iter (fun msg -> r := feed !r msg); !r)
val digesti : Cstruct.t Mirage_crypto.Hash.iter -> Mirage_crypto.Hash.digestdigesti iter = feedi empty iter |> get
val hmaci : key:Cstruct.t -> Cstruct.t Mirage_crypto.Hash.iter -> Mirage_crypto.Hash.digestSee hmac.