Skip to content

Improve TLS extension representation #1475

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

Closed
wants to merge 9 commits into from

Conversation

ctz
Copy link
Member

@ctz ctz commented Sep 14, 2023

not worth reviewing yet:

  • I've broken ECH (now fixed)
  • I've commented out a slab of tests
  • For other tests, I'm not super happy that they mean making the extension representation "public"

this is re #908

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Attention: Patch coverage is 97.44493% with 29 lines in your changes missing coverage. Please review.

Project coverage is 95.29%. Comparing base (834cb11) to head (0fb3391).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
rustls/src/msgs/macros.rs 90.58% 8 Missing ⚠️
rustls/src/msgs/handshake.rs 98.08% 7 Missing ⚠️
rustls/src/client/client_conn.rs 66.66% 6 Missing ⚠️
rustls/src/client/tls13.rs 97.26% 2 Missing ⚠️
rustls/src/quic.rs 81.81% 2 Missing ⚠️
rustls/src/server/hs.rs 97.05% 2 Missing ⚠️
rustls/src/client/hs.rs 98.61% 1 Missing ⚠️
rustls/src/server/server_conn.rs 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1475      +/-   ##
==========================================
- Coverage   95.40%   95.29%   -0.11%     
==========================================
  Files          97       97              
  Lines       21881    21486     -395     
==========================================
- Hits        20875    20476     -399     
- Misses       1006     1010       +4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

rustls-benchmarking bot commented Mar 13, 2024

Benchmark results

Instruction counts

Significant differences

