XOF family

SHAKE

The extendable-output functions of FIPS 202, producing any length of output from Keccak

standard 1 variant FIPS 202

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–2015
  1. Specified 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

Seed expansion in ML-KEM and ML-DSAMask generation and key derivationVariable-length hashing

Variants in NextSSL

1
AlgorithmTierSizes (bytes)StandardsAPI
SHAKE128
shake128
standard FIPS — FIPS 202 safe

Frequently asked questions

Which SHAKE variants does NextSSL include?

NextSSL registers 1 SHAKE variant: shake128.