Extendable-output functions

SHAKE128

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

standard Safe API Specified in a FIPS standard

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–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

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

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently 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.