Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose an SSLNamedGroup for mlkem768x25519 #2102

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

jschanck
Copy link
Contributor

NSS 3.105 will support ML-KEM-768 (the FIPS-203 version of Kyber768). An alpha release of 3.105 will land in M-C in D222012. I'm switching PSM from xyber768d00 to mlkem768x25519 in D222019. This patch exposes an SSLNamedGroup variant for ssl_grp_kem_mlkem768x25519 so that I can do the same for neqo_glue.

This patch also changes the behavior of init_once() so that xyber768d00 is disabled by policy (it's disabled by default in NSS and was being enabled in init_once()). This will prevent servers from doing an HRR for xyber768d00 when they are presented with, say, {mlkem768x25519, x25519}. I hear that most servers that currently support xyber768d00 will support mlkem768x25519 by mid-October, slightly before the Firefox 132 release. So disabling xyber768d00 should not have a significant impact on the fraction of Firefox-initiated handshakes that use a post-quantum key exchange.

If you're not comfortable merging a change that depends on pre-release NSS code, the plan is to cut NSS_3_105_BETA on Sept 19 and NSS_3_105_RTM on Sept 26. I'll have plenty of time to make the neqo_glue changes even if you wait until the 26th.

Copy link
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

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

LGTM modulo the formatting nit

Copy link

github-actions bot commented Sep 12, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Copy link

github-actions bot commented Sep 12, 2024

Firefox builds for this PR

The following builds are available for testing. Crossed-out builds did not succeed.

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.31%. Comparing base (5410bd0) to head (88d0081).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2102      +/-   ##
==========================================
- Coverage   95.35%   95.31%   -0.04%     
==========================================
  Files         112      112              
  Lines       36325    36319       -6     
==========================================
- Hits        34636    34619      -17     
- Misses       1689     1700      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

There's a difference here between what it takes to write the code and what it takes to land it. This patch is great and we should be taking it. The challenge is in managing the release arrangements.

It isn't great having this repository reliant on prerelease NSS. But we're going to end up in that situation at times.

Is this just a case where we have to quickly slot all the pieces in place in order (NSS, neqo, gecko)? Or can we make that a little less difficult with something like a feature flag?

Copy link

github-actions bot commented Sep 13, 2024

Benchmark results

Performance differences relative to d4978de.

coalesce_acked_from_zero 1+1 entries: Change within noise threshold.
       time:   [99.740 ns 100.07 ns 100.41 ns]
       change: [+0.1355% +0.6516% +1.2387%] (p = 0.02 < 0.05)

Found 11 outliers among 100 measurements (11.00%)
6 (6.00%) high mild
5 (5.00%) high severe

coalesce_acked_from_zero 3+1 entries: Change within noise threshold.
       time:   [118.09 ns 118.35 ns 118.64 ns]
       change: [+0.1370% +0.9424% +1.7933%] (p = 0.02 < 0.05)

Found 17 outliers among 100 measurements (17.00%)
1 (1.00%) low severe
3 (3.00%) low mild
4 (4.00%) high mild
9 (9.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [117.71 ns 118.28 ns 118.97 ns]
       change: [-0.1790% +0.5341% +1.1364%] (p = 0.12 > 0.05)

Found 19 outliers among 100 measurements (19.00%)
7 (7.00%) low severe
3 (3.00%) low mild
4 (4.00%) high mild
5 (5.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [98.171 ns 98.283 ns 98.421 ns]
       change: [-0.1274% +0.6451% +1.3001%] (p = 0.08 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
6 (6.00%) high mild
8 (8.00%) high severe

RxStreamOrderer::inbound_frame(): Change within noise threshold.
       time:   [111.62 ms 111.67 ms 111.73 ms]
       change: [-0.4380% -0.2334% -0.0996%] (p = 0.00 < 0.05)

Found 8 outliers among 100 measurements (8.00%)
8 (8.00%) low mild

transfer/pacing-false/varying-seeds: 💚 Performance has improved.
       time:   [24.481 ms 25.377 ms 26.305 ms]
       change: [-16.177% -11.450% -6.5520%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

transfer/pacing-true/varying-seeds: No change in performance detected.
       time:   [34.646 ms 36.428 ms 38.200 ms]
       change: [-10.008% -3.9628% +2.0557%] (p = 0.21 > 0.05)
transfer/pacing-false/same-seed: Change within noise threshold.
       time:   [31.401 ms 32.210 ms 32.989 ms]
       change: [-7.1453% -3.7301% -0.6615%] (p = 0.03 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild

transfer/pacing-true/same-seed: No change in performance detected.
       time:   [39.272 ms 41.477 ms 43.736 ms]
       change: [-5.0105% +5.0241% +15.767%] (p = 0.32 > 0.05)
1-conn/1-100mb-resp (aka. Download)/client: Change within noise threshold.
       time:   [114.35 ms 114.85 ms 115.31 ms]
       thrpt:  [867.22 MiB/s 870.72 MiB/s 874.49 MiB/s]
change:
       time:   [+0.9550% +1.5223% +2.0774%] (p = 0.00 < 0.05)
       thrpt:  [-2.0352% -1.4995% -0.9460%]

Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) low severe
4 (4.00%) low mild

1-conn/10_000-parallel-1b-resp (aka. RPS)/client: Change within noise threshold.
       time:   [316.31 ms 319.52 ms 322.74 ms]
       thrpt:  [30.985 Kelem/s 31.297 Kelem/s 31.615 Kelem/s]
change:
       time:   [+0.0913% +1.5959% +3.2606%] (p = 0.04 < 0.05)
       thrpt:  [-3.1576% -1.5708% -0.0912%]

Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild

1-conn/1-1b-resp (aka. HPS)/client: Change within noise threshold.
       time:   [34.160 ms 34.424 ms 34.708 ms]
       thrpt:  [28.812  elem/s 29.050  elem/s 29.274  elem/s]
change:
       time:   [+0.3613% +1.2635% +2.1923%] (p = 0.01 < 0.05)
       thrpt:  [-2.1453% -1.2477% -0.3600%]

Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing Mean [ms] Min [ms] Max [ms] Relative
msquic msquic 105.8 ± 16.0 90.9 138.6 1.00
neqo msquic reno on 219.8 ± 31.8 201.9 323.2 1.00
neqo msquic reno 214.8 ± 11.8 203.4 248.1 1.00
neqo msquic cubic on 220.3 ± 13.0 205.9 243.3 1.00
neqo msquic cubic 213.2 ± 10.9 200.9 229.4 1.00
msquic neqo reno on 88.7 ± 10.0 80.8 112.3 1.00
msquic neqo reno 93.4 ± 17.5 82.4 167.2 1.00
msquic neqo cubic on 99.3 ± 24.8 81.1 167.9 1.00
msquic neqo cubic 89.5 ± 11.5 81.9 131.6 1.00
neqo neqo reno on 155.2 ± 23.6 126.5 231.2 1.00
neqo neqo reno 172.7 ± 71.2 128.6 411.5 1.00
neqo neqo cubic on 175.5 ± 67.6 123.4 396.4 1.00
neqo neqo cubic 216.2 ± 111.6 136.1 443.1 1.00

⬇️ Download logs

@jschanck
Copy link
Contributor Author

Is this just a case where we have to quickly slot all the pieces in place in order (NSS, neqo, gecko)?

Not really. This isn't blocking anything except for enabling mlkem768x25519 in h3 (D222041). The NSS uplift (D222012) and the PSM integration (D222019) are both in autoland with clean try runs, so they'll be in Nightly shortly.

The NSS release happens on the same day as the Firefox soft freeze, so waiting for the release just means that Firefox 132 will use mlkem768x25519 for TLS but not for h3 (which is fine).

Or can we make that a little less difficult with something like a feature flag?

Thought about this for a bit---probably more hassle than it's worth.

@martinthomson
Copy link
Member

I thought that I'd ask, but I reached the same conclusion. Thanks!

@larseggert larseggert added this pull request to the merge queue Sep 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 13, 2024
@larseggert
Copy link
Collaborator

Landing this will need to wait until we can back out #2106, i.e., unpin NSS to a version that has the MLKEM stuff.

@larseggert larseggert added the blocked Blocked on something else label Sep 13, 2024
@larseggert larseggert added this pull request to the merge queue Sep 13, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 13, 2024
* Replace xyber768 with mlkem768x25519

* rustfmt

---------

Co-authored-by: Lars Eggert <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 13, 2024
@larseggert larseggert removed the blocked Blocked on something else label Sep 16, 2024
@larseggert larseggert added this pull request to the merge queue Sep 16, 2024
Merged via the queue into mozilla:main with commit 259a15f Sep 16, 2024
55 of 56 checks passed
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.

3 participants