EVP\_PKEY-HMAC(7ossl) OpenSSL EVP\_PKEY-HMAC(7ossl)

# [NAME](#NAME)

EVP\_PKEY-HMAC, EVP\_KEYMGMT-HMAC, EVP\_PKEY-Siphash, EVP\_KEYMGMT-Siphash, EVP\_PKEY-Poly1305, EVP\_KEYMGMT-Poly1305, EVP\_PKEY-CMAC, EVP\_KEYMGMT-CMAC - EVP\_PKEY legacy MAC keytypes and algorithm support

# [DESCRIPTION](#DESCRIPTION)

The **HMAC** and **CMAC** key types are implemented in OpenSSL's default and FIPS providers. Additionally the **Siphash** and **Poly1305** key types are implemented in the default provider. Performing MAC operations via an EVP\_PKEY is considered legacy and are only available for backwards compatibility purposes and for a restricted set of algorithms. The preferred way of performing MAC operations is via the EVP\_MAC APIs. See [**EVP\_MAC\_init**(3)](/man/os/openssl-4.0/EVP_MAC_init.3).

For further details on using EVP\_PKEY based MAC keys see [**EVP\_SIGNATURE-HMAC**(7)](/man/os/openssl-4.0/EVP_SIGNATURE-HMAC.7), [**EVP\_SIGNATURE-Siphash**(7)](/man/os/openssl-4.0/EVP_SIGNATURE-Siphash.7), [**EVP\_SIGNATURE-Poly1305**(7)](/man/os/openssl-4.0/EVP_SIGNATURE-Poly1305.7) or [**EVP\_SIGNATURE-CMAC**(7)](/man/os/openssl-4.0/EVP_SIGNATURE-CMAC.7).

## [Common MAC parameters](#Common_MAC_parameters)

All the **MAC** keytypes support the following parameters.

"priv" (**OSSL\_PKEY\_PARAM\_PRIV\_KEY**) &lt;octet string&gt;

The MAC key value.

"properties" (**OSSL\_PKEY\_PARAM\_PROPERTIES**) &lt;UTF8 string&gt;

A property query string to be used when any algorithms are fetched.

## [CMAC parameters](#CMAC_parameters)

As well as the parameters described above, the **CMAC** keytype additionally supports the following parameters.

"cipher" (**OSSL\_PKEY\_PARAM\_CIPHER**) &lt;UTF8 string&gt;

The name of a cipher to be used when generating the MAC.

## [Common MAC key generation parameters](#Common_MAC_key_generation_parameters)

MAC key generation is unusual in that no new key is actually generated. Instead a new provider side key object is created with the supplied raw key value. This is done for backwards compatibility with previous versions of OpenSSL.

"priv" (**OSSL\_PKEY\_PARAM\_PRIV\_KEY**) &lt;octet string&gt;

The MAC key value.

## [CMAC key generation parameters](#CMAC_key_generation_parameters)

In addition to the common MAC key generation parameters, the CMAC key generation additionally recognises the following.

"cipher" (**OSSL\_PKEY\_PARAM\_CIPHER**) &lt;UTF8 string&gt;

The name of a cipher to be used when generating the MAC.

## [MAC key generation FIPS indicator](#MAC_key_generation_FIPS_indicator)

The following key generation parameter can be retrieved with [**EVP\_PKEY\_CTX\_get\_params**(3)](/man/os/openssl-4.0/EVP_PKEY_CTX_get_params.3) for HMAC and CMAC in the OpenSSL FIPS provider:

"fips-indicator" (**OSSL\_PKEY\_PARAM\_FIPS\_APPROVED\_INDICATOR**) &lt;integer&gt;

Returns 1 if the operation is FIPS approved, or 0 otherwise. See "FIPS indicators" in [**fips\_module**(7)](/man/os/openssl-4.0/fips_module.7) for more information.

# [SEE ALSO](#SEE_ALSO)

[**EVP\_KEYMGMT**(3)](/man/os/openssl-4.0/EVP_KEYMGMT.3), [**EVP\_PKEY**(3)](/man/os/openssl-4.0/EVP_PKEY.3), [**provider-keymgmt**(7)](/man/os/openssl-4.0/provider-keymgmt.7)

# [HISTORY](#HISTORY)

The CMAC parameter *engine* (**OSSL\_PKEY\_PARAM\_ENGINE**) was removed in OpenSSL 4.0.

# [COPYRIGHT](#COPYRIGHT)

Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at &lt;https://www.openssl.org/source/license.html&gt;.

2026-09-29 4.0.3

---

Document: EVP_PKEY-Siphash(7ossl) from openssl-4.0 4.0.3-r0 (Chainguard OS)
