EVP_MAC-HMAC(7ossl)
π 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 toEVP_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", orOSSL_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 value0or1is 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 value0or1is 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 withEVP_MAC_CTX_get_mac_size(). and the length of the"size"parameter is equal to that of anunsigned 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 withEVP_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 saysKDFand 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:
EVP_MAC_CTX_get_params(3)EVP_MAC_CTX_set_params(3)"PARAMETERS" in EVP_MAC(3)OSSL_PARAM(3)HMAC(3)
π COPYRIGHT π
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
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms