EVP_PKEY-HMAC(7ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

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

okay so this is the OpenSSL manual page EVP_PKEY-HMAC(7ossl) and it covers a whole little squad of keytypes, so let's get into it ✨

πŸŽ€ 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 β€” these are the EVP_PKEY legacy MAC keytypes and they're all about algorithm support 🫢


🌸 DESCRIPTION 🌸

So here's the tea β˜• β€” the HMAC and CMAC key types are implemented in OpenSSL's default and FIPS providers. And btw, the Siphash and Poly1305 key types are also implemented in the default provider. Slay.

Now, doing MAC operations via an EVP_PKEY? Lowkey considered legacy, bestie 😭. It's 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). That's the main character move, fr fr.

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). iykyk πŸ’œ

✨ Common MAC parameters ✨

All the MAC keytypes support the following parameters, no cap:

  • "priv" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string> β€” 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 the following parameters. So it's giving ✨ extra ✨:

  • "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 β€” 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. The way that it just... clones the vibe πŸ’€

  • "priv" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string> β€” the MAC key value πŸ”‘

πŸ¦‹ 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) <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 too, bestie, they're iconic πŸ’…


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>. 🫢


okay that's the whole page, 10/10, no notes πŸ’–

and that's a wrap, bestie β€” this was version 3.5.6, dated 2026-04-07, and it's the EVP_PKEY-HMAC(7ossl) page. periodt. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from