SHAKE128
The extendable-output functions of FIPS 202, producing any length of output from Keccak
About SHAKE128
SHAKE128 is an extendable-output function (XOF) from the SHAKE family. Its registry entry cites FIPS 202. It is also known as shake-128. NextSSL lists it in the standard tier and exposes it through the safe API.
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
Sizes
The registry declares no fixed sizes for this algorithm.
Use it
from nextssl_demo import NextSSL
ns = NextSSL() # safe API: safe and standard tiers
out = ns.call("xof", "shake128", None, b"abc", 64)[0] # any length
nextssl_xof("shake128", NULL, data, 64, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_xof_in(reg::all(), Policy::Safe, "shake128", &Params::new())?;
let out = alg.squeeze(b"abc", 64)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?More extendable-output functions
All 8Frequently asked questions
What is SHAKE128?
SHAKE128 is a XOF in the SHAKE family. SHAKE128 and SHAKE256 are extendable-output functions (XOFs) standardised in FIPS 202 alongside SHA-3. It is also known as shake-128.
Who designed SHAKE128 and when?
SHAKE128 belongs to the SHAKE family, first published in 2015 by Guido Bertoni, Joan Daemen, Michaël Peeters, Gilles Van Assche. Its origin: FIPS 202.
Which standards define SHAKE128?
SHAKE128 is referenced by FIPS 202. It is specified in a FIPS standard.
Is SHAKE128 safe to use?
SHAKE128 is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.
Related families
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