Skip to content

Benchmark AES-GCM encryption from two pieces, as TLS 1.3 records - #1339

Merged
alex merged 1 commit into
mainfrom
bench-aes-gcm-gather
Oct 8, 2026
Merged

alex merged 1 commit into
mainfrom
bench-aes-gcm-gather

Conversation

@alex

@alex alex commented Oct 8, 2026

Copy link
Copy Markdown
Member

Adds an aes-128-gcm-encrypt-two-pieces group to bench/benches/primitives/aes_gcm.rs: AesGcm::encrypt from a payload of n bytes and one more byte (the content type of a TLS 1.3 record), at the one-shot sizes. It runs next to OpenSSL (two updates) and aws-lc-rs (seal_out_of_place_scatter with the byte as extra_in). A setup assertion checks that the ciphertext and tag match aws-lc-rs's.

This comes from the rustls provider analysis in #991. The provider seals records with AesGcm::encrypt in exactly this shape, and on x86-64 that is slower than copying into the output and calling encrypt_in_place (#1228). This PR only adds the benchmark, so that the PRs optimizing vg_aes_gcm_seal_gather get a base for the Benchmarks check to compare against.

Validation: cargo bench on this group (the assertion holds at every size), cargo clippy --all-targets -- -D warnings and cargo fmt --check in bench/, and ci/check_arch_gates.py.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FoYWDDEDFq1DFev5X7n2aq


Generated by Claude Code

`AesGcm::encrypt` from a payload and one more byte, the content type of a
TLS 1.3 record, next to OpenSSL (two updates) and aws-lc-rs
(`seal_out_of_place_scatter` with the byte as `extra_in`), at the
one-shot sizes. This is how rustls's verified-garbage provider (#991)
seals records, and gives the optimizations of `vg_aes_gcm_seal_gather`
(#1228) a base to compare with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FoYWDDEDFq1DFev5X7n2aq
@alex
alex enabled auto-merge October 8, 2026 15:41
@alex
alex added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 2bb5bad Oct 8, 2026
45 of 47 checks passed
@alex
alex deleted the bench-aes-gcm-gather branch October 8, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants