Skip to content

mldsa: reject a HashML-DSA pre-hash weaker than the parameter set - #525

Open
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:mldsa-prehash-strength
Open

padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:mldsa-prehash-strength

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

wolfSSL commit 7f6d4daa96 enforces a minimum prehash size. WP tests use SHA256 (128b collision strength) with ML-DSA-65 (192 bits), and now fails.

Fixes failing wolfSSL PQC KAT and wolfSSL versions CI workflows.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 00:14

Copilot AI 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.

🟡 Changes recommended

Unconditional ML-DSA success tests fail DigestSignInit on valid builds without SHA-384 or SHA-512 and need guards for the corresponding digest features.

1 open issue
What changed in this PR

Aligns wolfProvider’s HashML-DSA pre-hash validation with wolfSSL’s minimum-strength requirement, addressing the reported CI failures.

Changes:

  • Rejects digests whose collision strength is below the ML-DSA parameter set’s security strength, unless weak pre-hashes are explicitly enabled.
  • Adds an internal accessor for ML-DSA security strength.
  • Expands tests to cover accepted and rejected digest choices across parameter sets.
File Description
test/​test_mldsa.c Adds table-driven pre-hash acceptance, rejection, and round-trip tests.
src/​wp_mldsa_sig.c Enforces parameter-set-specific minimum pre-hash strength.
src/​wp_mldsa_kmgmt.c Implements the security-strength accessor.
include/​wolfprovider/​alg_funcs.h Declares the new internal accessor.

Review effort: Balanced

Comment thread test/test_mldsa.c Resolved
@padelsbach
padelsbach force-pushed the mldsa-prehash-strength branch from b2687a5 to 574215b Compare October 31, 2026 01:49
@padelsbach

Copy link
Copy Markdown
Contributor Author

jenkins retest this please (boz-xeon5 missing install android ndk, now installed)

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.

3 participants