[#HMAC] = HMAC :mrdocs: Compute an HMAC over `data` using digest `evp_md` and key `key.` == Synopsis Declared in `<openssl/hmac.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- unsigned char* HMAC( xref:EVP_MD.adoc[EVP_MD] const* evp_md, void const* key, int key_len, unsigned char const* data, size_t data_len, unsigned char* md, unsigned int* md_len); ---- == Description Uses the default OSSL_LIB_CTX; prefer EVP_Q_mac() when a library context is required. == Return Value Pointer to the MAC bytes (`md` or the static buffer), or NULL on error. == Parameters [cols="1,4"] |=== | Name| Description | *evp_md* | Message digest (e.g. EVP_sha256()); variable‐length digests such as SHAKE are not supported. | *key* | HMAC key material, or NULL when `key_len` is 0. | *key_len* | Length of `key` in bytes. | *data* | Message bytes to authenticate. | *data_len* | Number of bytes at `data.` | *md* | Output buffer of at least EVP_MAX_MD_SIZE bytes, or NULL to use a static buffer (not thread‐safe). | *md_len* | Receives the MAC length in bytes; may be NULL. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#