package hacl-star

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

Agile, multiplexing interface for HMAC

The hashing algorithms currently supported are the same as for the agile hashing interface:

  • SHA-2 (SHA-256, SHA-384, SHA-512)
  • BLAKE2 (BLAKE2b, BLAKE2s)

For HMAC with SHA2, the output buffer is the same size as the digest size of the corresponding hash function (see here). For HMAC with BLAKE2, the output buffer is 64 bytes for BLAKE2b and 32 bytes for BLAKE2s.

val is_supported_alg : alg:SharedDefs.HashDefs.alg -> bool

is_supported_alg alg returns true if the hashing algorithm alg is supported in the agile HMAC interface.

val mac : alg:SharedDefs.HashDefs.alg -> key:bytes -> msg:bytes -> bytes

mac alg key msg computes the HMAC of msg based on hashing algorithm alg using key key.

module Noalloc : sig ... end

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

OCaml

Innovation. Community. Security.