Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "External Mu" ML-DSA #423

Merged
merged 7 commits into from
Jan 31, 2025

Conversation

WillChilds-Klein
Copy link
Contributor

@WillChilds-Klein WillChilds-Klein commented Jan 31, 2025

Issue #, if available: i/ACCP-128

Description of changes:

Overview

This PR adds support for the External Mu variant of ML-DSA described in AWS-LC PR 2113. To facilitate calculation of mu in testing and for consumers, we expose a computeMLDSAMu helper function in a new PublicUtils class. Notably, External Mu ML-DSA is interoperable with Pure ML-DSA across signing and verification, as shown in tests.

Interoperability

We expose External Mu as a distinct Signature service to preserve forwards-compatibility with other providers' potential future implementations. Conventionally, this "prehash" mode would be configured with a call to setParameter, passing an AlgorithmParameterSpec implementation as in EdDSA. Because no other providers have yet created an AlgorithmParameterSpec implementation that is aware of External Mu, this approach would have required us to expose an ACCP-specific AlgorithmParameterSpec that callers would need to use, hampering interoperability.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@WillChilds-Klein WillChilds-Klein force-pushed the mldsa-ext-mu branch 4 times, most recently from 1c05fbf to a50657b Compare January 31, 2025 06:25
@WillChilds-Klein WillChilds-Klein marked this pull request as ready for review January 31, 2025 16:03
@WillChilds-Klein WillChilds-Klein requested a review from a team as a code owner January 31, 2025 16:03
@@ -231,6 +231,7 @@ private void addSignatures() {

if (shouldRegisterMLDSA) {
addService("Signature", "ML-DSA", "EvpSignatureRaw$MLDSA");
addService("Signature", "ML-DSA-Ext-Mu", "EvpSignatureRaw$MLDSAExtMu");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's currently no JCA-standard name for this (yet?), so we have some latitude in choosing the algorithm name. I'm not sold on ML-DSA-Ext-Mu, open to suggestions from reviewers.

Copy link

Choose a reason for hiding this comment

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

In draft-ietf-lamps-dilithium-certificates we use ExternalMu-ML-DSA. In ACVP ML-DSA JSON Specification it is just referred to as externalmu.

Notably, theres no hyphen between external and mu in both.

We chose ExternalMu-ML-DSA in the IETF to hint at consistency with NISTs notion of prefixing the mode name distinction: i.e.,HashML-DSA.

As such ML-DSA-ExtMu, ML-DSA-ExternalMu are good options. If you like ML-DSA-Ext-Mu, ML-DSA-External-Mu with the extra hyphen, that's also fine!

@WillChilds-Klein WillChilds-Klein changed the title [DRAFT] Support "External Mu" ML-DSA Support "External Mu" ML-DSA Jan 31, 2025
import java.security.PublicKey;

/** Public utility methods */
public class PublicUtils {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the intent here to begin developing/exposing ACCP exclusive utility classes? The only use is within test code. Is there an intended customer for this interface (let's continue this convo off of Github)? I am a little concerned about how specific this is to ML-DSA and how we might pigeon-hole ourselves with this class/package hierarchy if we decide to add a lot more utility functions in the future. The potential for a 1000+ line monster class is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There has been some interest from internal teams to use this in testing, but we can hold off on exposing it until there's a clearly articulated need. I've moved the mu helper function to TestUtil.

geedo0
geedo0 previously approved these changes Jan 31, 2025
@WillChilds-Klein WillChilds-Klein merged commit aa9bfd2 into corretto:main Jan 31, 2025
11 checks passed
@WillChilds-Klein WillChilds-Klein deleted the mldsa-ext-mu branch January 31, 2025 22:48
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.

4 participants