Machine-Checked Depth-Constrained Costs for Grover Attacks on AES and SHA-2
Konstantinos Karagiannis
quant-ph
Nov 30, 2026 · v1
cs.CR cs.LO
TL;DR
Extends DeepMind's Lean 4 formal-quantum-computation library with circuit depth and T-depth semantics. Proves depth-capped Grover cost bounds and verifies the Boyar–Peralta AES S-box by kernel decide.
Abstract
Grover search against symmetric primitives is costed under a depth cap: NIST's MAXDEPTH forces an attacker to parallelise, and parallel Grover pays for depth in work. We give a machine-checked account of that accounting, built on DeepMind's Lean 4 formal-quantum-computation library. We add an ASAP circuit-depth and T-depth semantics, which the library lacks, and prove that disjoint parallel composition preserves both. Taking Zalka's parallel lower bound as the single cited hypothesis, we prove that parallelism never reduces total work, that a depth cap $D$ forces $m \geq \lceil (Sτ/D)^2 \rceil$ parallel instances for a search of $S$ iterations of depth $τ$, and that gate cost and depth-times-width cost are at least their unconstrained values times $Sτ/D$. It follows that any constant-factor reduction in the iteration count is worth up to its square under a depth cap. Applied to recent AI-discovered parallel-search protocols, this accounting shows no gain for single-target key search, where they match the prior baseline, and at most 0.57 bits under a depth cap for their best multi-target find-any constant, 1.22x. We instantiate these bounds for AES-128 and SHA-256 with literature parameters. On the gate side we verify the Boyar-Peralta AES S-box, parsed mechanically from the published listing, against the FIPS-197 table on all 256 inputs, embed it reversibly into the library's circuit type, and derive the S-box T-count of AES-128, -192 and -256 from the FIPS-197 key schedule; this is the forward S-box layer only, not a full Grover oracle. All proofs are in Lean 4 with no sorry and are checked to depend only on standard axioms.
Problem
Grover attack cost estimates for AES and SHA-2 under NIST's MAXDEPTH cap rest on chains of hand calculations: circuits, gate and depth counts, parallelisation rules, and arithmetic. None of these chains has been machine-checked, and the Lean quantum library used for recent AI-discovered parallel Grover protocols has no depth metric.
Approach
Adds ASAP circuit-depth and T-depth semantics to DeepMind's Lean 4 formal-quantum-computation library and proves that disjoint parallel composition preserves both. Takes Zalka's parallel lower bound as a single cited hypothesis and proves work, parallelism, gate-cost and depth×width bounds under a depth cap. A generator mechanically parses the published Boyar–Peralta S-box listing into Lean terms. These are checked against the FIPS-197 table on all 256 inputs and embedded reversibly into the library's circuit type.
Results
Parallelism never reduces total work, and a depth cap D forces m ≥ ⌈(Sτ/D)²⌉ instances. Constant-factor gains in the iteration count are therefore worth up to their square under a cap, so AI-discovered protocols give no single-target gain and at most 0.57 bits for find-any search. S-box T-counts for AES-128/192/256 are derived, and all proofs are sorry-free and depend only on standard axioms.
| Quantity | No depth cap | Under a cap (Sτ>D) |
|---|
| Single target (k=1) | 1× (0 bits) | 1× (0 bits) |
| Find-any constant (m,k≥2) | 1.22× (0.29 bits) | 1.49× (0.57 bits) |
| Find-all constant (k≥2) | 2.55× (1.35 bits) | not key search |
| k=2^32 targets, query-model ceiling | 2^16 (16 bits) | 2^32 (32 bits) |
Reported constants and multi-target erosion, without and with a depth cap