SHAKE128 #
This module supplies byte-aligned SHAKE128 on the checked Keccak-p[1600, 24] permutation from
Cslib.Crypto.Keccak. FIPS 202 Section 6.2 gives SHAKE128 a 1344-bit rate and 256-bit capacity.
Bytes use the same least-significant-bit-first convention as shake256; the only sponge-level
difference is the rate/capacity split.
This is an executable specification with a uniform multitape-Turing-machine polynomial-time certificate. It is not a constant-time implementation, a concrete retained-machine cost bound, a security certificate, or a claim of FIPS validation.
Main definitions #
Cslib.Crypto.Keccak.Shake128SpongeState: SHAKE128's rate/capacity state split.Cslib.Crypto.Keccak.keccakP1600Rounds24Shake128: the shared permutation on that split.Cslib.Crypto.Keccak.shake128: byte-aligned SHAKE128 with an output length in bytes.
Main results #
Cslib.Crypto.Keccak.toShake128SpongeState_ofShake128SpongeState: converting the two state views is exact.Cslib.Crypto.Keccak.length_shake128: SHAKE128 returns the requested byte count.Cslib.Crypto.Keccak.take_shake128: longer requests preserve the preceding XOF bytes.Cslib.Crypto.Keccak.computableInPolyTime_shake128: uniform polynomial time when the requested output length is unary.
References #
The SHAKE128 layout: 21 rate lanes and four capacity lanes.
The 1344-bit rate and 256-bit capacity views used by SHAKE128.
Convert the SHAKE128 rate/capacity split into the FIPS 202 lane array.
A SHAKE128 rate lane reads the corresponding 64 rate coordinates.
A SHAKE128 capacity lane reads the corresponding 64 capacity coordinates.
Convert the FIPS 202 lane array into SHAKE128's rate and capacity split.
Converting a SHAKE128 rate/capacity split to lanes and back preserves every state bit.
Converting a lane state to the SHAKE128 split and back preserves every lane.
FIPS 202 KECCAK-p[1600, 24] on SHAKE128's rate/capacity split.
Read the 1344-bit SHAKE128 rate as 168 consecutive little-endian bytes.
One SHAKE128 rate block contains exactly 168 output bytes.
count SHAKE128 squeezing blocks contain exactly 168 * count bytes.
Requesting more SHAKE128 squeezing blocks preserves every byte of the earlier blocks.
SHAKE128 is uniformly polynomial-time when the requested number of output bytes is unary.