Tezos: library with all the cryptographic primitives used by Tezos
Module type
Class type
Library tezos-crypto
type state

For hashes that offer an incremental interface, the internal state of the algorithm is kept in an object of type state which is initialised using init and needs to be stored and passed as an argument to the other functions in the interface. It is automatically freed when no longer required.

val init : unit -> state

init () initializes and returns an internal state of the hash algorithm

val update : state -> Bytes.t -> unit

update st msg updates the internal state of the hash algorithm st with buffer msg.

val finish : state -> Bytes.t

finish st generates and returns a digest, without invalidating the state, meaning that further calls to update can be made