Finite random XOFs shared by the ML-DSA algorithms and quantum queries #
A coherent address encodes the SHAKE variant, a delimiter and the input bits. A random table supplies independent bytes on the encoded words and a fixed background supplies the remaining inputs and suffixes. The byte-table factorization is used for both the SHAKE128 public matrix and the SHAKE256 signing masks.
Encode a raw word of at most a bits in the coherent address register. The first bit
selects SHAKE256 when set and SHAKE128 otherwise. Leading zero padding and a one-bit delimiter
preserve the input length, including empty inputs and inputs starting with zero.
When the SHAKE128 streams agree, unequal coherent responses identify a successfully decoded SHAKE256 address whose two raw byte reads differ.
A coherent query at each encodable raw word reads the very stream used by FIPS, at the full device response length. Shorter reads use its prefix.
Sample one finite prefix table for both raw XOFs before the execution. Each raw input of
at most a bits receives bytes independent uniform bytes for each SHAKE variant. The
background supplies longer inputs and bytes beyond these prefixes.
Installing k-byte rows directly as lists agrees with installing their little-endian
bit-string encodings.
Reading all k-byte prefixes at n-bit inputs from the current streams and reinstalling
them preserves every raw query, including SHAKE256 output beyond the prefix.
Independently replacing the first k SHAKE256 bytes at every n-bit input preserves the
joint law of the replacement register and both full raw XOFs. The finite prefix limits must
cover these inputs and outputs.
A native raw query to an installed byte-list prefix table reads at most one entry. The equality also covers SHAKE128, malformed words and requests extending beyond the installed prefix.
A native raw query to the installed table reads at most one register value. The equality also covers SHAKE128, malformed words and requests extending beyond the installed prefix.