Skip to content

MLDSA for Pingora#497

Open
kornelski wants to merge 5 commits intomasterfrom
mldsa
Open

MLDSA for Pingora#497
kornelski wants to merge 5 commits intomasterfrom
mldsa

Conversation

@kornelski
Copy link
Copy Markdown
Collaborator

No description provided.

@kornelski kornelski requested a review from rushilmehra April 21, 2026 18:32
Copy link
Copy Markdown
Collaborator

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

This looks pretty good. I'll note that BoringSSL has also integrated MLDSA into X.509, but this has happened after the commit we've currently checked out. I'm working on bumping BoringSSL in #498.

Comment thread boring/src/mldsa.rs Outdated
Comment thread boring/src/mldsa.rs Outdated
Comment thread boring/src/mldsa.rs
Comment thread boring/src/mldsa.rs Outdated

impl MlDsaPublicKey {
/// Parses a public key from its serialized form.
pub fn from_bytes(algorithm: Algorithm, bytes: &[u8]) -> Result<Self, ErrorStack> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe there should be a to_bytes() counterpart?

Copy link
Copy Markdown
Collaborator

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

Looks good, one cosmetic thing for consistency with mlkem

Comment thread boring/src/mldsa.rs Outdated
Comment thread boring/src/mldsa.rs
Comment thread boring/src/mldsa.rs
@kornelski kornelski requested a review from johnhurt April 23, 2026 14:04
jedisct1 added a commit to jedisct1/rust-superboring that referenced this pull request Apr 23, 2026
Comment thread boring/src/mldsa.rs
MlDsa87(Box<ffi::MLDSA87_private_key>),
}

impl MlDsaPrivateKey {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be very useful to have a public_key() function as well. Should be pretty straightforward:

        pub fn public_key(&self) -> MlDsaPublicKey {
            let inner = match &self.inner {
                SigningKeyInner::MlDsa44(sk) => VerifyingKeyInner::MlDsa44(Box::new(
                    ml_dsa::signature::Keypair::verifying_key(sk.as_ref()),
                )),
                SigningKeyInner::MlDsa65(sk) => VerifyingKeyInner::MlDsa65(Box::new(
                    ml_dsa::signature::Keypair::verifying_key(sk.as_ref()),
                )),
                SigningKeyInner::MlDsa87(sk) => VerifyingKeyInner::MlDsa87(Box::new(
                    ml_dsa::signature::Keypair::verifying_key(sk.as_ref()),
                )),
            };
            MlDsaPublicKey {
                algorithm: self.algorithm,
                inner,
            }
        }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's from RustCrypto's implementation. Boring's version is a bit more involved. I'll leave it for later.

@kornelski kornelski force-pushed the mldsa branch 2 times, most recently from 41673b0 to f743a23 Compare April 23, 2026 15:13
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