Skip to content

x86-64 AES-GCM: no instances for CPUs with VAES or VPCLMULQDQ but not both - #4692

Merged
alex merged 1 commit into
mainfrom
claude/vg-aes-gcm-tiers
Nov 8, 2026
Merged

alex merged 1 commit into
mainfrom
claude/vg-aes-gcm-tiers

Conversation

@alex

@alex alex commented Nov 8, 2026

Copy link
Copy Markdown
Member

Part of #4548. This is stacked on #4685. There are no trust changes.

No CPU has VAES without VPCLMULQDQ, or the reverse: the two arrived together, with Ice Lake and Zen 3. ci/rust_matrix.toml already called these combinations ones "which no chip has without the other".

Despite that, x86-64 AES-GCM had four variants that pair them anyway (vaes, vpclmul, vaesPclmul and aesNiVpclmul). Its streaming functions were also built for every pair of an AES implementation and a GHASH implementation.

What changes

  • Variants: the four variants are deleted from Proof/Variants/AesGcm/X86_64.lean.
  • Streaming functions: they are now built for the AES and GHASH pairs that the remaining variants call (Proof.AesGcm.X86_64.streamPairs), instead of the cross product of the AesCtr32 and Ghash lists.
  • What's left: every x86-64 AES-GCM and AES-GCM-SIV function now has implementations for exactly these combinations:
    • VAES with VPCLMULQDQ, in 256 or 512 bits;
    • AES-NI with PCLMULQDQ, with or without AVX's loops;
    • AES-NI alone;
    • PCLMULQDQ alone;
    • the baseline.
  • Tests and benchmarks: four configurations of Ice Lake's aes_gcm group in ci/rust_matrix.toml, and four profiles in bench/gcm_siv_features.py, existed only to reach the deleted instances. They are removed.

Every other dispatcher is unchanged. I compared each dispatcher with the base branch's: the only differences are the deleted arms.

Checks

  • lake build passes.
  • Emit.lean passes.
  • Every step of the Static checks job passes, including cpu_tests.py lint and algorithms_table.py --check.
  • check_lean_public_imports.py passes.
  • cargo clippy and cargo test pass, including the aes_gcm tests under several VG_CPU_FEATURES settings.

Generated by Claude Code

@alex
alex force-pushed the claude/vg-dispatch-by-api branch from c4cdac8 to abf6ffa Compare November 8, 2026 20:43
@alex
alex force-pushed the claude/vg-aes-gcm-tiers branch from 87d70dd to 2b47209 Compare November 8, 2026 20:43
Base automatically changed from claude/vg-dispatch-by-api to main November 8, 2026 21:21
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

This pull request has conflicts with main, found after e4c4e66 landed on main: rebase it to resolve them. Before rebasing, see CLAUDE.md on checking how much Lean main changed, and on restacking a stacked pull request.

Posted by .github/workflows/conflicts.yml, once per push to a conflicting pull request.

… both

No CPU has VAES without VPCLMULQDQ, or the reverse: they came together,
with Ice Lake and Zen 3. AES-GCM's x86-64 variants paired them anyway
(`vaes`, `vpclmul`, `vaesPclmul`, `aesNiVpclmul`), as did its streaming
functions, made for every pair of an AES implementation and a GHASH one.
Delete those four variants, and emit the streaming functions for the pairs
the remaining variants call (`streamPairs`), so that every AES-GCM and
AES-GCM-SIV function on x86-64 has an implementation for each of AES-NI
with PCLMULQDQ (with and without AVX's loops), AES-NI alone, PCLMULQDQ
alone, VAES with VPCLMULQDQ (in 256 or 512 bits) and the baseline, and no
other. The CPU-feature configurations and benchmark profiles that only
reached those instances go too.

Part of #4548.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHFjAR7Byf513R4zuFy
@alex
alex force-pushed the claude/vg-aes-gcm-tiers branch from 2b47209 to c3505d9 Compare November 8, 2026 21:22
@alex
alex enabled auto-merge November 8, 2026 21:27
@alex
alex added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit cd85a7b Nov 8, 2026
49 checks passed
@alex
alex deleted the claude/vg-aes-gcm-tiers branch November 8, 2026 21:46
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