EVP_Q_mac

One-shot MAC computation: fetch the algorithm, process data, and write the tag.

Synopsis

Declared in <openssl/evp.h>

unsigned char*
EVP_Q_mac(
    OSSL_LIB_CTX* libctx,
    char const* name,
    char const* propq,
    char const* subalg,
    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

NameDescription
libctxLibrary context used to fetch the MAC, or NULL for the default.
nameMAC algorithm name (for example "HMAC" or "CMAC").
propqProperty query for the MAC fetch, or NULL.
subalgOptional sub-algorithm name (for example the HMAC digest), or NULL.
paramsOptional OSSL_PARAM array for algorithm setup, or NULL.
keyMAC key octets.
keylenLength of key in bytes.
dataMessage bytes to authenticate.
datalenLength of data in bytes.
outBuffer that receives the MAC, or NULL to query the required size via outlen.
outsizeSize of out in bytes when out is non-NULL.
outlenOn success, receives the number of MAC bytes written (or required if out is NULL).