EVP_MAC-HMAC(7ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… EVP_MAC-HMAC πŸ’…

okay so bestie, welcome to the 7ossl section β€” this is the HMAC implementation page, and it's genuinely one of the good ones. let's get into it πŸŽ€


✨ NAME ✨

EVP_MAC-HMAC β€” the HMAC EVP_MAC implementation. that's it, that's the whole name, she's lowkey iconic for it πŸ‘‘


🌸 DESCRIPTION 🌸

so basically: this is support for computing HMAC MACs through the EVP_MAC API. that's the whole vibe. πŸ¦‹

and here's the cute detail β€” this implementation uses EVP_MD functions to get access to the underlying digest. so she's not doing the digest math herself, she's just calling in her friends at EVP_MD to handle that part. teamwork, fr fr 🫢

πŸŽ€ Identity πŸŽ€

when you go to fetch this implementation with EVP_MAC_fetch(), this is the name and these are the properties you use to find her:

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

that's her whole government name, no cap ✨

πŸ’– Supported parameters πŸ’–

the general description of all these parameters lives over in "PARAMETERS" in EVP_MAC(3) if you want the full lore. but here's the specifics, babes:

the following parameters can be set with EVP_MAC_CTX_set_params():

  • "key" (OSSL_MAC_PARAM_KEY) <octet string> β€” sets the MAC key. and listen, setting this parameter is identical to passing a key to EVP_MAC_init(3). same thing, different door, iykyk πŸ”‘
  • "digest" (OSSL_MAC_PARAM_DIGEST) <UTF8 string> β€” sets the name of the underlying digest that's gonna be used. pick your girl 🌈
  • "properties" (OSSL_MAC_PARAM_PROPERTIES) <UTF8 string> β€” sets the properties to be queried when trying to fetch the underlying digest. and important bestie: this must be given together with the digest naming parameter ("digest", or OSSL_MAC_PARAM_DIGEST) to be considered valid. no solo acts, she needs her plus-one πŸ’…
  • "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. heads up though: this option is deprecated and will be removed in a future release. it may be set but is currently ignored. so like... it's giving decorational at this point πŸ’€
  • "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. also deprecated, also will be removed in a future release, also may be set but is currently ignored. twins πŸ«ΆπŸ™ˆ
  • "tls-data-size" (OSSL_MAC_PARAM_TLS_DATA_SIZE) <unsigned integer>
  • "key-check" (OSSL_MAC_PARAM_FIPS_KEY_CHECK) <integer>

for both of these bad girls, see "Mac Parameters" in provider-mac(7) ✨

and then 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(). and the length of the "size" parameter is equal to that of an unsigned int. little fun fact for you πŸ“
  • "block-size" (OSSL_MAC_PARAM_BLOCK_SIZE) <unsigned integer> β€” gets the MAC block size. and the "block-size" parameter can also be retrieved with EVP_MAC_CTX_get_block_size(). she's got options, love that for her 🧱
  • "fips-indicator" (OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR) <integer> β€” see "Mac Parameters" in provider-mac(7). yes the constant says KDF and we're on a MAC page, no i will not be explaining, the page says what the page says πŸ’€β­

πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, they're all connected, it's a whole ecosystem:


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


okay and that's the page!! πŸ’– she's version 3.5.0, dated 2026-09-25 from the 7ossl manual, and that's the cute little sign-off β€” go forth and HMAC responsibly bestie, mwah πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from