Repository navigation
Conversation
Implement X25519MLKEM768, SecP256r1MLKEM768 and SecP384r1MLKEM1024 (draft-ietf-tls-ecdhe-mlkem-05) for TLS 1.3 key shares, using ML-KEM from cryptography >= 47. The server share is an encapsulation to the client share, so TLSServerAutomaton computes it once the ClientHello is known. AI-Assisted: yes (Claude Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the TLS 1.3 hybrid key exchange groups of draft-ietf-tls-ecdhe-mlkem-05:
X25519MLKEM768,SecP256r1MLKEM768andSecP384r1MLKEM1024(0x11ED, added to_tls_post_quantum_hybrid). ML-KEM comes fromcryptography>= 47; without it, these groups behave as unsupported.groups.py:TLSHybridKEMPrivateKey(client side) andTLSHybridKEMShare(a received share), with the share and shared secret layouts of sections 4.1 to 4.3.TLSServerAutomatoncomputes it once the ClientHello is known, before the ServerHello is built.TLSHybridKEMSharekeeps the result, so every build of the ServerHello carries the same share and secret.test_tls_clientgets aclient_curveargument to select the client's group.Interoperability was checked against OpenSSL 4.1 for each group, in both directions (
TLSClientAutomatonwithopenssl s_server -groups <group>, andopenssl s_client -groups <group>withTLSServerAutomaton).fixes #5318
This message was written with the help of AI (Claude Opus 5.5).