EVP_PKEY-HMAC(7ossl)

πŸ“¦ version 14.5, in freebsd 14.5

πŸ’… EVP_PKEY-HMAC β€” the legacy MAC keytype page (7ossl, bestie)

okay so real talk: this is the 7ossl manual page from OpenSSL, and it's all about the legacy MAC keytypes. It's giving "backwards compatibility era" and honestly we love her for still showing up πŸ’–

🌸 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 πŸ¦‹

So here's the tea β˜•: the HMAC and CMAC key types are implemented in OpenSSL's default provider and the FIPS provider. And extra bonus? The Siphash and Poly1305 key types are implemented in the default provider (just the default one, bestie, don't @ me).

Doing MAC operations via an EVP_PKEY is considered legacy β€” it's only there for backwards compatibility purposes and for a restricted set of algorithms. Not the main character anymore, lowkey. The preferred way of doing MAC operations is via the EVP_MAC APIs. See EVP_MAC_init(3) β€” that's the one you actually want, iykyk.

For further details on using EVP_PKEY based MAC keys, go check out EVP_SIGNATURE-HMAC(7), EVP_SIGNATURE-Siphash(7), EVP_SIGNATURE-Poly1305(7) or EVP_SIGNATURE-CMAC(7). Slay, they each get their own page 🫢

✨ Common MAC parameters ✨

All the MAC keytypes support these parameters right here:

  • "priv" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string> β€” literally just the MAC key value πŸ’œ
  • "properties" (OSSL_PKEY_PARAM_PROPERTIES) <UTF8 string> β€” a property query string to be used when any algorithms are fetched 🌈

πŸŽ€ CMAC parameters πŸŽ€

As well as the parameters described above, the CMAC keytype additionally supports these β€” she's extra, we respect it:

  • "cipher" (OSSL_PKEY_PARAM_CIPHER) <UTF8 string> β€” the name of a cipher to be used when generating the MAC πŸ”₯
  • "engine" (OSSL_PKEY_PARAM_ENGINE) <UTF8 string> β€” the name of an engine to be used for the specified cipher (if any) πŸ‘‘

⭐ Common MAC key generation parameters ⭐

okay this part is genuinely iconic and a little weird: MAC key generation is unusual in that no new key is actually generated. 😭 Like, at all. Instead, a new provider side key object is created with the supplied raw key value. Why? For backwards compatibility with previous versions of OpenSSL, periodt.

  • "priv" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string> β€” the MAC key value (yes, again, it's the key value) πŸ“

🧚 CMAC key generation parameters 🧚

In addition to the common MAC key generation parameters, the CMAC key generation additionally recognises this one:

  • "cipher" (OSSL_PKEY_PARAM_CIPHER) <UTF8 string> β€” the name of a cipher to be used when generating the MAC πŸ’«

πŸ”₯ SEE ALSO πŸ”₯

EVP_KEYMGMT(3), EVP_PKEY(3), provider-keymgmt(7) β€” go read these, bestie, they're the supporting cast and they ate πŸ’…


Copyright 2020 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>.

fr fr, read the license before you do anything, don't be that person πŸ™ˆ

and that's the whole page, no cap πŸ’– cute little sign-off: this was OpenSSL 3.0.21, dated 2026-06-09, besties β€” see you in the next manpage! πŸ¦‹πŸŽ€βœ¨

πŸ“¦ where this page comes from