EVP_MD-SHAKE(7ossl)
๐ EVP_MD-SHAKE โ the SHAKE / KECCAK family of EVP_MD implementations โจ
okay so this is the OpenSSL manual page for EVP_MD-SHAKE(7ossl), and bestie, it's basically the origin story of the SHAKE girlies (and their KECCAK-KMAC cousins). Let's get into it ๐ซถ
๐ธ NAME ๐ธ
EVP_MD-SHAKE, EVP_MD-KECCAK-KMAC โ the SHAKE / KECCAK family EVP_MD implementations. that's it, that's the name, iconic ๐
๐ฆ DESCRIPTION ๐ฆ
So this whole thing is about support for computing SHAKE or KECCAK-KMAC digests through the EVP_MD API. lowkey the whole point. ๐ซ
KECCAK-KMAC is an Extendable Output Function (XOF) โ with a definition similar to SHAKE โ and it's used by the KMAC EVP_MAC implementation (go look at EVP_MAC-KMAC(7), iykyk).
๐ Identities ๐
This implementation is available in the FIPS provider as well as the default provider, and ngl it includes these varieties:
KECCAK-KMAC-128โ the known names are"KECCAK-KMAC-128"and"KECCAK-KMAC128". This 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). math but make it slay ๐งฎโจKECCAK-KMAC-256โ the known names are"KECCAK-KMAC-256"and"KECCAK-KMAC256". This 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). same energy, bigger numbers, we love to see it ๐SHAKE-128โ the known names are"SHAKE-128"and"SHAKE128". short and sweet, main character energy ๐SHAKE-256โ the known names are"SHAKE-256"and"SHAKE256". the bigger sister, also iconic ๐
โญ Gettable Parameters โญ
This implementation supports the common gettable parameters described over in EVP_MD-common(7). nothing extra to memorize, you're welcome ๐ซถ
๐ฅ Settable Context Parameters ๐ฅ
These implementations support the following OSSL_PARAM(3) entries, settable for an EVP_MD_CTX with EVP_MD_CTX_set_params(3):
"xoflen"(OSSL_DIGEST_PARAM_XOFLEN)<unsigned integer>โ sets the digest length for extendable output functions. The length of the"xoflen"parameter should not exceed that of asize_t. don't be out here breaking things, bestie ๐ญ
okay so this next part is lowkey important, pay attention ๐ For backwards compatibility reasons, the defaultxoflenlength for SHAKE-128 is 16 (bytes), which results in a security strength of only 64 bits. To ensure the maximum security strength of 128 bits, thexoflenshould be set to at least 32. For backwards compatibility reasons, the defaultxoflenlength for SHAKE-256 is 32 (bytes), which results in a security strength of only 128 bits. To ensure the maximum security strength of 256 bits, thexoflenshould be set to at least 64. like no cap, if you leave it at the default you're not getting the full strength. bump those numbers up ๐
๐ SEE ALSO ๐
the whole friend group, go say hi ๐ซ
๐ COPYRIGHT ๐
Copyright 2020-2022 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 a wrap, bestie ๐ this lil page is from 3.0.21, dated 2026-06-09, straight out of the EVP_MD-SHAKE(7ossl) files. go forth and set your xoflen properly, ily, bye ๐๐ฆโจ
๐ฆ where this page comes from
- freebsd 14.5: base 14.5
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms