Programming the raw challenge-expansion row of ML-DSA #
This implementation chooses the 221-byte minimum permitted by FIPS 204, Appendix C, Table 3, for bounded Algorithm 29. The insertion positions on a successful bounded row encode an ordered support. Transporting their final positions backward through the swaps changes only accepted candidate bytes. Sorting the source and target supports gives an invertible relabeling. The used sign bits are set from the target at each label’s destination. Rejected candidates, the unconsumed suffix and unused sign bits retain their exact values.
The row exchange and its distribution theorem are original. uniform_exchangeSampleInBall
gives the joint law of the entire raw row and the optional challenge, including exhaustion.
A signed weight-τ challenge, as returned by the sparse challenge oracle.
Instances For
Exchange a supplied signed sparse challenge with the challenge decoded from a bounded Algorithm 29 row. On exhaustion the complete row and the supplied challenge are unchanged. On success the inverse is the same operation with the original challenge.
Two forward exchanges restore the raw bytes and the supplied challenge.
Exactly the candidate bytes untouched by Algorithm 29 programming. On a successful row, accepted positions are holes, while rejected positions and the unused suffix retain their bytes at their original offsets. An exhausted row has no successful pattern.
On an exhausted row, programming changes no bytes and returns the still unused challenge.
On success the programmed bytes decode to the supplied challenge, and the second output is the challenge originally decoded from the row.
The permutation restricted to successful rows gives an explicit bijection from the preimages of any signed challenge to the preimages of any other. The inverse programs the original challenge back into the row.
Programming preserves the unused sign bits and every rejected or unconsumed candidate byte.
Joint law of the complete 221-byte raw row and its Algorithm 29 result. Start with uniform bytes and an independent uniform signed weight-τ challenge. Program the row and report the supplied challenge on success, or the original exhaustion. This has exactly the law of reading Algorithm 29 on a single uniform byte row.