package hacl-star

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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:

  • SHA-224, SHA3-224: 28 bytes
  • SHA-256, SHA3-256: 32 bytes
  • SHA-384, SHA3-384: 48 bytes
  • SHA-512, SHA3-512: 64 bytes
  • BLAKE2b: <= 64 bytes
  • BLAKE2s: <= 32 bytes

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

  • SHA-1: 20 bytes
  • MD5: 16 bytes

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.

OCaml

Innovation. Community. Security.