Module EverCrypt.HMAC
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 algorithmalg
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 ofmsg
based on hashing algorithmalg
using keykey
.
module Noalloc : sig ... end
Versions of these functions which write their output in a buffer passed in as an argument