feat(noise): hybrid post-quantum handshake (X25519 + ML-KEM-768)#6481
feat(noise): hybrid post-quantum handshake (X25519 + ML-KEM-768)#6481royzah wants to merge 2 commits into
Conversation
Adds an additive, off-by-default 'mlkem-hfs' feature advertising Noise_XXhfs_25519+ML-KEM-768_ChaChaPoly_SHA256 under a new protocol id, falling back to classical /noise for older peers. Ports the crate to snow 0.10 (patched to our fork carrying the ML-KEM KEM) and widens the handshake scratch buffer for the KEM material.
5cd4da1 to
a8c5bcf
Compare
|
Note on the
|
|
how about changing to use clatter, no_std compatible implementation of Noise protocol framework with Post-Quantum extensions. |
|
Thanks @getong for clatter shout-outs! It is great crate though. However, in libp2p the Noise static key doesn't prove who you are, the identity key signs it for that. So the handshake only needs PQ for secrecy (harvest-now-decrypt-later), which is what hfs already does. clatter's extra is PQ auth on the static key, which seems redundant here (that's an identity-key job, Ed25519 -> ML-DSA). Do you see where the static key itself needs to be PQ? Also interop: the protocol name feeds the handshake hash, so clatter's WDYT ? |
|
You are right , go ahead. |
|
Cheers @getong 🙏 Keeping clatter in mind for a future no_std path. |
|
H @royzah, thanks for this! Happy to have this in |
Revives #2168.
Summary
Additive, off-by-default
mlkem-hfsfeature: a hybrid post-quantum Noise handshake (Noise_XXhfs_25519+ML-KEM-768_ChaChaPoly_SHA256) negotiated alongside/noise, falling back to classical X25519 for peers without it.Why
/noiseis classical X25519, so recorded sessions are exposed to harvest-now-decrypt-later. This mixes an ML-KEM-768 ephemeral KEM into the handshake (secure if either primitive holds). Static-key auth stays classical, which cannot be broken retroactively.Changes
mlkem-hfsfeature (off by default) ->snow/use-ml-kem/noise-mlkem768-hfs/0.1.0, advertised ahead of/noise; pattern selected from the negotiated idDefaultResolver(ring has no KEM)Open questions
/noise-mlkem768-hfs/0.1.0is provisional; it needs a cross-implementation spec (go/js-libp2p) before stabilizing. Happy to take it to libp2p/specs.snow; until released,[patch]points snow at a fork branch.ml-kemis unaudited (passes NIST vectors).