⚠️ There are significant instruction count differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_1.2_no_crypto_server 83949 75160 -8789 (-10.47%) 0.20%
handshake_session_id_1.2_no_crypto_server 1149724 1052991 -96733 (-8.41%) 0.20%
handshake_tickets_1.2_no_crypto_server 1311738 1214171 -97567 (-7.44%) 0.20%
handshake_tickets_1.3_no_crypto_server 2219015 2104505 -114510 (-5.16%) 0.20%
handshake_session_id_1.3_no_crypto_server 2255135 2140584 -114551 (-5.08%) 0.20%
handshake_no_resume_1.3_no_crypto_server 102885 99200 -3685 (-3.58%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_server 3846827 3750291 -96536 (-2.51%) 0.20%
handshake_tickets_1.2_no_crypto_client 1272590 1241564 -31026 (-2.44%) 0.20%
handshake_session_id_1.3_no_crypto_client 2197255 2247298 ⚠️ 50043 (2.28%) 0.20%
handshake_tickets_1.3_no_crypto_client 2215824 2265848 ⚠️ 50024 (2.26%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_server 4252216 4158980 -93236 (-2.19%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_server 4707790 4613938 -93852 (-1.99%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 4982714 4885348 -97366 (-1.95%) 0.20%
handshake_session_id_1.2_no_crypto_client 1176713 1153920 -22793 (-1.94%) 0.20%
handshake_no_resume_1.2_no_crypto_client 99572 98617 -955 (-0.96%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4197640 4165441 -32199 (-0.77%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 3857786 3833147 -24639 (-0.64%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_client 4522443 4494191 -28252 (-0.62%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 64605213 64941147 ⚠️ 335934 (0.52%) 0.24%
handshake_session_id_ring_1.2_rsa_aes_client 4261362 4240896 -20466 (-0.48%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 31881263 31772692 -108571 (-0.34%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 31881220 31772926 -108294 (-0.34%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 31879502 31771233 -108269 (-0.34%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 32003243 31894672 -108571 (-0.34%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_server 32003200 31894906 -108294 (-0.34%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_server 32001482 31893213 -108269 (-0.34%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 32338904 32230316 -108588 (-0.34%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 32338732 32230331 -108401 (-0.34%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 32441189 32332556 -108633 (-0.33%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_server 32337295 32229147 -108148 (-0.33%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 32440972 32332571 -108401 (-0.33%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_server 32439580 32331387 -108193 (-0.33%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 48289555 48135737 -153818 (-0.32%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 49557255 49401915 -155340 (-0.31%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 48202278 48051227 -151051 (-0.31%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 1294877 1291106 -3771 (-0.29%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 1296059 1292290 -3769 (-0.29%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 64555802 64742185 ⚠️ 186383 (0.29%) 0.25%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 4278251 4290539 ⚠️ 12288 (0.29%) 0.26%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 48200717 48077767 -122950 (-0.26%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 49483251 49357165 -126086 (-0.25%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 64326305 64467527 ⚠️ 141222 (0.22%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 48261837 48156423 -105414 (-0.22%) 0.20%

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 11367954 11316422 -51532 (-0.45%) 1.06%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 48253000 48101140 -151860 (-0.31%) 0.37%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 10487672 10463425 -24247 (-0.23%) 0.98%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 64595964 64735667 139703 (0.22%) 0.39%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 64558728 64698115 139387 (0.22%) 0.27%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1765570 1761809 -3761 (-0.21%) 1.23%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 30742390 30797260 54870 (0.18%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_client 30834070 30888940 54870 (0.18%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 30739481 30794171 54690 (0.18%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_client 30746588 30801154 54566 (0.18%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_client 30831131 30885821 54690 (0.18%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 31058927 31113901 54974 (0.18%) 0.20%
handshake_session_id_ring_1.3_rsa_aes_client 30838268 30892834 54566 (0.18%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 31130537 31185511 54974 (0.18%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 31066187 31120887 54700 (0.18%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_client 31137842 31192542 54700 (0.18%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 31062278 31116814 54536 (0.18%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_client 31133933 31188469 54536 (0.18%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 48174197 48101093 -73104 (-0.15%) 0.20%
handshake_no_resume_1.3_no_crypto_client 112260 112090 -170 (-0.15%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 49512290 49437603 -74687 (-0.15%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 49560111 49486073 -74038 (-0.15%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 2671446 2667787 -3659 (-0.14%) 0.77%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1768431 1770836 2405 (0.14%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 2674061 2670712 -3349 (-0.13%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 64391096 64469171 78075 (0.12%) 0.28%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 49512064 49461554 -50510 (-0.10%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_server 11124144 11114687 -9457 (-0.09%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_server 11129905 11120450 -9455 (-0.08%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 10996408 10987799 -8609 (-0.08%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 64361042 64403056 42014 (0.07%) 0.22%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 9500828 9495238 -5590 (-0.06%) 0.92%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 1718594 1717613 -981 (-0.06%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 3108390 3106627 -1763 (-0.06%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 64521441 64554344 32903 (0.05%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 7220273 7216730 -3543 (-0.05%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 7218304 7214767 -3537 (-0.05%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 49553103 49576881 23778 (0.05%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 11314314 11319028 4714 (0.04%) 1.56%
handshake_no_resume_ring_1.2_rsa_aes_client 2244009 2243164 -845 (-0.04%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 64593025 64571011 -22014 (-0.03%) 0.28%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 64459883 64442033 -17850 (-0.03%) 0.28%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 3114059 3113279 -780 (-0.03%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 64367938 64352279 -15659 (-0.02%) 0.45%
transfer_no_resume_ring_1.2_rsa_aes_client 57914797 57900716 -14081 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58016686 58002599 -14087 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58008831 57994746 -14085 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58019657 58005574 -14083 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 58070829 58056749 -14080 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 58128465 58114379 -14086 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 58133724 58119638 -14086 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 58123755 58109675 -14080 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46009953 46019549 9596 (0.02%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 64369375 64356229 -13146 (-0.02%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 9496920 9495048 -1872 (-0.02%) 0.60%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46186560 46195520 8960 (0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 46176181 46185138 8957 (0.02%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46005139 46012248 7109 (0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46015089 46022128 7039 (0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92544047 92529960 -14087 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_client 92545742 92531661 -14081 (-0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92534912 92520836 -14076 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92583912 92569831 -14081 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92589905 92575826 -14079 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92593877 92579799 -14078 (-0.02%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3304187 3303769 -418 (-0.01%) 0.27%
transfer_no_resume_1.2_no_crypto_client 117308744 117294664 -14080 (-0.01%) 0.20%
transfer_no_resume_1.3_no_crypto_client 117355942 117341861 -14081 (-0.01%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80249967 80258929 8962 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80367037 80376008 8971 (0.01%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80245479 80254435 8956 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80356018 80364976 8958 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46180623 46185420 4797 (0.01%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 45922129 45926886 4757 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46128687 46133443 4756 (0.01%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 2331124 2330917 -207 (-0.01%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 2336775 2336568 -207 (-0.01%) 0.20%
transfer_no_resume_1.3_no_crypto_server 105032246 105041205 8959 (0.01%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80240657 80247136 6479 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80361099 80365904 4805 (0.01%) 0.20%
transfer_no_resume_1.2_no_crypto_server 104989077 104993996 4919 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 4276589 4276418 -171 (-0.00%) 0.96%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3305095 3305129 34 (0.00%) 0.29%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 34735628 34735375 -253 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 34733898 34733656 -242 (-0.00%) 0.20%

Wall-time

Significant differences

⚠️ There are significant wall-time differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_tickets_aws_lc_rs_1.2_rsa_aes 1.82 ms 1.75 ms ✅ -0.07 ms (-3.77%) 3.28%
handshake_session_id_ring_1.2_rsa_aes 1.49 ms 1.48 ms ✅ -0.02 ms (-1.08%) 1.00%

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_session_id_aws_lc_rs_1.2_rsa_aes 1.64 ms 1.59 ms -0.05 ms (-3.23%) 4.00%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.28 ms 1.24 ms -0.04 ms (-3.13%) 5.24%
handshake_session_id_1.2_no_crypto 359.74 µs 349.29 µs -10.45 µs (-2.90%) 5.00%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.10 ms 1.07 ms -0.03 ms (-2.79%) 4.40%
handshake_session_id_1.3_no_crypto 673.49 µs 656.92 µs -16.57 µs (-2.46%) 5.00%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.26 ms 1.23 ms -0.03 ms (-2.29%) 5.69%
handshake_tickets_1.2_no_crypto 392.72 µs 383.87 µs -8.86 µs (-2.25%) 5.00%
handshake_tickets_1.3_no_crypto 654.21 µs 639.53 µs -14.68 µs (-2.24%) 5.00%
handshake_no_resume_1.3_no_crypto 86.41 µs 88.31 µs 1.89 µs (2.19%) 5.00%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes 4.53 ms 4.60 ms 0.07 ms (1.65%) 8.41%
handshake_no_resume_1.2_no_crypto 78.04 µs 79.26 µs 1.22 µs (1.56%) 5.00%
transfer_no_resume_ring_1.2_rsa_aes 5.72 ms 5.80 ms 0.08 ms (1.37%) 4.92%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.22 ms 5.29 ms 0.07 ms (1.36%) 7.01%
transfer_no_resume_ring_1.3_ecdsap256_aes 5.30 ms 5.36 ms 0.06 ms (1.16%) 4.80%
transfer_no_resume_ring_1.3_rsa_aes 5.79 ms 5.85 ms 0.07 ms (1.12%) 4.27%
handshake_tickets_ring_1.2_rsa_aes 1.57 ms 1.56 ms -0.02 ms (-0.99%) 1.17%
handshake_session_id_ring_1.3_ecdsap256_aes 5.47 ms 5.42 ms -0.05 ms (-0.85%) 1.41%
handshake_session_id_ring_1.3_ecdsap256_chacha 5.44 ms 5.39 ms -0.05 ms (-0.84%) 1.71%
transfer_no_resume_ring_1.3_ecdsap384_aes 8.39 ms 8.46 ms 0.07 ms (0.80%) 4.41%
handshake_session_id_ring_1.3_rsa_chacha 5.93 ms 5.88 ms -0.05 ms (-0.79%) 1.72%
handshake_tickets_ring_1.3_ecdsap256_aes 5.53 ms 5.49 ms -0.04 ms (-0.78%) 1.27%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.21 ms 5.25 ms 0.04 ms (0.77%) 6.10%
handshake_tickets_ring_1.3_ecdsap256_chacha 5.49 ms 5.45 ms -0.04 ms (-0.77%) 1.56%
handshake_tickets_ring_1.3_rsa_chacha 5.98 ms 5.94 ms -0.04 ms (-0.71%) 1.22%
handshake_session_id_ring_1.3_rsa_aes 5.97 ms 5.93 ms -0.04 ms (-0.68%) 1.09%
transfer_no_resume_1.2_no_crypto 11.67 ms 11.74 ms 0.08 ms (0.67%) 5.00%
handshake_tickets_ring_1.3_rsa_aes 6.02 ms 5.98 ms -0.04 ms (-0.67%) 1.08%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.03 ms 5.06 ms 0.03 ms (0.58%) 6.36%
transfer_no_resume_1.3_no_crypto 11.85 ms 11.92 ms 0.06 ms (0.53%) 5.00%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 13.68 ms 13.75 ms 0.07 ms (0.52%) 2.44%
transfer_no_resume_ring_1.3_ecdsap256_chacha 12.86 ms 12.92 ms 0.07 ms (0.51%) 2.13%
transfer_no_resume_ring_1.3_rsa_chacha 13.35 ms 13.41 ms 0.06 ms (0.47%) 1.95%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 13.00 ms 13.06 ms 0.06 ms (0.47%) 2.52%
handshake_session_id_ring_1.3_ecdsap384_aes 8.56 ms 8.52 ms -0.04 ms (-0.45%) 1.00%
transfer_no_resume_ring_1.3_ecdsap384_chacha 15.95 ms 16.02 ms 0.07 ms (0.45%) 2.06%
handshake_tickets_ring_1.3_ecdsap384_aes 8.62 ms 8.58 ms -0.04 ms (-0.43%) 1.00%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 9.21 ms 9.17 ms -0.04 ms (-0.42%) 2.42%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 577.73 µs 580.08 µs 2.35 µs (0.41%) 3.29%
handshake_tickets_ring_1.3_ecdsap384_chacha 8.58 ms 8.55 ms -0.03 ms (-0.41%) 1.00%
handshake_session_id_ring_1.3_ecdsap384_chacha 8.52 ms 8.49 ms -0.03 ms (-0.40%) 1.29%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 9.35 ms 9.31 ms -0.04 ms (-0.38%) 2.74%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 9.16 ms 9.13 ms -0.03 ms (-0.35%) 2.54%
handshake_no_resume_ring_1.3_ecdsap256_chacha 457.60 µs 459.12 µs 1.52 µs (0.33%) 3.94%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 9.33 ms 9.30 ms -0.03 ms (-0.31%) 2.50%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 13.69 ms 13.72 ms 0.03 ms (0.24%) 2.53%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.26 ms 1.27 ms 0.00 ms (0.23%) 1.79%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 582.85 µs 583.87 µs 1.03 µs (0.18%) 3.72%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.25 ms 1.26 ms 0.00 ms (0.14%) 1.56%
handshake_no_resume_ring_1.3_ecdsap256_aes 461.96 µs 462.54 µs 0.57 µs (0.12%) 3.69%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 9.34 ms 9.33 ms -0.01 ms (-0.11%) 1.78%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.55 ms 3.56 ms 0.00 ms (0.11%) 1.00%
handshake_no_resume_ring_1.2_rsa_aes 943.27 µs 944.06 µs 0.79 µs (0.08%) 1.40%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.55 ms 3.56 ms 0.00 ms (0.08%) 1.00%
handshake_no_resume_ring_1.3_rsa_aes 950.02 µs 950.73 µs 0.71 µs (0.07%) 1.65%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 8.62 ms 8.61 ms -0.00 ms (-0.06%) 2.41%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 8.44 ms 8.44 ms 0.00 ms (0.05%) 2.38%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 9.16 ms 9.16 ms 0.00 ms (0.05%) 1.31%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 9.11 ms 9.12 ms 0.00 ms (0.05%) 2.01%
handshake_no_resume_ring_1.3_rsa_chacha 949.47 µs 949.72 µs 0.26 µs (0.03%) 1.82%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 9.30 ms 9.30 ms -0.00 ms (-0.02%) 2.39%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 8.65 ms 8.65 ms -0.00 ms (-0.02%) 2.30%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 8.49 ms 8.49 ms 0.00 ms (0.01%) 1.61%

Additional information

Historical results

Checkout details:

@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch from dc957ec to 54d1d2c Compare March 21, 2025 14:22
@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch 8 times, most recently from c86bdef to f6fa71d Compare April 3, 2025 14:45
@djc
Copy link
Member

djc commented Apr 3, 2025

I skimmed this a few days ago, and feel obliged to ask: what's the value of the macro here?

@ctz
Copy link
Member Author

ctz commented Apr 3, 2025

I skimmed this a few days ago, and feel obliged to ask: what's the value of the macro here?

At the minute it is mostly saving on writing quite a large number of lines of repeated code, mapping between fields on the struct and ExtensionType values.

@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch 4 times, most recently from a722dc5 to 9b54669 Compare April 7, 2025 13:25
@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch 2 times, most recently from 1d06a1a to 43ce9af Compare April 11, 2025 15:29
@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch 2 times, most recently from e0e1ff6 to 271401a Compare June 3, 2025 14:41
@ctz ctz marked this pull request as ready for review June 3, 2025 15:03
@ctz
Copy link
Member Author

ctz commented Jun 3, 2025

@ctz let me know if/when this is ready for another round of review.

OK, this is ready for another round. Not 100% happy with how many copies of ALPN data are going on, but that is probably an issue for another PR.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

I'm guessing it would be helpful to land this in several PRs. I think there's a few prefix commits that we could just land straight away.

Maybe it would make sense to re-order this a bit to land 1.3 certs/cert requests/tickets first, and leave ClientHello/HRR/ServerHello to a separate (or three separate) PR(s)?

@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch 4 times, most recently from b08492e to 6918253 Compare June 12, 2025 15:57
@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch from 8e7112c to 314864a Compare June 17, 2025 09:09
ctz added 8 commits June 17, 2025 10:47
Instead of `Vec<ClientExtension>`, store the extension data as
a struct.  This is possible because past commits have removed
the need for this us to losslessly round-trip extension data.

This involves fewer allocations to construct the extensions for
clients.

It eliminates repeated iteration of the vector to find specific
extensions when processing a `ClientHello` for servers.

It also reduces the cost of detecting duplicate extensions, which
is moved into the decoding process -- a new
`InvalidMessage::DuplicateExtension` error is introduced for this
purpose.

The struct is produced by a macro, which externalises the overall
encoding and decoding operations.  This allows specialisation for
order of encoding (for ClientHello extension order randomisation)
and whether an empty input is allowed (for ClientHello extensions
in TLS1.2).

During decoding a ClientHello, validate that any PS offer appears
last.  This replaces `ClientHelloPayload::check_psk_ext_is_last`.
Now we have a specific error for this we can produce the
error bogo expects for this case.
Annoyingly, ECH server confirmation requires that this this
can be round tripped.  Record the decoded order and prefer
to encode in that order.
@ctz ctz force-pushed the jbp-efficient-extensions-experiment branch from 314864a to 0fb3391 Compare June 17, 2025 09:47
@ctz ctz marked this pull request as draft June 17, 2025 13:13
@s-arash
Copy link
Contributor

s-arash commented Jul 9, 2025

Hi @ctz. With this work done, is it a good time to start working on #2403?

@ctz
Copy link
Member Author

ctz commented Jul 9, 2025

Yes. If you haven't found it already here's where I was expecting this change to (mostly) go:

let sni = match &client_hello.server_name {
Some(ServerNamePayload::SingleDnsName(dns_name)) => Some(dns_name.to_lowercase_owned()),
Some(ServerNamePayload::IpAddress) => None,
Some(ServerNamePayload::Invalid) => {
return Err(cx.common.send_fatal_alert(
AlertDescription::IllegalParameter,
PeerMisbehaved::ServerNameMustContainOneHostName,
));
}
None => None,
};

@s-arash
Copy link
Contributor

s-arash commented Jul 10, 2025

Great! Thanks @ctz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance_enhancement Pull requests that should improve performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants