Skip to content

Add mldsa44-ed25519 composite signatures - #94

Open
korbin wants to merge 1 commit into
mkj:mainfrom
korbin:mldsa44-ed25519
Open

korbin wants to merge 1 commit into
mkj:mainfrom
korbin:mldsa44-ed25519

Conversation

@korbin

@korbin korbin commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds the ssh-mldsa44-ed25519 hybrid post-quantum signature algorithm (ML-DSA-44 + Ed25519) from draft-ietf-sshm-composite-sigs and the mldsa feature. mldsa44-ed25519 is supported by OpenSSH 10.6+

Currently, sunset has PQ key exchange but only classical host/user keys.

  • src/mldsa.rs builds M' (prefix, label, empty context, SHA-512 of the message) and signs it with ML-DSA-44 (context = label) and Ed25519. Both signatures must verify
  • PubKey, Signature, SignKey (including an agent variant), KeyType and SigType get MLDSA44Ed25519 variants
  • Keys store the two 32-byte seeds and the 1344-byte public key - the expanded ML-DSA key is derived for each signature
    • Signing needs ~41KB of stack for the expanded key, so the feature is off by default
    • ml-dsa is no_std and doesn't need alloc, but its README notes it hasn't been independently audited
  • ssh-mldsa44-ed25519 goes last in the host key algorithm list, matching OpenSSH 10.6's default order, and is included in server-sig-algs
  • Bumps ssh-key to rc.13 for OpenSSH private keys and fingerprints
    • rc.13 makes sha2 optional and gates fingerprint() on it, so openssh-key now enables ssh-key/sha2

I added tests that derive the draft's example key from its seeds and check it against the draft's SSHFP fingerprint, cross-check the key against ssh-key's implementation through the OpenSSH private key format, and check that tampering with either signature half fails.

I also locally tested against OpenSSH 10.6p2 in both directions with ML-DSA host/user keys over mlkem768x25519-sha256

A server with only an ML-DSA host key needs #93 - without it, the server still advertises ssh-ed25519 and clients pick that.

@mkj

mkj commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Hah were you looking at #91 ...

@korbin

korbin commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Hah were you looking at #91 ...

I did not see until you mentioned! I have been scrambling with this in a lot of software for the last two days or so.

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.

2 participants