EVP_MD-SHAKE(7ossl)

πŸ’– EVP_MD-SHAKE β€” the SHAKE / KECCAK family of EVP_MD implementations πŸ’–

okay bestie, welcome to the EVP_MD-SHAKE(7ossl) page from the OpenSSL manual set. this one's the group chat for the SHAKE and KECCAK-KMAC digest girlies, and honestly they're so fun once you get them. let's get into it 🫢


✨ NAME ✨

EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC β€” these are the EVP_MD implementations for the SHAKE / KECCAK family. that's it, that's the tweet πŸ’…

🌸 DESCRIPTION 🌸

this page covers support for computing SHAKE or KECCAK-KMAC digests through the EVP_MD API. slay.

KECCAK-KMAC is an Extendable Output Function (XOF), defined similarly to SHAKE, and it's the one used by the KMAC EVP_MAC implementation (peep EVP_MAC-KMAC(7), iykyk).

πŸ¦‹ Identities πŸ¦‹

this implementation is available in the FIPS provider as well as the default provider, and it includes these varieties:

  • KECCAK-KMAC-128 known names are "KECCAK-KMAC-128" and "KECCAK-KMAC128". this one is used by EVP_MAC-KMAC128(7). using the notation from NIST FIPS 202 (Section 6.2), we have KECCAK-KMAC-128(M, d) = KECCAK[256](M || 00, d) β€” see the description of KMAC128 in Appendix A of NIST SP 800-185.
  • KECCAK-KMAC-256 known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256". this one is used by EVP_MAC-KMAC256(7). using the notation from NIST FIPS 202 (Section 6.2), we have KECCAK-KMAC-256(M, d) = KECCAK[512](M || 00, d) β€” see the description of KMAC256 in Appendix A of NIST SP 800-185.
  • SHAKE-128 known names are "SHAKE-128" and "SHAKE128".
  • SHAKE-256 known names are "SHAKE-256" and "SHAKE256".

πŸŽ€ Parameters πŸŽ€

this implementation supports the following OSSL_PARAM(3) entries:

  • "xoflen" (OSSL_DIGEST_PARAM_XOFLEN) <unsigned integer> sets or gets the digest length for extendable output functions. heads up bestie: the length of the "xoflen" parameter should not exceed that of a size_t.

also β€” the SHAKE-128 and SHAKE-256 implementations do not have any default digest length. none. zero. nada. πŸ™ˆ

this parameter must be set before calling either EVP_DigestFinal_ex() or EVP_DigestFinal(), because those functions were not designed to handle variable length output. it's recommended to either use EVP_DigestSqueeze() or EVP_DigestFinalXOF() instead. trust me on this one πŸ’€

  • "size" (OSSL_DIGEST_PARAM_SIZE) <unsigned integer> literally just an alias of "xoflen". same vibe, different name ✨

see "PARAMETERS" in EVP_DigestInit(3) for further information related to parameters.

πŸ’œ NOTES πŸ’œ

for SHAKE-128, to ensure the maximum security strength of 128 bits, the output length passed to EVP_DigestFinalXOF() should be at least 32.

for SHAKE-256, to ensure the maximum security strength of 256 bits, the output length passed to EVP_DigestFinalXOF() should be at least 64.

no cap, if you go under those lengths you're not getting the full security strength. don't do that to yourself πŸ₯Ί

🌈 SEE ALSO 🌈

EVP_MD_CTX_set_params(3), provider-digest(7), OSSL_PROVIDER-default(7)

⭐ HISTORY ⭐

since OpenSSL 3.4 the SHAKE-128 and SHAKE-256 implementations have no default digest length. that's the whole lore drop, periodt.

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


and that's the whole page bestie!! version 3.5.9, dated 2026-09-29, filed under EVP_MD-SHAKE(7ossl) β€” mwah, go squeeze some digests responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from