EVP_PKEY-HMAC(7SSL)
π EVP_PKEY-HMAC β the legacy MAC keytypes, but make it a group chat π
okay so bestie, this is the EVP_PKEY-HMAC(7SSL) page from the OpenSSL manual β and it's literally about a whole little squad of legacy MAC keytypes. So sit down, grab a boba, and let me tell you about EVP_PKEY-HMAC, EVP_KEYMGMT-HMAC, EVP_PKEY-Siphash, EVP_KEYMGMT-Siphash, EVP_PKEY-Poly1305, EVP_KEYMGMT-Poly1305, EVP_PKEY-CMAC and EVP_KEYMGMT-CMAC. Yes that's a lot of names, no I'm not typing them again, they're all one vibe: EVP_PKEY legacy MAC keytypes and algorithm support β¨
πΈ DESCRIPTION πΈ
So here's the tea π: the HMAC and CMAC key types live inside OpenSSL's default and FIPS providers. And on top of that, the Siphash and Poly1305 key types are implemented in the default provider.
Now the important part, bestie, listen up π β doing MAC operations through an EVP_PKEY is considered legacy. It's only there for backwards compatibility purposes and only for a restricted set of algorithms. The preferred way of doing MAC operations is through the EVP_MAC APIs. Go look at EVP_MAC_init(3), she's the icon here π
Wanna know more about using EVP_PKEY-based MAC keys? The girls have their own pages: EVP_SIGNATURE-HMAC(7), EVP_SIGNATURE-Siphash(7), EVP_SIGNATURE-Poly1305(7) and EVP_SIGNATURE-CMAC(7). Slay π
π Common MAC parameters π
Every single one of these MAC keytypes supports the following parameters, no cap:
"priv"(OSSL_PKEY_PARAM_PRIV_KEY)<octet string>β the MAC key value itself. That's the secret, bestie, protect it π«Ά"properties"(OSSL_PKEY_PARAM_PROPERTIES)<UTF8 string>β a property query string that gets used whenever any algorithms are fetched. It's giving β¨*algorithm vibes selector*β¨.
π¦ CMAC parameters π¦
And as well as everything above, the CMAC keytype is extra and additionally supports this one:
"cipher"(OSSL_PKEY_PARAM_CIPHER)<UTF8 string>β the name of a cipher to be used when generating the MAC π
π Common MAC key generation parameters π
okay so MAC key generation is lowkey unusual β no new key is actually generated. Not even kidding. Instead, a new provider-side key object gets created with the raw key value you supplied. Why? For backwards compatibility with previous versions of OpenSSL, periodt π
"priv"(OSSL_PKEY_PARAM_PRIV_KEY)<octet string>β the MAC key value. Yeah it's the same one. She's consistent, we respect her π
π CMAC key generation parameters π
On top of the common MAC key generation parameters, the CMAC key generation additionally recognises this:
"cipher"(OSSL_PKEY_PARAM_CIPHER)<UTF8 string>β the name of a cipher to be used when generating the MAC π₯
π MAC key generation FIPS indicator π
This next key generation parameter can be retrieved with EVP_PKEY_CTX_get_params(3) for HMAC and CMAC in the OpenSSL FIPS provider:
"fips-indicator"(OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR)<integer>β returns1if the operation is FIPS approved, or0otherwise. Peep "FIPS indicators" infips_module(7)for more info π§
β¨ SEE ALSO β¨
Go read your sisters, bestie, iykyk:
π HISTORY π
RIP to a real one: the CMAC parameter engine (OSSL_PKEY_PARAM_ENGINE) was removed in OpenSSL 4.0. She's gone, she's not coming back, we mourn π
π 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 <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie!! π«Ά this was OpenSSL version 4.0.3, dated 2026-09-29 β thanks for reading, mwah, go use EVP_MAC instead, ily π
β¨πΈ
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms