Repository navigation
Conversation
Merging this PR will improve performance by 2.14%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_http11_server_many_headers |
1.2 ms | 1.2 ms | +2.14% |
Comparing FinnRG:feat/mlkem768 (5a83de5) with trunk (b71fe03)
|
(The failing tests are due to missing PQ support on the client side, I'll see if I can resolve the tests without actually implementing it because I don't want to make the PR larger) |
|
please review |
glyph
left a comment
There was a problem hiding this comment.
This all looks pretty plausible, although I am not an expert in the relevant domain. I do have some naming requests and deployment concerns though.
|
|
||
|
|
||
| @implementer(_IPQHybridKexAlgorithm) | ||
| class _MLKEM768X25519SHA256: |
There was a problem hiding this comment.
Truly this is a class name for the ages.
|
@glyph Thanks for the quick review. I have published a new version of I tried adding the typing info, but this caused further mypy warnings (see for example this job) and should probably be done for all tests in that file in a separate PR. |
There was a problem hiding this comment.
Thanks for working on this.
I have created a separate ticket for client-side support, so that here we can focus on server-side support.
I did just a quick review and left a few minor comments
I have not read the specification for this new algorithm and I have not validated the algorithm agains the RFC.
I have not yet executed manual tests...
I plan to update my computer to Ubuntu 26.04 ... and I hope that with that I can get a newer OpenSSH version
I am not sure which RFC and revision was used for this implementation.
From OpenSSH website
OpenSSH has offered post-quantum key agreement (KexAlgorithms) by default since release 9.0 (April 2022), initially via the sntrup761x25519-sha512 algorithm. More recently, in OpenSSH 9.9, we have added a second post-quantum key agreement mlkem768x25519-sha256 and it was made the new default scheme in OpenSSH 10.0 (April 2025).
I think that we should also update the end to end / functional tests from here
twisted/src/twisted/conch/test/test_conch.py
Lines 576 to 581 in ca5f38a
On my Ubuntu 24.04 I have
OpenSSH_9.6p1 Ubuntu-3ubuntu13.15, OpenSSL 3.0.13 30 Jan 2024
$ ssh -Q kex
... CLASSIC KEX....
[email protected]
and it looks like GitHub only has 24.04 available as newest Ubuntu ... so we will need to run theses test in a container ... or find a quick way to install OpenSSH 9.9 on Ubuntu 24.04 :(
|
not sure how the bot state got desynced here but this needs a response to @adiroiban's review @FinnRG — when you're done dealing with those, just as a workflow thing, please use the magic "please review" phrase to have the bot request a review from the whole team rather than from individuals. adi and I are the most likely ones to review but we should really give others an opportunity to see it in their queue :) |
…y supported kex algorithm check
|
@adiroiban I agree that end to end tests would be nice. Since 26.04 released a few days ago it shouldn't take too long for Github to add support for it, do we want to wait for this to happen or do you suggest another approach? The CI is currently failing (and codspeed shows a performance regression), but none of these seem to be related to my changes. |
|
please review |
|
I think that I will only have time to look into this by next week. In theory, we don't have to wait for GitHub Actions to add support for Ubuntu 26.04...we can run the tests in a container. As an example, there is this PR #12585 which adds tests for Centos9... to get OpenSSL + FIPS |
|
For manual test I am using Ubuntu 26.04 default OpenSSH SSH server running as On trunk I get this error which is expected On this branch, it works. This needs a review, but the high level manual smoke test looks good. I need to read the specs and check that it matches the implementation. Thanks! |
| mindeps: appdirs == 1.4.0 | ||
| mindeps: bcrypt == 3.2.1 | ||
| # Conch-hpq | ||
| mindeps: twisted[conch] |
There was a problem hiding this comment.
I don't think that this line is required.
The idea with mindeps is to pin the oldest version of the supported dependencies
| S_REPLY (S_CT2 || S_PK1), and a valid signature over the exchange | ||
| hash H. It also sends SSH_MSG_NEWKEYS. | ||
| """ | ||
| import ml_kem_rs |
There was a problem hiding this comment.
minor comment.
To avoid local imports and repeating the imports the idea is to try to import the dependence at the module level, catch the import error and set a skip condition.
then mark the affected tests or test case based on that skip condition.
|
cryptography ahs support for ML-KEM at this point |
|
Thanks for the update Alex! |
|
Thanks for the update. I think that we can look to refactor this to use cryptography . I see that ML-KEM was introduced in 48.0.0 - 2026-05-04 |
|
I think that this can be closed since we now have #12730 which no longer depends on an extra deps. It just uses a newer cryptography |
Scope and purpose
Fixes #12520.
As discussed in #12520 (comment), I've created a small wrapper library around the
RustCrypto/ml-kemcrate untilcryptographyadds support for this algorithm.Contributor Checklist:
This process applies to all pull requests - no matter how small.
Have a look at our developer documentation before submitting your Pull Request.
Below is a non-exhaustive list (as a reminder):
please review.Our bot will trigger the review process, by applying the pending review label
and requesting a review from the Twisted dev team.