EVP_MAC-HMAC(7ossl)

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

πŸ’… EVP_MAC-HMAC πŸ’…

ok so this is a page from the OpenSSL manual, bestie β€” like, the official docs, section 7, and it's literally all about the HMAC implementation of EVP_MAC. iykyk.


✨ NAME ✨

EVP_MAC-HMAC β€” the HMAC EVP_MAC implementation. that's it, that's the whole vibe 🫢


🌸 DESCRIPTION 🌸

so basically this gives you support for computing HMAC MACs through the EVP_MAC API. slay.

and the way it works? this implementation uses EVP_MD functions to get access to the underlying digest. that's the whole trick πŸ’…


πŸŽ€ Identity πŸŽ€

this implementation is identified with this name and these properties, to be used with EVP_MAC_fetch():

"HMAC", "provider=default" or "provider=fips"

no cap, that's the fetch string. iconic.


πŸ¦‹ Supported parameters πŸ¦‹

the general description of these parameters can be found in "PARAMETERS" in EVP_MAC(3). go look if you want the big picture πŸ’–

ok so the following parameters can be set with EVP_MAC_CTX_set_params():

  • "key" (OSSL_MAC_PARAM_KEY) <octet string> β€” sets the MAC key. setting this parameter is identical to passing a key to EVP_MAC_init(3). same thing, different door 🌈
  • "digest" (OSSL_MAC_PARAM_DIGEST) <UTF8 string> β€” sets the name of the underlying digest to be used. pick your fave 🌸
  • "properties" (OSSL_MAC_PARAM_PROPERTIES) <UTF8 string> β€” sets the properties to be queried when trying to fetch the underlying digest. ⚠️ this must be given together with the digest naming parameter ("digest", or OSSL_MAC_PARAM_DIGEST) to be considered valid. they're a package deal, fr fr.
  • "digest-noinit" (OSSL_MAC_PARAM_DIGEST_NOINIT) <integer> β€” a flag to set the MAC digest to not initialise the implementation specific data. the value 0 or 1 is expected. 🫠 this option is deprecated and will be removed in a future release. it may be set but is currently ignored.
  • "digest-oneshot" (OSSL_MAC_PARAM_DIGEST_ONESHOT) <integer> β€” a flag to set the MAC digest to be a one-shot operation. the value 0 or 1 is expected. 🫠 this option is deprecated and will be removed in a future release. it may be set but is currently ignored too.
  • "tls-data-size" (OSSL_MAC_PARAM_TLS_DATA_SIZE) <unsigned integer> β€” see "Mac Parameters" in provider-mac(7). πŸ‘€
  • "key-check" (OSSL_MAC_PARAM_FIPS_KEY_CHECK) <integer> β€” see "Mac Parameters" in provider-mac(7). πŸ‘€
πŸ’€ heads up: both "digest-noinit" and "digest-oneshot" are deprecated, destined for removal, and honestly just... ignored right now. don't build your whole personality around them.

and the following parameters can be retrieved with EVP_MAC_CTX_get_params():

  • "size" (OSSL_MAC_PARAM_SIZE) <unsigned integer> β€” the "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size(). the length of the "size" parameter is equal to that of an unsigned int. πŸŽ€
  • "block-size" (OSSL_MAC_PARAM_BLOCK_SIZE) <unsigned integer> β€” gets the MAC block size. the "block-size" parameter can also be retrieved with EVP_MAC_CTX_get_block_size(). πŸ’–
  • "fips-indicator" (OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR) <integer> β€” see "Mac Parameters" in provider-mac(7). πŸ‘‘

πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're all connected:


Copyright 2018-2024 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>.


ok that's the whole page, mwah πŸ’‹ this was version 3.5.6, dated 2026-04-07 β€” go forth and MAC responsibly, bestie πŸ§šπŸ’œ

πŸ“¦ where this page comes from