> On Nov 17, 2026, at 08:12, Sorin Basca <[email protected]> wrote:
>
> This Message Is From an External Sender
> This message came from outside your organization.
> Report Suspicious
> Hi Weijun,
>
> Thank you for your response. I'm happy to hear that you are still
> looking into JDK-8384521 and that this is close to being completed. Do
> you know when this will be available? Will it make it into JDK 28, or
> is it more likely to be part of 29? If needed, we are happy to help
> with PR #23934, either for reviews or testing.
It's more likely 29. RDP 1 for 28 is only 2 weeks away [1].
>
> Regarding the manual X.509 + SHAKE256 assembly, we could still follow
> up with a new API for this, once Context + ExternalMu is available.
> Asking Java developers to get this right when calculating by hand will
> make errors more likely and result in unverifiable signatures. Native
> crypto libraries, like BoringSSL, provide dedicated pre-hash APIs (in
> mldsa.h's MLDSA{44,65,87}_prehash_{init,update,finalize}) and having
> an API that can map to these would mitigate the error-prone nature of
> computing mu by hand.
>
> Other libraries, such as Bouncy Castle, rely on wrapping a public key
> inside a private key, org.bouncycastle.jcajce.MLDSAProxyPrivateKey, to
> pass it to the ML-DSA-CALCULATE-MU signature instance. This is a
> workaround specific to Bouncy Castle that is not generic enough to
> cover other providers. It would be good to have a JCA abstraction in
> place that allows for more consistent usage.
>
> If having an ML-DSA-specific SPI is too specialized, we could define a
> general signature pre-hashing API. This API could accept a public key
> that will be used for ML-DSA, while other schemes ignore it.
I am thinking maybe a static factory method like `MessageDigest
externalMuDigest(publicKey, context)` is enough, but then we need to decide
whether it can be reused. A method `byte[] externalMu(publicKey, context,
messageStream)` is also doable, but does message always come in as an input
stream?
Also, I don't want to use any pre-hash word because people might confuse it
with the pre-hash ML-DSA algorithm which we do not support.
> Of
> course, this would be done as a follow-up, but it would be good to
> have it planned. Would you be open to having a separate JBS issue for
> the mu API?
Yes.
Thanks,
Weijun
[1] https://openjdk.org/projects/jdk/28/
>
> Kind regards,
> Sorin
>
>
> On Tue, 3 Nov 2026 at 14:33, Wei-Jun Wang <[email protected]> wrote:
> >
> > Hi Sorin,
> >
> > Thanks for your interest in this issue.
> >
> > > On Oct 29, 2026, at 09:26, Sorin Basca <[email protected]> wrote:
> > >
> > > Hello,
> > >
> > > We would like to inquire about picking up the work on JDK-8384521. We
> > > see it remains open and that the earlier exploration in PR #23934 was
> > > abandoned due to its large scope.
> >
> > PR #23934 was automatically closed by our bot because of low traffic. I
> > already have a code change for JDK-8384521, which introduced the public API
> > described there, and the implementation is just a thin shim on PR #23934.
> > It has not been posted because PR #23934 is not integrated yet.
> >
> > >
> > > We would like to propose that we move JDK-8384521 forward with a
> > > focused scope. This would include the following:
> > >
> > > 1. Adding MLDSAParameterSpec.ExternalMu and MLDSAParameterSpec.Context
> > > for configuring the Signature instances.
> >
> > >
> > > 2. Providing a standard MessageDigest pre-initialized with the public
> > > key and context to stream large messages and produce the 64 byte mu.
> > > For this we will add MLDSAParameterSpec.DigestBuilder and
> > > MLDSAExternalMuDigestSpi.
> >
> > The second part of your proposal is too focused on this single usage and
> > does not seem to warrant an API, let alone an API/SPI pair that needs to be
> > implemented in providers. Calculating it, as you said below, is a little
> > delicate but still doable. IMHO, the only tricky part is to find the raw
> > public key to calculate tr if one only has the X.509 getEncoded() value of
> > the public key. We know there are only 3 standard parameter sets for
> > ML-DSA, so the extraction is merely comparing the first few bytes of the
> > public key X.509 encoding to 3 known byte sequences and the rest (if the
> > length is correct) is the raw public key.
> >
> > Thank you for offering to contribute but we have already completed most of
> > this work. We will continue.
> >
> > Thanks,
> > Weijun
> >
> > >
> > > 3. Complete implementation in the SUN provider.
> > >
> > > We are aware that mu can be computed by hand with
> > > MessageDigest.getInstance("SHAKE256-512") running over tr || 0x00 ||
> > > len(ctx) || ctx || M. However, this is error-prone as callers need to
> > > perform several steps and a mistake would produce a signature that
> > > fails to verify. The typed API would allow providers that already
> > > compute mu natively to plug in their own implementation.
> > >
> > > We are raising this because we have encountered a critical requirement
> > > for signing with an externally computed message representative mu when
> > > deploying ML-DSA across hardware and isolated cryptographic modules.
> > >
> > > We have a clean, tested prototype ready and would like to know if you
> > > would welcome our help in driving JDK-8384521 forward and whether this
> > > scoped design would meet your expectations.
> > >
> > > Many thanks,
> > > Sorin Basca (on behalf of the Google Java Platform & ISE Crypto teams)
> >
>