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-128known names are"KECCAK-KMAC-128"and"KECCAK-KMAC128". this one is used byEVP_MAC-KMAC128(7). using the notation from NIST FIPS 202 (Section 6.2), we haveKECCAK-KMAC-128(M, d) = KECCAK[256](M || 00, d)β see the description of KMAC128 in Appendix A of NIST SP 800-185.KECCAK-KMAC-256known names are"KECCAK-KMAC-256"and"KECCAK-KMAC256". this one is used byEVP_MAC-KMAC256(7). using the notation from NIST FIPS 202 (Section 6.2), we haveKECCAK-KMAC-256(M, d) = KECCAK[512](M || 00, d)β see the description of KMAC256 in Appendix A of NIST SP 800-185.SHAKE-128known names are"SHAKE-128"and"SHAKE128".SHAKE-256known 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 asize_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 π
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
- alpine 3.23: openssl-doc 3.5.9-r0 Β· Apache-2.0
- alpine 3.24: openssl-doc 3.5.9-r0 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms