EVP_MD-SHAKE(7ossl)

๐Ÿ“ฆ version 14.5, in freebsd 14.5

๐Ÿ’… 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 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). math but make it slay ๐Ÿงฎโœจ
  • KECCAK-KMAC-256 โ€” the known names are "KECCAK-KMAC-256" and "KECCAK-KMAC256". This 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). 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 a size_t. don't be out here breaking things, bestie ๐Ÿ˜ญ
okay so this next part is lowkey important, pay attention ๐Ÿ‘€ For backwards compatibility reasons, the default xoflen length 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, the xoflen should be set to at least 32. For backwards compatibility reasons, the default xoflen length 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, the xoflen should 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 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