Skip to content

Add ML-DSA (FIPS 204) post-quantum signature support - #651

Open
ffang wants to merge 3 commits into
apache:mainfrom
ffang:PQC-SIGNATURE
Open

Add ML-DSA (FIPS 204) post-quantum signature support#651
ffang wants to merge 3 commits into
apache:mainfrom
ffang:PQC-SIGNATURE

Conversation

@ffang

@ffang ffang commented Aug 21, 2026

Copy link
Copy Markdown

Adds ML-DSA-44/65/87 XML digital signature support via the JSR-105 API (DOM) and the STAX signature path, wired through JCEMapper and the JSR-105 provider's algorithm URI registrations. Part of the post-quantum work tracked under SANTUARIO-634 (originally proposed in SANTUARIO-633 / #645), split out here as the signature-only half per community request.

Adds ML-DSA-44/65/87 XML digital signature support via the JSR-105
API (DOM) and the STAX signature path, wired through JCEMapper and
the JSR-105 provider's algorithm URI registrations. Part of the
post-quantum work tracked under SANTUARIO-634 (originally proposed
in SANTUARIO-633 / apache#645), split
out here as the signature-only half per community request.

- The ML-DSA test keystore is generated on the fly per test run
  instead of a committed PKCS12 binary, avoiding the maintenance
  burden of binary test fixtures. Uses SelfSignedCertGenerator,
  originally authored by Joze Rihtarsic (unmerged PR apache#617), copied
  in and extended here with ML-DSA-44/65/87 AlgorithmIdentifier
  support per his suggestion on apache#645.
- Adds negative-test coverage on both the DOM/JSR-105 and STAX
  paths: a tampered SignatureValue is rejected, and verification
  against the wrong public key fails. Added per Arpan0995's review
  feedback on apache#645.
if (provider == null) {
String providerId = JCEMapper.getProviderId();
if (providerId == null) {
this.signatureAlgorithm = Signature.getInstance(algorithmID);
if (provider == null) {
String providerId = JCEMapper.getProviderId();
if (providerId == null) {
this.signatureAlgorithm = Signature.getInstance(algorithmID);
if (providerId == null) {
this.signatureAlgorithm = Signature.getInstance(algorithmID);
} else {
this.signatureAlgorithm = Signature.getInstance(algorithmID, providerId);
if (providerId == null) {
this.signatureAlgorithm = Signature.getInstance(algorithmID);
} else {
this.signatureAlgorithm = Signature.getInstance(algorithmID, providerId);
this.signatureAlgorithm = Signature.getInstance(algorithmID, providerId);
}
} else {
this.signatureAlgorithm = Signature.getInstance(algorithmID, provider);
this.signatureAlgorithm = Signature.getInstance(algorithmID, providerId);
}
} else {
this.signatureAlgorithm = Signature.getInstance(algorithmID, provider);
Arpan0995 and others added 2 commits August 21, 2026 12:55
… sets

Converts the tampered-SignatureValue and wrong-public-key rejection
tests on both the DOM/JSR-105 and StAX paths from single hardcoded
ML-DSA-65 cases to @ParameterizedTest/@CsvSource across ML-DSA-44/65/87,
matching the style of the existing sign-and-verify tests. The StAX
helper takes the signature and key algorithms as parameters instead of
hardcoding ML-DSA-65.
Parameterize the negative signature tests across all ML-DSA parameter sets
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