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

Name

Description

ctx

MAC context created with EVP_MAC_CTX_new().

key

MAC key octets.

keylen

Length of key in bytes.

params

Optional OSSL_PARAM array (for example digest selection), or NULL.

Created with MrDocs