Module Hash.Noalloc

Versions of these functions which write their output in a buffer passed in as an argument

For digest, its size must match the size of the digest produced by the algorithm being used:

The legacy algorithms (marked deprecated) should NOT be used for cryptographic purposes. For these, the size of the digest is:

Direct interface

val hash : alg:SharedDefs.HashDefs.alg -> msg:bytes -> digest:bytes -> unit

hash alg msg digest hashes msg using algorithm alg and outputs the result in digest.

Streaming interface

val finish : st:t -> digest:bytes -> unit

finish st digest writes a digest in digest, without invalidating the internal state st.