Repository navigation
Benchmarks: RSA key loading from the CRT values (rsa_from_crt) - #1352
Merged
Merged
Conversation
verified-garbage's PrivateKey::from_crt next to aws-lc-rs's RsaKeyPair::from_components, which checks the key, and OpenSSL's Rsa::from_private_components, which checks nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqW9NMssoiBx9i4PpksckL
alex
pushed a commit
that referenced
this pull request
Oct 8, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqW9NMssoiBx9i4PpksckL
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.
From the rustls provider analysis in #991. rustls's verified-garbage provider loads server keys with
PrivateKey::from_crt, and the analysis there measured it at 0.14–0.48 of aws-lc-rs's speed. No benchmark covered key loading, so this PR adds one to measure that and the cheaper key check that follows (#1343, then its implementation).Change
New group
rsa_from_crtinbench/benches/primitives/rsa.rs, at 2048, 3072 and 4096 bits. Each iteration loads one key from all of(n, e, d, p, q, dP, dQ, qInv), as from a PKCS #1RSAPrivateKey:PrivateKey::from_crtRsaKeyPair::from_components, which checks the key as it loads itRsa::from_private_components, which checks nothingThe group is gated like the rest of
rsa.rs. It only adds a group to the existingUSES = ["rsa"]file, and touches no library code.Numbers today
Measured locally on a Sapphire Rapids Xeon,
VG_CPU_FEATURES=avx,avx2,avx512f,bmi2,adx, withOPENSSL_ia32cap=":~0x200000"(no AVX512_IFMA anywhere). Times are means:from_crtcosts about one private-key operation because it checks the key with the operation on 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01PqW9NMssoiBx9i4PpksckL
Generated by Claude Code