SHAKE
The extendable-output functions of FIPS 202, producing any length of output from Keccak
Overview
SHAKE128 and SHAKE256 are extendable-output functions (XOFs) standardised in FIPS 202 alongside SHA-3. Instead of a fixed digest they produce as many output bytes as requested, which makes them useful for key derivation, mask generation and post-quantum schemes.
SHAKE uses the Keccak sponge exactly as SHA-3 does but with the domain-separation suffix 1111 and capacities of 256 and 512 bits respectively, giving 128-bit and 256-bit security. After absorbing the input, the sponge can be squeezed indefinitely. A shorter output is always a prefix of a longer one for the same input, which differs from hash functions where each length is a separate function.
In NextSSL SHAKE128 is listed as its own family and SHAKE256 is grouped with SHA-3. Both are heavily used inside ML-KEM and ML-DSA to expand seeds into matrices and noise, and as the basis of cSHAKE and KMAC. SHAKE output can be read incrementally, so callers need not know the length in advance.
History
2015–2015Specified in FIPS 202
Security notes
SHAKE has no known weaknesses. Its security is capped by its capacity regardless of output length: SHAKE128 gives at most 128-bit security even if more than 256 bits are read. Because outputs of different lengths share a prefix, protocols should fix or encode the length when that matters.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| SHAKE128 shake128 |
standard FIPS | — | FIPS 202 | safe |
Frequently asked questions
Which SHAKE variants does NextSSL include?
NextSSL registers 1 SHAKE variant: shake128.
Families with similar names
Other extendable-output functions
All 8Related
The Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2
ML-KEMNIST's primary post-quantum key encapsulation mechanism, standardised in FIPS 203
ML-DSANIST's primary post-quantum signature scheme, standardised in FIPS 204
cSHAKECustomisable SHAKE from SP 800-185, adding function-name and customisation strings
SHA-3 and KeccakThe Keccak sponge, standardised by NIST in FIPS 202 as a structural alternative to SHA-2
TurboSHAKESHAKE with the Keccak permutation reduced to 12 rounds, standardised in RFC 9861