Skip to content

mldsa: regenerate FIPS 204 edge cases - #278

Merged
cpu merged 1 commit into
mainfrom
mldsa-edge-case-fixes
Oct 12, 2026
Merged

cpu merged 1 commit into
mainfrom
mldsa-edge-case-fixes

Conversation

@cpu

@cpu cpu commented Oct 6, 2026

Copy link
Copy Markdown
Member

#276 identified stale ML-DSA ExpandS cases, but the same issue affected ExpandA, SampleInBall, and Power2Round cases across the seed, semi-expanded, and verification files. The original gendx cases predated the final FIPS 204 key-expansion derivation, which added the parameter-set domain separator to SHAKE256(xi || k || l).

This regenerates the affected ML-DSA-44, ML-DSA-65, and ML-DSA-87 groups. The ML-DSA-65 third-block cases place the long stream in s1, making silent sampler corruption observable in the public key. The tcIds are kept the same.

The generator is intentionally not included here but it is available on the companion branch, specifically this commit. The vectors were cross-checked with OpenSSL and smoke-tested against Go's standard-library implementation. Targeted mutations also confirmed that the new vectors detect faults the old corpus missed.

Resolves #276

Regenerate stale edge cases under the final FIPS 204 derivation.
Update seed, semi-expanded, and verification siblings together.

Choose ExpandS third-block seeds whose long polynomial is in s1,
making silent sampler corruption observable in the public key.

Credit Ville Vesilehto (thevilledev) for reporting the stale ExpandS
coverage in #276.

Co-authored-by: OpenAI Codex <codex@openai.com>
@cpu cpu self-assigned this Oct 6, 2026

@thevilledev thevilledev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for picking this up! I developed the tooling I built for #276 further to check the regenerated vectors independently. The way I see it, all edge-cases are now properly covered.

I think putting the third-block polynomial in s1 is a better choice than s2. Didn't think of that.

LGTM

@cpu

cpu commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Awesome! Thanks for taking a look (and once again, for flagging the issue). :-)

@cpu
cpu merged commit 20b2569 into main Oct 12, 2026
11 checks passed
@cpu
cpu deleted the mldsa-edge-case-fixes branch October 12, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ML-DSA-65 vectors with a third SHAKE256 block

2 participants