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

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).

Created with MrDocs