EVP_MAC_init

Initialize a MAC context with a key and optional algorithm parameters.

Synopsis

Declared in <openssl/evp.h>

int
EVP_MAC_init(
    EVP_MAC_CTX* ctx,
    unsigned char const* key,
    size_t keylen,
    OSSL_PARAM const params[]);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
ctxMAC context created with EVP_MAC_CTX_new().
keyMAC key octets.
keylenLength of key in bytes.
paramsOptional OSSL_PARAM array (for example digest selection), or NULL.