EVP_MAC-BLAKE2(7ossl)

πŸ“¦ version 14.5, in freebsd 14.5

πŸ’… EVP_MAC-BLAKE2 πŸ’…

okay so bestie, welcome to the ossl corner of the manual-verse β€” this is EVP_MAC-BLAKE2(7ossl) and it's literally the whole glow-up on BLAKE2 MACs. no cap, it's a good one.


✨ NAME ✨

EVP_MAC-BLAKE2, EVP_MAC-BLAKE2BMAC, EVP_MAC-BLAKE2SMAC β€” the BLAKE2 EVP_MAC implementations, aka the three icons themselves. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: this is the support for computing BLAKE2 MACs through the EVP_MAC API. that's the whole vibe.

πŸŽ€ Identity πŸŽ€

These implementations are identified with one of these names and properties, to be used with EVP_MAC_fetch():

"BLAKE2BMAC", "provider=default"
"BLAKE2SMAC", "provider=default"

like, that's their whole government name. use it with EVP_MAC_fetch() and they'll show up. πŸ’–

🌸 Supported parameters 🌸

the general description of these parameters lives in "PARAMETERS" in EVP_MAC(3) β€” go read that for the full lore.

Okay so, important: all these parameters (except for "block-size" bestie, not that one) can be set with EVP_MAC_CTX_set_params(). And also β€” the "size" parameter can be retrieved with EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter should not exceed that of a size_t. Likewise, the "block-size" parameter can be retrieved with EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_block_size(). see, we love symmetry. πŸ’…

  • "key" (OSSL_MAC_PARAM_KEY) <octet string> β€” sets the MAC key. it may be at most 64 bytes for BLAKE2BMAC or 32 for BLAKE2SMAC, and at least 1 byte in both cases (yes, one byte minimum, we don't do zero here). setting this parameter is identical to passing a key to EVP_MAC_init(3). same thing, different font. ✨
  • "custom" (OSSL_MAC_PARAM_CUSTOM) <octet string> β€” sets the customization/personalization string. it's an optional value of at most 16 bytes for BLAKE2BMAC or 8 for BLAKE2SMAC, and is empty by default. it's giving "customize your little guy" energy. πŸŽ€
  • "salt" (OSSL_MAC_PARAM_SALT) <octet string> β€” sets the salt. it's an optional value of at most 16 bytes for BLAKE2BMAC or 8 for BLAKE2SMAC, and is empty by default. season to taste, but like, within those limits. πŸ§‚
  • "size" (OSSL_MAC_PARAM_SIZE) <unsigned integer> β€” sets the MAC size. it can be any number between 1 and 32 for EVP_MAC_BLAKE2S or between 1 and 64 for EVP_MAC_BLAKE2B. it is 32 and 64 respectively by default. pick your size, main character. πŸ”₯
  • "block-size" (OSSL_MAC_PARAM_BLOCK_SIZE) <unsigned integer> β€” gets the MAC block size. it is 64 for EVP_MAC_BLAKE2S and 128 for EVP_MAC_BLAKE2B. note this one is a get, not a set β€” read the room. πŸ‘€

🌈 SEE ALSO 🌈

EVP_MAC_CTX_get_params(3), EVP_MAC_CTX_set_params(3), "PARAMETERS" in EVP_MAC(3), OSSL_PARAM(3)


πŸ’œ HISTORY πŸ’œ

The macros and functions described here were added to OpenSSL 3.0. periodt. ⭐


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

like, please actually comply with the License fr fr β€” that's not a vibe thing, that's a legal thing 😭

and that's the tea, bestie πŸ“ this page is from version 3.0.21, dated 2026-06-09 β€” go forth and MAC responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from