[#EVP_Q_mac] = EVP_Q_mac :mrdocs: One‐shot MAC computation: fetch the algorithm, process `data,` and write the tag. == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- unsigned char* EVP_Q_mac( xref:OSSL_LIB_CTX.adoc[OSSL_LIB_CTX]* libctx, char const* name, char const* propq, char const* subalg, xref:OSSL_PARAM.adoc[OSSL_PARAM] const* params, void const* key, size_t keylen, unsigned char const* data, size_t datalen, unsigned char* out, size_t outsize, size_t* outlen); ---- == Return Value Pointer to `out` on success, or NULL on failure. == Parameters [cols="1,4"] |=== | Name| Description | *libctx* | Library context used to fetch the MAC, or NULL for the default. | *name* | MAC algorithm name (for example "HMAC" or "CMAC"). | *propq* | Property query for the MAC fetch, or NULL. | *subalg* | Optional sub‐algorithm name (for example the HMAC digest), or NULL. | *params* | Optional OSSL_PARAM array for algorithm setup, or NULL. | *key* | MAC key octets. | *keylen* | Length of `key` in bytes. | *data* | Message bytes to authenticate. | *datalen* | Length of `data` in bytes. | *out* | Buffer that receives the MAC, or NULL to query the required size via `outlen.` | *outsize* | Size of `out` in bytes when `out` is non‐NULL. | *outlen* | On success, receives the number of MAC bytes written (or required if `out` is NULL). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#