WorksPhysics and Astronomy
Quantum-Aware Key Rank for Side-Channel Attacks evaluation
Abstract
Side-channel attacks on block ciphers rarely recover the key outright: they leave a residual key space ordered by subkey posteriors, and evaluation laboratories report the key rank of the true key against thresholds near 2^48 and 2^60. No evaluation framework models an adversary who collects traces classically and finishes the search on a quantum computer, although quantum search with advice provides exactly that. We give such an adversary a cost model and a metric. For a device whose key has rank r, any quantum algorithm with classical access to the posteriors needs Omega(sqrt(r)) cipher evaluations, and block search achieves O(sqrt(r)); the per-instance advantage is exactly quadratic, and the super-quadratic exponents reported for search with advice are averages over the prior that apply to no single device. Under the NIST MAXDEPTH budget D and a Grover iteration of g gates and depth d, the quadratic advantage holds only for ranks up to (4D/(pi d))^2 and collapses to a constant factor beyond; with the best published AES-128 oracle and D = 2^40 the window closes near rank 2^58.6. We define the quantum-aware key rank, the classical rank of equal cost, computable from the rank estimators laboratories already run, and derive the classical rank a device must retain to keep a given threshold against each depth budget. Block search and amplitude amplification from the product-form posterior state are within a factor of two to four of each other on Hamming-weight posteriors, so the cost of coherent indexing decides between them. Experiments on simulated leakage and a toy cipher confirm the predicted window: at SNR 0.125 a depth-limited quantum adversary is worth about 22 traces to a classical one, however large its gate budget.
Introduction
This section states the problem, fixes the adversary we consider, and lists the five contributions with forward pointers to the sections that establish them.
A side-channel attack on a block-cipher implementation rarely recovers the key outright. Correlation power analysis (CPA) or template attacks return, for each subkey byte, a score or posterior distribution; the true key is then one candidate among many, and its position in the resulting ordering is its key rank. Evaluation laboratories treat the rank as the residual security of the device: optimal-order enumeration is practical up to roughly candidates [1], parallel and histogram-based enumeration extend this to the – range depending on infrastructure [2, 3], and rank estimation bounds the rank even when enumeration is out of reach [4, 5, 6]. A commonly stated rule of thumb is that a rank below about counts as a full break and that a well-resourced adversary can enumerate up to about [7].
None of the frameworks that govern side-channel evaluation—the JIL attack-potential rating for smartcards [8], ISO/IEC 17825 [9], or the FIPS 140-3 test suite—models an adversary who, after collecting traces classically, performs the remaining enumeration on a quantum computer. The ingredients for such an adversary exist: Grover’s algorithm [10], amplitude amplification from a biased initial state [11], Montanaro’s quantum search with advice [12], and the explicit side-channel instantiation of Martin, Montanaro, Oswald and Shepherd [13], which obtains a quadratic reduction in the number of keys that must be tested. The only public reference to the consequence we are aware of is a remark that a classical cut-off at would not be safe post-quantum because Grover reduces it to [7].
Two recent results complicate the picture in opposite directions. On the one hand, Bashiri, Glaser, May and Nowakowski [14] and Schubert et al. [15] show that when the attacker’s expected cost is averaged over the prior distribution, the quantum exponent is super-quadratic: the classical guesswork grows as while the quantum cost grows as , and for every non-uniform distribution. On the other hand, the NIST post-quantum standardization process bounds every quantum attack by a maximal circuit depth MAXDEPTH [16], and Jaques, Naehrig, Roetteler and Virdia [17] show that under this bound Grover search on AES must be parallelized with a -loss [18], so that the total gate cost becomes rather than . An evaluation lab that wants a single number for "residual security against a quantum adversary" is therefore caught between a result that says the speed-up is more than quadratic and a constraint that says it may be no speed-up at all.
We resolve the tension by separating two questions that the literature has treated as one. The first is per-instance: a specific device holds a specific key of a specific rank , and the evaluator wants the cost of recovering that key. The second is average-case: a population of devices draws keys from a distribution, and one wants the expected cost. We show that the per-instance quantum advantage is exactly quadratic in and cannot be improved, that the super-quadratic exponents are a property of the average only, and that under MAXDEPTH the quadratic advantage survives only for ranks inside an explicit window. We package the result as a metric, quantum-aware key rank, that an evaluation lab can compute with the rank estimators it already runs.
Contributions.
C1. Per-instance quadratic limit (Sect. 4, Theorem 1, Corollary 1). For a key of residual rank , any quantum algorithm with classical access to the posteriors and quantum access to the cipher oracle needs queries, and block search achieves . The super-quadratic exponents of [14, 15] arise only under averaging over the prior; conditioning on the rank removes them. Both statements are correct and answer different questions.
C2. Quantum window (Sect. 5, Theorem 3). With a Grover iteration of gates and depth and a depth budget , the quantum cost is only for ; above it the cost is and the gain over classical enumeration is the constant . We give closed-form window boundaries and their sensitivity to the published value of .
C3. Quantum-aware key rank (Sect. 3, Definitions 1–3; Sect. 4, Proposition 5). A family of metrics—per-instance QR, depth-constrained QKR defined as the classical rank of equal cost, and average-case quantum guesswork QG—computable from histogram and ESrank estimators.
C4. Trace discount (Sect. 7, Proposition 6). For a fixed gate budget, how many additional traces a classical attacker needs to match a quantum attacker, predicted in closed form and measured on simulated Hamming-weight leakage: the discount plateaus at traces, about 22 at SNR and .
C5. Which quantum strategy wins (Sect. 6, Proposition 4). Amplitude amplification from a cheap product-form initial state costs ; block search costs but needs coherent indexing. We prove always, give the condition on the advice sharpness and the indexing overhead under which block search wins in gates, and measure on 4 000 simulated instances: it is 2–3 bits, so the two strategies are within a small constant of each other and decides.
We treat the cipher oracle’s cost as an input taken from published AES circuits [17, 19, 20, 21] and report every window with its sensitivity to the choice. New circuit designs, the concrete gate cost of the coherent indexing circuit, and the Ukrainian standard Kalyna are the subject of a companion paper [22] and appear here only as parameters or as future work.
Section 2 reviews side-channel posteriors, classical enumeration, Grover-type search, search with advice, and the MAXDEPTH cost model, and identifies the gap. Section 3 fixes the adversary, the notation and the metrics. Sections 4–6 contain the theory (C1, C2, C5). Section 7 reports experiments (C4, C5). Section 8 draws the consequences for evaluation practice, and Sect. 9 states limitations. Proofs are in Appendix A.
With the problem and the contributions in place, we next collect the background each contribution builds on.
Background
This section reviews the five bodies of work the paper combines and closes each with what that work does not do.
A divide-and-conquer side-channel attack on a block cipher targets an intermediate value that depends on the plaintext and on one subkey byte at a time, typically the S-box output of the first round. For traces, CPA [23] computes, for each hypothesis of subkey , the Pearson correlation between the measured leakage and a leakage model of the intermediate value (Hamming weight in the simplest case); a template attack [24] instead fits a Gaussian model per intermediate value during a profiling phase and returns, for each hypothesis, a likelihood. Either way the attack ends with an array of scores, and under the usual Bayesian treatment with a uniform prior on keys these scores become posteriors with for each . The posterior on the full key is taken to be the product ; this independence assumption is standard in the enumeration literature and is exact when the leakages of different subkeys are conditionally independent given the key, which holds for unprotected first-round S-box leakage and fails, for instance, for masked implementations where the mask ties several bytes together. The side-channel literature establishes how posteriors are obtained and how good they are; it does not consider what an adversary with a quantum computer does with them.
Given the posteriors, two classical problems arise. Enumeration outputs keys in decreasing order of probability until the true key is found; the optimal-order algorithm of Veyrat-Charvillon, Gérard, Renauld and Standaert [1] is memory-bound and practical to about candidates. Rank estimation does not output keys but bounds the position of a known key in the ordering; it was introduced in [4] and made fast and tight by the histogram-convolution method of Glowacz et al. [5], the path-counting method of Martin, O’Connell, Oswald and Stam [2] (which also enumerates in parallel), the histogram enumeration of Poussier, Standaert and Grosso [3], the bounded-space enumeration of David and Wool [25], and ESrank [6], which estimates the rank to within about one bit in under a second; Martin, Mather and Oswald [26] show that path counting and histogram convolution are two views of the same computation. Bogdanov et al. [27] give a score-based enumeration with low memory, and Villanueva-Polanco [28] surveys the problem. All of these algorithms work on integer weights obtained by discretizing and add keys by weight; a key’s rank is then the number of keys of strictly smaller weight, up to a discretization error that is analyzed in [13]. The practical conclusion drawn by the community is that ranks up to roughly – are reachable by a determined classical adversary and that an evaluator therefore reports with these thresholds in mind [7]. This literature determines the classical cost of the residual search exactly; it does not model a quantum adversary, and its thresholds are stated for classical enumeration only.
Grover’s algorithm [10] finds the unique marked item among with applications of the oracle, and Boyer, Brassard, Høyer and Tapp [29] give the success probability after iterations as with , together with a strategy for an unknown number of marked items. Amplitude amplification [11] generalizes the algorithm to an arbitrary initial state ; if the marked item has amplitude in , it is found after iterations of the operator . When is unknown, the fixed-point variant of Yoder, Low and Chuang [30] reaches any target success probability with an optimal number of queries without overshooting. Two limits govern everything that follows. First, queries are necessary [31], and Zalka [18] proves that Grover’s algorithm is exactly optimal: for every number of queries up to it attains the largest success probability any quantum algorithm can. Second, Zalka also shows that running Grover instances in parallel reduces the number of iterations each must perform only by , so the total number of oracle evaluations grows by ; parallelization is possible but not free. Grover-type search fixes the query complexity of unstructured search; it says nothing about how to exploit a prior that is known classically.
Montanaro [12] considers search over items when the algorithm is given, as advice, a probability distribution over the location of the marked item. Sorting the items by decreasing probability and running Grover on blocks of geometrically increasing size gives an expected number of queries , where is the (random) position of the marked item in the sorted order; Montanaro proves this is optimal up to a constant for any fixed distribution. The algorithm assumes the advice is presented already sorted. Martin, Montanaro, Oswald and Shepherd [13] remove this assumption for the side-channel setting: using the path-counting structure of [2] they construct a function that returns the -th key of weight in in time , so that Grover can search by index inside each weight slice without ever materializing the sorted list; the result is a quadratic reduction in the number of keys that must be tested, at the price of a quantum random-access memory (QRAM) holding the path-counting array and of a coherent evaluation of inside every oracle call. Banegas and Villanueva-Polanco [32] instantiate the same idea for cold-boot key recovery and provide Grover oracles for AES, PRESENT, GIFT and LowMC; Albrecht and Shen [33] use search with advice and a bounded-error oracle [34] inside a dual attack on LWE.
The exact exponent of the average-case speed-up was settled recently. Bashiri, Glaser, May and Nowakowski [14] prove that the cost of Montanaro’s algorithm on a product distribution is while classical guessing costs by Arıkan’s bound [35], so the exponent ratio exceeds 2 for every non-uniform ; Schubert, Paskarbeit, Kramer, Seifert and Margraf [15] compute this ratio exactly or with a certified error for cold-boot, template and Keccak side-channel distributions and observe ratios up to about 3.97 on synthetic models. Both papers measure expected query complexity under the prior; neither accounts for the gate cost of the cipher oracle, for the cost of coherent indexing, or for a depth bound, and neither asks what the cost is for a device whose key has a given rank. This paper takes up exactly those questions, and Sect. 4 shows how the two viewpoints are reconciled.
Gap analysis
To our knowledge, no published work (i) states the per-instance quantum cost as a function of the rank, (ii) combines search with advice with the MAXDEPTH cost model and concrete oracle costs, (iii) quantifies the trade-off between side-channel traces and quantum budget, or (iv) proposes a metric that an evaluation lab could report. Related topics that are not this problem include quantum attacks on QKD hardware (also called "quantum side channels"), fault attacks whose residual space is small enough that no quantum speed-up matters, and side channels on lattice-based schemes [15]; we position against them in Sect. 9 only.
Quantum Resource Estimates for AES and the MAXDEPTH Model
NIST’s call for post-quantum proposals [16] defines security categories by the cost of Grover key search on AES and introduces as the maximal depth of any quantum attack circuit, justified as the number of sequential gates a quantum computer could perform in roughly a year, a decade, and a millennium respectively. A Grover search whose unparallelized depth exceeds MAXDEPTH must be split into parallel instances each running for of the time, so that the total gate count becomes ; NIST’s table gives quantum gates for AES-128 against classical gates. Jaques, Naehrig, Roetteler and Virdia [17] implement the full Grover oracle for AES in Q#, derive the parallelization formulas we use in Sect. 5 (their Eqs. (5)–(9)), and lower the AES-128 estimate to about ; they also show that for no parallelization is needed for AES-128. Their AES-128 oracle with one plaintext–ciphertext pair and Maximov’s MixColumns has full depth 2086 and width 2817, with 294 863 CNOT, 84 488 one-qubit Clifford, 54 908 and 13 727 measurement gates ([17 Table 8], arXiv version; the EUROCRYPT version may differ in the last digits [VERIFY]). Subsequent work lowered the depth further: Huang and Sun [19] reduce the -depth of AES-128 from 60 to 40 at equal width or to 30 with a small width increase, and reduce the width of the narrowest circuit from 512 [36] to 371; Liu, Preneel, Zhao and Wang [20] [VERIFY] reduce the full depth of the AES-128 encryption circuit to 730 in a pipelined architecture, and Jiang et al. [21] tabulate the full pipeline (compute-and-uncompute) circuits of these works side by side, which is the form our cost model needs; Jang et al. [37] report a pool of 78 implementations and an attack cost of for AES-128 in NIST’s accounting. The earlier estimates of Grassl et al. [38], which NIST’s original table is based on, and of Bonnetain, Naya-Plasencia and Schrottenloher [39], who show that no structural attack beats generic search on full AES by a meaningful margin, complete the picture. This literature supplies the per-iteration gate count and depth that our cost model needs and the parallelization rule that turns a depth bound into a gate count; it does not consider a search space smaller than or a non-uniform prior, and so it does not say at what rank the depth bound starts to matter.
Having collected the ingredients, we now fix the adversary model, the notation, and the metrics that the rest of the paper uses.
Model, Notation and Metrics
This section defines the adversary, lists every symbol used in the paper, and introduces the three quantum-aware rank quantities.
Adversary Model
We consider a Q1 adversary in the sense of [40]: all interaction with the target device is classical, and quantum computation happens offline. Concretely, the adversary (i) collects power or electromagnetic traces together with the corresponding plaintexts and at least one plaintext–ciphertext pair ; (ii) runs a classical CPA or template attack to obtain posteriors ; (iii) builds, from the known pair, a quantum circuit that marks a candidate key iff ; and (iv) runs a quantum algorithm with classical access to and quantum access to . The adversary has no quantum access to the device. The total depth of the quantum computation is bounded by , and we charge the number of logical gates; error-correction overhead is outside the model (Sect. 9). Two assumptions are used throughout.
Assumption 1 (Independence). The posterior on the full key factors: .
Assumption 2 (Unique marked key). Among the keys of rank at most there is exactly one key with , namely .
Assumption 1 is the standard enumeration model of Sect. 2.2. Assumption 2 holds with probability for a block size under the usual random-permutation heuristic [17 Sect. 2.2], which is overwhelming for and ; a second pair removes the issue entirely at twice the oracle cost.
Per-iteration cost.
One iteration of Grover’s algorithm or of amplitude amplification consists of one call to and one reflection; for block search the reflection is about the uniform state on the current block, for product-state amplification about the product state. The cipher oracle dominates both, so we take and to be the oracle’s gate count and depth plus the reflection’s and treat as the only quantity that distinguishes the two strategies (Sec. 6). For AES-128 we use five published circuits plus the Grassl-era anchor and report every result for each; Table 2 lists them.
Table 2. Per-iteration costs for the AES-128 oracle used as inputs. For the three circuits after [17] the tabulated values are those of the encryption circuit as reported in [21 Table 8] (Liu et al. there doubled from a forward-only circuit), and adds one-qubit Clifford and measurement gates at the JNIV20 ratio
(estimate). The takeaway is that varies by a factor of about 1.8 across post-2020 circuits and by 90 against the Grassl-era circuit behind NIST’s figure.
| Source | circuit | (gates) | (full depth) | width | note |
| [38] via [17 Tab. 10] | Grover oracle, | 193 588 | 2953 | G-cost, depth (derived) | |
| [17] Tab. 8 | oracle, in-place MC, | 445 376 | 2816 | 1665 | CNOT+1qC+T+M |
| [17] Tab. 8 | oracle, Maximov MC, | 447 986 | 2086 | 2817 | CNOT+1qC+T+M |
| [19] | encryption, pipeline | 452 340 | 2198 | 3936 | 298 720 CNOT, 54 400 (est.) |
| [20] | encryption, pipeline () | 407 050 | 1600 | 3689 | 264 752 CNOT, 54 400 (est.) |
| [21] | encryption, pipeline | 306 548 | 1790 | 2896 | 189 300 CNOT, 54 400 (est.) |
Table 1.
Two numbers recur. From the NIST table [16], AES-128 costs quantum gates and classical gates over keys; since the parallelized cost equals (Sect. 5), this gives in NIST’s accounting and per key (both derived). With the Jaques et al. oracle (Maximov MC, ) one has (derived), and indeed reproduces their Table 12 (derived check). We carry both anchors, [16] and ([17]), since the window boundaries depend on them.
Metrics
We now define the three quantum-aware quantities. The first is the per-instance analogue of the key rank.
Definition 1 (Per-instance quantum rank). .
QR is the number of oracle queries, up to a constant, that an unconstrained quantum adversary needs (Theorem 1). It ignores gate cost and depth; the next definition restores both and expresses the result in the unit evaluation labs already use.
Definition 2 (Depth-constrained quantum-aware key rank). For a depth budget , per-iteration cost and classical per-key cost ,
the classical rank whose optimal-order enumeration costs as many gates as the depth-limited quantum attack on .
is dimensionless, monotone in the rank, and directly comparable with thresholds such as or : a device with is, against a quantum adversary limited to depth , exactly as secure as a device of classical rank against a classical one. Section 5 gives in closed form (Corollary 2). The third quantity is the average-case counterpart.
Definition 3 (Quantum guesswork). .
QG is the expected query cost of Montanaro’s algorithm up to a constant [12] and equals for product priors [14]; it is the quantity whose exponent is super-quadratic relative to the classical guesswork . Proposition 5 in Sect. 4 shows that QR and inherit the bounds of any rank estimator, so an evaluator can report them without new tooling.
With the model and the metrics fixed, Sect. 4 proves that the per-instance speed-up is exactly quadratic and explains why the average-case exponent is larger.
This section proves that the quantum query advantage for a key of given rank is exactly quadratic, restates the average-case result of [14] in our notation, and shows that the two statements are consistent.
The Black-Box Model and Rank Classes
Throughout this section the oracle is the idealized indicator ; by Assumption 2 and the discussion following it, this coincides with the cipher oracle except with negligible probability, and a second plaintext–ciphertext pair makes the two identical at twice the cost. The posteriors , and hence the ordering of by , are fixed and known to the algorithm; only varies.
A statement "for a key of rank " must be read with care: the posteriors determine which key has rank exactly , so an algorithm tailored to a single rank could output that key with one query. The meaningful per-instance notion is therefore the rank class
and we ask for the cost of an algorithm that must work for every key in the class, equivalently for an algorithm that does not know the rank in advance.
Theorem 1 (Per-instance quadratic limit). Fix the posteriors and let .
(a) (Lower bound.) Let be a quantum algorithm with classical access to and query access to that outputs with probability at least for every . Then makes at least queries on some , where ; the same bound holds for the expected number of queries averaged over uniform in . In particular queries are necessary.
(b) (Upper bound.) Block search (Algorithm 1) does not know the rank, outputs with probability at least for every , and makes at most
queries.
Consequently, for every rank class the optimal query count is , and is the per-instance cost of an optimal quantum adversary up to an additive constant.
Algorithm 1 (Block search with unknown rank (after [12, 13], block ratio 2))
Test classically the 7 keys of rank ; if one is , return it.
For :
Let , .
Prepare the uniform superposition over via coherent indexing (Sect. 6).
Run Grover iterations with oracle and measure a candidate .
Test classically; if return it.
End for.
The proof is in Appendix A.§ 1. Three remarks on what the theorem does and does not say.
Remark 1 (Why the constant in (a) is exact). Zalka [18] shows that for any number of queries , Grover’s algorithm on items attains the largest success probability any algorithm can, namely with . Inverting this at gives the constant ; for , , the same constant that appears in the cost model of Sect. 5. The lower bound therefore matches the upper bound of (b) up to the geometric factor incurred by not knowing the rank, which Montanaro [12] shows can be reduced but not removed.
Remark 2 (The advice is used only to order). In (a), all keys in share the same posteriors, so the advice cannot distinguish among them: once the ordering is fixed, the residual problem is unstructured search on items. This is the formal content of the claim that the per-instance advantage is "exactly quadratic": the prior can shrink the search space to the top- keys, but inside the rank class nothing better than Grover is possible.
Remark 3 (Oracle versus gate cost). Theorem 1 counts queries. The coherent indexing in Algorithm 1 is free in the query model but not in gates; its cost is the parameter of Sect. 6.
The average-case cost is a statement about the prior , not about a key. We restate it in our notation; the proof is a direct reading of [35, 12, 14] and is given in Appendix A.2 for completeness.
Proposition 1 (Average-case exponents). Let be a product prior on and for . Then, with -Rényi entropies additive over the product,
The optimal expected quantum query cost with advice is [12]. Hence the exponent ratio , with equality if and only if is uniform.
Corollary 1 (Reconciliation). Proposition 1 and Theorem 1 are consistent. Conditioning on the rank class removes the average over that produces : within each class the exponent is exactly . The super-quadratic average arises because the quantum cost is concave, so that the mass places on small ranks weighs more in than in relative to the mass on large ranks. For the evaluation of a specific device, whose key and rank are fixed, Theorem 1 is the relevant statement; for the security of a key-generation process across a population of devices, Proposition 1 is.
Example 1 (Worked example). Take posteriors with bytes in which each byte has one value of probability and 255 values of probability . Per byte, bits and bits (derived), so and bits for the full key. Classical guesswork is about , quantum guesswork about
, and the average-case exponent ratio is . A device whose key happens to have rank under these posteriors is nevertheless attacked with queries, and one whose key has rank with : the ratio describes the ensemble, not either device.
Proposition 2 (Estimator compatibility). Let a rank estimator return on the weight-discretized problem, and let the discretization distort ranks by at most a factor , i.e. for all . Then
and for every , is non-decreasing in the rank, so
The quantity requires no estimator: with Assumption 1 the exponent in (2) is , computable in time from the posteriors.
The factor depends on the number of bits kept when rounding to integers; Martin et al. [13 Sect. 3] analyze the resulting ordering error; with 2048 bins per byte the histogram bounds measured in Sect. 7 differ by a median of 0.009 bits and by at most 1.6 bits, so for all ranks above . An evaluator who already reports a rank interval can therefore report QR and intervals from the same run.
Theorem 1 fixes the query cost; the next section converts queries into gates under a depth bound, which is where the quadratic advantage acquires an upper limit.
This section derives the gate cost of a depth-limited quantum adversary as a function of the rank, identifies the rank window in which the advantage is quadratic, and gives in closed form.
We follow the parallelization accounting of Jaques et al. (Jaques et al. 2020, Sect. 3.4, Eqs. (5)–(9)), with the search space of size replaced by the rank class of size and with inner parallelization (splitting the block into disjoint parts, each searched by one machine). Let one iteration cost gates and depth , let the target success probability be with (), and let .
Lemma 1 (Two regimes). Under depth budget , the total gate cost of finding a key of rank with success probability is
In Regime B, machines run in parallel. The boundary between the regimes is , and at the boundary both expressions equal .
The proof (Appendix A.3) is the computation of [17] with replaced by ; the loss is Zalka’s [18]. The regime-B cost is linear in : once the depth budget forces parallelization, every doubling of the rank doubles the number of machines and the gate count, exactly as in classical enumeration.
Theorem 2 (Quantum window). Let and define
(i) For the quantum cost is , and if and only if .
(ii) For the quantum cost is , and , a constant independent of .
(iii) The window in which the advantage is quadratic is non-empty if and only if , i.e. , and its width in bits is .
Part (iii) is the statement an evaluator needs: the quadratic regime spans exactly twice as many bits as the logarithm of the constant-factor gain that remains outside it, and both are governed by the single dimensionless ratio . Proof in Appendix A.4.
Corollary 2 (QKR in closed form). With (),
equivalently below and above it. The two branches agree at . The inverse map, which turns a classical threshold into the classical rank a device must have to retain the same security against the depth-limited quantum adversary, is
restricted to the branch in which it lies.
Table 3 evaluates Theorem 2 for the per-iteration costs of Table 2, with (derived from NIST’s , Sect. 3.2) and . The row labelled GLRS16 uses the per-iteration cost implied by Grassl et al.’s circuit as reproduced in [17 Table 10]: and (derived); this is the circuit behind NIST’s /MAXDEPTH figure and therefore the anchor a conservative evaluator would use. All logarithms are base 2 and all entries are derived from the formulas above; the arithmetic is reproduced in Appendix A.6.
| Oracle | for | for | for | for | for | for | ||||
| GLRS16 (via [17] Tab. 10), | 23.80 | 17.56 | 41.37 | 16.9 | 45.6 | 93.6 | 157.6 | 14.3 | 38.3 | 70.3 |
| JNRV20 in-place MC, | 18.76 | 11.46 | 30.22 | 6.8 | 57.8 | 105.8 | 169.8 | 25.5 | 49.5 | 81.5 |
| JNRV20 Maximov MC, | 18.77 | 11.03 | 29.80 | 6.8 | 58.6 | 106.6 | 170.6 | 25.9 | 49.9 | 81.9 |
| HS22 pipeline ( est.) | 18.79 | 11.10 | 29.89 | 6.9 | 58.5 | 106.5 | 170.5 | 25.8 | 49.8 | 81.8 |
| LPZW23 pipeline ( est.) | 18.63 | 10.64 | 29.28 | 6.6 | 59.4 | 107.4 | 171.4 | 26.4 | 50.4 | 82.4 |
| JCGQJW25 pipeline ( est.) | 18.23 | 10.81 | 29.03 | 5.8 | 59.1 | 107.1 | 171.1 | 26.7 | 50.7 | 82.7 |
Table 3. Table 3. Quantum window for AES-128 as a function of the oracle circuit and MAXDEPTH, . The takeaway is that all post-2020 circuits agree on to within 1.6 bits and on to within 1.2 bits at every MAXDEPTH, while the Grassl-era circuit behind NIST’s figure differs by 13 bits; an evaluation rule must therefore name its circuit generation, not its circuit. Entries bits mean the regime boundary lies beyond the full key space.
Three observations follow from the table and will be used in Sect. 8.
The lower boundary is irrelevant in practice. is below even for the deepest circuit, so wherever enumeration is non-trivial a depth-unconstrained quantum adversary pays fewer logical gates than a classical one. (Error-correction overhead, which the model excludes, is what makes the comparison realistic; Sect. 9.)
At MAXDEPTH the upper boundary sits in the range that matters. With every post-2020 oracle the quadratic regime ends between and , with the Grassl-era oracle near . The classical thresholds and of Sect. 1 fall inside or at the edge of this range, so the choice of circuit decides whether a borderline device is attacked in Regime A or B.
At MAXDEPTH the window covers every rank an evaluator will encounter. The boundary exceeds for all modern circuits, so the per-instance cost is simply throughout.
Example 2 (Reading the table as an evaluator). For the JNRV20 Maximov oracle, . A device of classical rank attacked under lies in Regime A, and : the device is as secure as one of classical rank . The same device under the Grassl-era anchor lies in Regime B and has . Either way it is below the threshold. Conversely, to retain the equivalent of classical rank against the adversary with the JNRV20 oracle, Corollary 2 gives (Regime B, since ); for it gives 85.9. Under the corresponding ranks are (Regime A) and (Regime B, since ). Naive "doubling the bits" would have demanded and .
The cost model so far charges every iteration gates and depth whichever quantum strategy is used; the next section examines what the two concrete strategies add to that and which one an adversary should choose.
State Preparation versus Coherent Indexing
This section compares the two ways of injecting the posteriors into a quantum search, proves that block search is never worse in query count up to a constant, and reduces the comparison to the per-iteration overhead against a measurable property of the instance.
Two Strategies
Product-state amplitude amplification (PS-AA).
Under Assumption 1 the prior is a product, so the state
has amplitude on every key. Amplitude amplification [11] with and the cipher oracle finds after iterations if is known, each iteration applying once and the reflection once, i.e. two state preparations per iteration.
Algorithm 1: Grover over rank blocks of geometrically increasing size, each block addressed through a coherent map from indices to keys. Martin et al. [13] realize by weight slices rather than exact rank blocks (the block is and the map is their getKey), which changes constants only. Each iteration applies , and once, and a reflection about the uniform state on the block.
Both strategies call the cipher oracle once per iteration. The difference is the number of iterations— against up to the block-ratio constant—and the per-iteration overhead: two preparations of for PS-AA, two evaluations of for BS. We write , and ; may be smaller or larger than 1.
Block Search Never Loses Asymptotically
Lemma 2 (Rank–probability bound). For every , . In particular , with equality if and only if the most probable keys all have probability exactly and no other key has positive probability.
Proposition 3 (Which strategy wins).
(a) (Per instance.) Up to constants, BS uses at most as many oracle queries as PS-AA on every key, by Lemma 2. With the constants of Theorem 1(b) for BS ( with ratio-2 blocks and unknown rank) and for PS-AA with known , BS is cheaper in gates if and only if
and always. We call the advice sharpness of the instance: it equals 1 when the true key sits on a flat plateau of the prior and grows when the true key is far down a tail dominated by a few heavy candidates.
(b) (Average case.) The expected number of PS-AA iterations over is exactly
whereas BS achieves . Since , PS-AA is exactly quadratic on average relative to classical guesswork , and the entire super-quadratic average-case gain of Proposition 1 is the gain of block ordering over product-state amplification.
Part (b) gives the evaluator a closed form that needs neither enumeration nor estimation: is computed from the posterior table in time and equals of the expected PS-AA iteration count. Proofs in Appendix A.7.
Lemma 3 (Product-state preparation). is prepared from by independent -qubit preparations run in parallel. Each uses controlled single-qubit rotations arranged as a binary tree of depth with rotations at level , i.e. 255 rotations per byte for [41]; no QRAM is needed. If a rotation to precision costs gates and depth , then one preparation costs gates and, with the rotations of a level applied as multiplexed rotations, depth .
For , and the ancilla-free Clifford+ synthesis cost gates per -rotation [42], precision gives about 4080 rotations and roughly gates per preparation (derived), i.e. about gates per PS-AA iteration—four to five times the 54 908 gates of the AES-128 oracle itself [17], Table 8. PS-AA is therefore QRAM-free but not cheap: with comparable to or larger than in -count. Lower precision is admissible because the posteriors are themselves noisy; the required as a function of the leakage SNR is left open.
Lemma 4 (Coherent indexing, symbolic). The map of [13] evaluates getKey on a superposition of indices in classical operations per call, reading the path-counting array of integers; realized coherently this costs gates and depth, with dominated by comparisons of -bit integers against held in QRAM or in a hard-wired circuit.
We leave and symbolic here; their gate-level values for , are the subject of the companion paper [22]. What this paper establishes is the decision rule: BS should be used whenever , PS-AA otherwise, and Sect. 7 measures the distribution of on simulated posteriors (median 2.15 bits) so that the rule can be applied once is known.
Remark 4 (Hybrid). The two strategies compose: inside a weight slice one may start from the product state restricted to the slice rather than the uniform state. This keeps the scaling of BS while recovering part of the PS-AA gain on plateaus; we do not analyze it further.
With the theory complete, Sect. 7 measures the quantities the theory leaves to data: the rank-versus-traces relation, the trace discount, and the distribution of the advice sharpness .
Experiments
This section measures the quantities the theory leaves to data: how the rank falls with the number of traces, how many traces a quantum budget is worth, how sharp real posteriors are, and how the four search strategies behave on a toy cipher.
We simulate an unprotected first-round AES-128 S-box leakage for trace and byte , with uniform plaintext bytes and , i.e. SNR . Two attacks are run per byte. The CPA attack [23] uses the Hamming-weight model; since the leakage is Gaussian with known , we map scores to posteriors by the exact likelihood , where is the squared error of hypothesis over the traces; this is the Bayesian posterior under a uniform key prior and is monotone in the Pearson correlation. The Gaussian template attack [24] builds one template per S-box output value from 20 000 profiling traces on an independent key and returns likelihoods directly. The full-key rank is computed by histogram convolution [5, 3] with 2048 bins per byte; we record the lower and upper bounds and use their midpoint. Each (attack, , ) cell holds 100 random keys with derived seeds (Appendix B); ranges over and, for , a denser grid of 18 values up to 240.
A 4-round substitution–permutation network with the PRESENT S-box on four nibbles, a PRESENT-style bit permutation, a 16-bit key with round keys obtained by rotation (, ). Leakage (, ) and CPA posteriors are generated as above. The quantum runs use a phase-flip oracle on the known key so that success probabilities are computed exactly on a -dimensional state vector; the full reversible cipher oracle is synthesized separately in Qiskit and only counted. The separation follows standard practice for Grover resource estimation [17].
(U) Grover from the uniform state over all keys; (PS) amplitude amplification from with the iteration count set by the true ; (BS) block search, Algorithm 1, with exact rank blocks (indexing is free on a simulator); (CL) classical optimal-order enumeration, success probability after tests. For each of 120 random keys we record the number of oracle calls at which each strategy first reaches success probability .
Rank versus Traces and the Linear Model
Figure 1 shows the median and interquartile range of and the per-instance quantum counterpart for . The decay is close to linear in in the middle of the range and flattens at both ends: near 128 bits because the rank is capped, and below about 20 bits because the few remaining wrong candidates are the ones hardest to separate. We therefore state the model on the mid-range only.
Assumption 3 (Linear log-rank decay). For fixed SNR and in the range where , the median is approximately affine in : with depending on the SNR.

Figure 1.
Key rank versus traces for CPA at (), 100 keys per point. The takeaway is that halves the vertical axis and nothing else; the linear model holds between 20 and 110 bits and flattens outside.
The decay rate per trace is proportional to the SNR, – bits per trace for sixteen bytes (Table 4), which is the expected behavior of a Gaussian likelihood accumulating bits of evidence per trace. The discretization factor of Proposition 2 is small: the histogram bounds differ by a median of 0.009 bits and by at most 1.6 bits, the latter only at ranks below .
| attack | SNR | (bits) | (bits/trace) | /SNR | (points) | |
| CPA | 2 | 0.5 | 120.4 | 4.09 | 8.2 | 1.000 (3) |
| CPA | 4 | 0.125 | 118.3 | 1.10 | 8.8 | 0.995 (7) |
| CPA | 8 | 0.031 | 114.7 | 0.263 | 8.4 | 0.999 (3) |
| template | 2 | 0.5 | 120.9 | 4.11 | 8.2 | 1.000 (3) |
| template | 4 | 0.125 | 118.1 | 1.09 | 8.7 | 0.996 (7) |
| template | 8 | 0.031 | 116.9 | 0.259 | 8.3 | 1.000 (3) |
Table 4. Fitted parameters of Assumption 3 on the median over cells with bits. The takeaway is that the decay rate scales as bits per trace across a range of SNR, and that CPA and templates agree to within 3%.
Let the attacker’s gate budget be . Define and , and the trace discount : the number of traces the classical attacker must collect beyond what the quantum attacker needs to reach the same budget.
Proposition 4 (Trace discount under the linear model). Under Assumption 3 with parameters , and writing ,
where . In Regime A the discount grows by traces per doubling of the budget; in Regime B it is a constant equal to bits’ worth of traces.
Proof. The classical attacker needs ; by Corollary 2 the quantum attacker needs in Regime A and in Regime B. Invert and subtract. The boundary is at , Lemma 1.
Figure 2 plots the discount measured on the median rank curve for CPA at SNR = 0.125 against the prediction of Proposition 4 with the fitted and the JNRV20 Maximov oracle, for which at and at (derived). Three features of the data are the ones the theory predicts. First, for the measured discount rises to 27 traces at and then stays between 20 and 22 traces for ; the predicted plateau is traces. Second, for the discount keeps growing until , where it reaches 39–42 traces, and the predicted knee is at with plateau 45.4. Third, the two depth budgets coincide below , where neither attack is depth-limited. The prediction overestimates the Regime-A slope below by up to six traces, because there the quantum attacker needs ranks below 20 bits, outside the range of Assumption 3; and above every discount falls to zero because the classical attacker already needs fewer than 20 traces, a cap the linear model does not contain. Within the window the measured and predicted discounts agree to within 10%.

Figure 2. Trace discount versus gate budget, CPA at SNR = 0.125, JNRV20 Maximov oracle, . The takeaway is the plateau for from onward at 21–22 traces against a predicted 23.5: beyond a larger budget buys the depth-limited quantum attacker no further traces, while the attacker keeps gaining until its own knee near .
Advice Sharpness on Simulated Posteriors
For each key we record and and their ratio , the advice sharpness of Proposition 3. Figure 3 is the scatter and Table 5 gives quantiles of over the cells whose median rank lies between and , the range an evaluator cares about. The sharpness is remarkably stable: across both attacks, four SNRs and all trace counts, its median is 2.1–2.3 bits, its 90th percentile 2.5–3.3 bits, its 99th percentile below 5.3 bits, and its maximum over 4 000 instances 6.0 bits. In words: on Hamming-weight posteriors the true key’s probability is typically times smaller than , and never more than times smaller.
| SNR | median | median | 90% | 99% | |
| 2 | 5 | 62.7 | 1.96 | 2.49 | 4.14 |
| 0.5 | 10 | 79.1 | 2.14 | 2.72 | 3.32 |
| 0.5 | 20 | 38.8 | 2.11 | 2.97 | 4.12 |
| 0.125 | 20 | 98.2 | 2.06 | 2.86 | 3.78 |
| 0.125 | 40 | 73.7 | 2.26 | 2.97 | 4.90 |
| 0.125 | 80 | 32.2 | 2.09 | 2.52 | 3.01 |
| 0.031 | 80 | 94.3 | 2.08 | 3.10 | 4.20 |
| 0.031 | 160 | 71.5 | 2.23 | 2.92 | 3.70 |
| 0.031 | 320 | 30.7 | 2.17 | 3.11 | 4.88 |
| all cells | 2.15 | 2.96 | 4.25 |
Table 5.
Figure 3. Quantiles of over 100 keys per cell, CPA (template values agree within 0.1 bit). The takeaway is that the sharpness is almost independent of SNR and trace count: block search can afford about of indexing overhead on the median device and on nine devices in ten before product-state amplification becomes cheaper.
Figure 3 (PDF p. 16).
Table 6. Per-key query cost of block search () against product-state amplification () on CPA posteriors. Every point lies above the diagonal by Lemma 2; the vertical distance is , concentrated between 2 and 3 bits at every rank.
| quantity | median | IQR / range | note |
| rank | 74 | 19–314 | max 11 691 |
| (bits) | 1.35 | 90%: 1.92 | max 3.77 |
| U: calls to 3/4 | 134 | 134–134 | , independent of posteriors |
| PS: calls to 3/4, / | 1.31 | — | predicted at median |
| BS: calls to 3/4, / | 2.63 | — | bound 2.69; satisfied on 120/120 keys |
| CL: calls to 3/4 | 37 | — | ; 24 keys need > 300 |
| BS PS | 15/120 | 11/22 among keys with | |
| PS peak success | 1.00 | on 119/120 | min 0.43 (overshoot at ) |
Table 6.
The constants of Proposition 3 now have values. With ratio-2 blocks and unknown rank, block search needs up to calls (Theorem 1(b)); product-state amplification with known needs calls to reach success near 1 and to reach 3/4. Block search is therefore cheaper in queries iff bits (target probability 1) or bits (target 3/4). Against Table 5, block search wins on about 65% of AES instances at the first threshold and about 40% at the second, before any indexing overhead is charged; every bit of moves the threshold up by one bit and removes a further quarter to a third of the instances. The two strategies are thus within a factor 2–4 of each other on realistic posteriors, and the gate-level value of , not the query count, decides between them.
Quantum Simulation on the Toy Cipher
Figure 4 shows one representative key (rank 329, ); Table 6 summarizes all 120 keys. The observations are the ones the theory predicts, including the one the previous paragraph warns about.

Figure 4.
Three points deserve comment. First, the uniform strategy reaches 3/4 at 134 calls on every key, as it must, which on the toy is more than classical enumeration needs for 63 of the 120 keys: a 16-bit key space is too small for Grover to help, and the posteriors are what make the quantum attack worthwhile. Second, block search obeys the bound of Theorem 1(b) on every key with median constant 2.63, within 2% of the worst-case 2.69; the block structure makes its success curve a staircase, flat until the block holding the key is reached. Third, product-state amplification is cheaper than block search on 105 of 120 keys. This does not contradict Lemma 2, which bounds below by without constants: on the toy the median sharpness is 1.35 bits, below the 1.77-bit threshold derived above, so the constant-factor penalty of block search for not knowing the rank outweighs the sharpness gain. Among the 22 keys with sharpness above 1.77 bits, block search wins on half. On AES posteriors (Table 5), whose sharpness is a bit higher, the balance tips the other way, but only by a factor of about two.
The full reversible oracle for the toy cipher, synthesized in Qiskit with out-of-place lookup-table S-boxes (one 4-controlled per set output bit, 32 per S-box), a 16-controlled comparison, and full uncomputation, has width 97 qubits, 59 137 Clifford+ gates (21 454 CNOT, 26 502 ), and full depth 47 779 after transpilation with no ancilla-assisted multi-controlled gates (measured; a naive design, reported only to place the toy in the cost model). Its own quantum window has for , far beyond a 16-bit key: every search on the toy is in Regime A, as the simulation assumes.
The experiments quantify what the theory parameterizes; Sect. 8 turns both into a rule an evaluation laboratory can apply.
Figure 4. Toy cipher, 120 keys, , : oracle calls to first reach success probability , normalized by where meaningful. The takeaway is that block search tracks its bound and never exceeds it, while product-state amplification is cheaper here because the toy posteriors are flatter (median sharpness 1.35 bits) than the AES ones.
Table 7. Success probability versus oracle calls on the 16-bit toy cipher for a key of rank 329 and . The takeaway is the ordering PS < BS < U in calls on this flat-posterior instance, with PS oscillating after its peak at calls and BS rising in one step when its block of ranks is searched.
| threshold | |||
| 73.9 (B) [73.8–74.7] | 89.2 (A) [89.1–90.2] | 89.2 (A) [89.1–90.2] | |
| 85.9 (B) [85.8–86.7] | 109.9 (B) [109.8–110.7] | 113.2 (A) [113.1–114.2] | |
| 105.9 (B) [105.8–106.7] | 129.9 (B) [129.8–130.7] | 153.2 (A) [153.1–154.2] |
Table 7.
Implications for Evaluation Practice
This section states the evaluation rule the preceding results support and maps it onto the frameworks evaluation laboratories currently use.
An evaluator who today reports a classical rank interval and compares it with a threshold should additionally report, for each and for a named oracle circuit, the interval of Corollary 2 and compare it with the same . Equivalently, the classical rank a device must have to retain the equivalent of against the depth- quantum adversary is the inverse map of Corollary 2; Table 7 evaluates it for the thresholds in current use. Because every post-2020 AES-128 circuit in Table 3 gives a window boundary within one bit of at and a constant gain within one bit of , the rule is insensitive to the choice among modern circuits; only the Grassl-era anchor behind NIST’s figure differs, by 13 bits.
Classical rank (bits) required to retain the equivalent of a classical threshold against a depth-limited quantum adversary, , derived from Corollary 2; regime in parentheses. Rows give the JNRV20 Maximov oracle and, in brackets, the range over the four post-2020 circuits of Table 3. The takeaway is that the required margin is 2 × the threshold minus 6.8 bits inside the window and bits above it, never the 2 × of the naive rule.
The last row answers the remark that a cut-off "reduces to " under Grover [7]: with a depth budget of it does not, because the attack is in Regime B and the quantum adversary pays classical-equivalent gates, not ; without a depth budget () it reduces to classical-equivalent gates, which is the naive figure plus the 3.4-bit oracle overhead. Both statements are reached from one formula. In traces, Figure 2 says the same thing: at SNR = 0.125 a depth- quantum adversary is worth at most 22 extra traces to a classical one, however large its gate budget.
The JIL rating for smartcards [8] scores an attack by elapsed time, expertise, knowledge of the target, access, equipment and open samples, and it defers the "remaining strength of cryptographic implementations" to a chapter still under discussion. A quantum-aware extension needs only two additions: (i) an equipment class for a fault-tolerant quantum computer parameterized by its depth budget, and (ii) the instruction to score the exploitation phase by rather than by the classical rank. Everything else in the rating is unchanged, because the identification phase (trace collection, CPA) is classical in the Q1 model.
ISO/IEC 17825:2024 [9] is a conformance test with a low-to-medium assurance level and no adversary model beyond first-order leakage detection; it has no place for a rank threshold and therefore none for a quantum one. The appropriate home for the rule above is a laboratory’s evaluation methodology, not the conformance test; we do not propose amending 17825 itself.
The rule charges logical gates and ignores quantum error-correction overhead, which multiplies the quantum cost by a factor that depends on the code and the target error rate and that favors the classical adversary. It assumes the independence of Assumption 1 and the oracle costs of a named circuit. Its purpose is to replace a wrong rule of thumb with a right formula, not to predict the year in which the attack becomes practical.
With the practical consequence stated, we close with what the analysis leaves open.
Limitations and Future Work
Six limitations are specific enough to be worth naming.
Coherent indexing and constants. Block search needs realized coherently, either with QRAM holding the path-counting array or with a hard-wired circuit; we carry its cost as the symbolic and state the decision rule, but the gate-level value of for , is left to the companion paper [22]. Section 7.4 shows that the decision is close even at : the sharpness of Hamming-weight posteriors is 2–3 bits and the block-search constant for unknown rank costs 1.8 bits of it, so a of 2–4 makes product-state amplification the practical strategy on most devices, and then its exactly quadratic average-case behavior (Proposition 3(b)) is the relevant one.
Error correction. The cost model counts logical gates and depth. Surface-code overheads for the -heavy AES oracle are large and shift upward by their logarithm; they do not change , which depends only on depth, nor the structure of the two regimes.
Independence and leakage model. Masked implementations, and template attacks that exploit key-schedule or MixColumns relations, produce posteriors that are not products; Lemma 2 and Theorem 1 do not need independence, but the product-state preparation of Lemma 3 and the entropy identities do. Our experiments use simulated Hamming-weight leakage with Gaussian noise; the sharpness values of Table 5 are a property of that leakage model and should be re-measured on profiled posteriors from a real device (ASCAD [43] is the natural candidate) before being used as constants.
Oracle uniqueness. Assumption 2 with one plaintext–ciphertext pair fails with probability about ; a second pair doubles and and shifts every window boundary by one bit.
Published circuits. Table 3 takes from the full Grover oracle of [17] and, for the three later circuits, from the encryption circuits as tabulated in [21], with one-qubit Clifford and measurement counts estimated by the JNRV20 ratio; the resulting values are marked as estimates and affect and by less than one bit. A lower moves up by of the improvement.
Other ciphers. The analysis is parameterized by and applies to any block cipher for which these are known; quantum circuits and the corresponding window for the Ukrainian standard Kalyna (DSTU 7624:2014), whose modular key addition and four distinct S-boxes make its oracle cost unlike AES’s, are the subject of the companion paper.
Beyond these, the questions we consider most worth pursuing are a tighter constant for block search with unknown rank (Montanaro’s blocks with optimized , which the 1.77-bit threshold makes directly valuable), a quantum rank estimator based on amplitude estimation over weight slices, and the hybrid of Remark 4.
Conclusion
For a device whose key has residual rank after a side-channel attack, the best quantum adversary with classical access to the posteriors needs cipher evaluations, no fewer; the super-quadratic exponents reported for search with advice are averages over the prior and do not apply to any single device. Under a depth budget , the quadratic advantage holds only for ranks up to and collapses to a constant factor beyond, so that with every post-2020 AES-128 oracle and the window closes within a bit of rank and the residual gain is within a bit of ; in traces, at SNR = 0.125, that gain is worth about 22 traces and no more. The quantum-aware key rank packages this into the unit evaluation laboratories already use and is computable from the rank estimators they already run. On Hamming-weight posteriors the two ways of exploiting the advice, block search and product-state amplification, are within a factor of two to four of each other, so the cost of coherent indexing, not the query count, will decide which one a real adversary runs.
Appendix
Proofs
Proof of Theorem 1
(a) Lower bound.
Fix the posteriors; the ordering of and the class are then fixed and known to . Let . Consider the family of oracles . For in these are distinct indicator functions on differing in exactly two positions, both inside . Any algorithm that, for every , outputs with probability when run with , solves unstructured search with a unique marked element among candidates: compose with the fixed injection and note that queries outside return the same answer for every member of the family, so they can be answered without the oracle. Zalka’s theorem [18 Sect. 3] states that after queries no quantum algorithm attains success probability exceeding with , uniformly over the marked element; the same bound holds for the success probability averaged over a uniformly random marked element [18, 31]. Requiring gives . For an algorithm with a random number of queries, apply the bound to the algorithm truncated at its expected query count times a constant and use Markov’s inequality, losing a constant factor. □
(b) Upper bound.
Let and , so (or among the first seven keys if ). For the block contains no marked key; Grover’s algorithm then rotates nothing, the measured candidate is a uniformly random element of , and the classical test rejects it. For the block has elements and exactly one marked, and iterations succeed with probability [29]. Summing the query counts for ,
plus one classical test per block and seven initial tests, which is the term. If the Grover run on fails, the algorithm continues to larger blocks and never finds ; the failure probability is at most for , so success is at least . The algorithm never uses . □
Proof of Proposition 1
Arıkan [35], Theorem 1 proves, for any guessing strategy on a random variable with distribution over a finite set of size and any ,
and that the optimal (decreasing-probability) strategy attains . Since with , this reads . Taking gives (1) with ; taking gives (2) with ; for a product distribution and , and Rényi entropy is additive over products, . Montanaro [12], Theorem 1 shows that the expected number of queries of search with advice is and that this is optimal up to a constant. Bashiri et al. [14] draw the same conclusion for the i.i.d. case; the statement above is the non-identical product case, which Arıkan’s bound covers verbatim. The inequality is monotonicity of Rényi entropy in its order, with equality iff is uniform on its support. □
Proof of Lemma 1
If , a single machine runs all iterations within the budget; the cost is . Otherwise, with inner parallelization over machines each holding a part of size of the block, each machine needs iterations of depth ; the constraint gives (Eq. (8)), and the total gate count is (Eq. (9)). The regime boundary is , i.e. , and substituting it into either branch yields . That inner parallelization is the right choice and that the loss cannot be avoided is [17], Sect. 2.3 and [18]. □
Proof of Theorem 2
(i) In Regime A, iff iff . (ii) In Regime B, . (iii) iff iff iff , and . □
Proof of Corollary 2
Divide Lemma 1 by and substitute . Continuity at : . The inverse map solves each branch for and keeps the solution consistent with its branch. □
Arithmetic behind Table 3
With and : ; ; , where . For JNRV20 Maximov MC: , , ; hence , , . For JNRV20 in-place MC: , , . For GLRS16: , , , where , , . For LPZW23 only enters : or . Sanity check: with the JNRV20 Maximov values equals , matching [17 Table 12].
Proofs for Section 6
Lemma 2.
The keys ranked above each have probability (ties are broken by a fixed order, so a tied key ranked above has probability exactly ). Hence . Equality forces every key of rank to have probability and all others probability 0. ▫
Proposition 3(a).
PS-AA needs iterations when is known and at most a constant factor more otherwise (fixed-point search [30] or exponential search over the iteration count [29]); BS needs at most iterations by Theorem 1(b). Lemma 2 gives . In gates, BS costs at most with and PS-AA costs ; the former is smaller iff , and . ▫
Proposition 3(b).
. By definition , so the sum is ; under Assumption 1, . The BS bound is (2), and by monotonicity. ▫
Lemma 3.
Grover and Rudolph [41]: to prepare on qubits, at level () apply to qubit , controlled on the first qubits, the rotation by for each prefix ; that is controlled rotations at level and in total. The registers are disjoint, so the preparations run in parallel. The rotations of one level act on the same target qubit and are therefore sequential as a multiplexed rotation of length , giving depth ; -count follows from per rotation. ▫
Proposition 2.
Monotonicity of and of (both branches of Lemma 1 are increasing and agree at the boundary) transfers the interval for to intervals for QR and QKR. The computation of is immediate from Assumption 1. ▫
Reproducibility
Code.
Supplied with the arXiv submission as code/ (MIT license); a public repository link will be added in v2.
Directory layout: leakage/sim_rank.py (simulation, CPA, templates, histogram rank), leakage/analyze.py (fits, discount, sharpness, figure data), quantum/toy_sim.py (exact state-vector runs of U, PS, BS, CL), quantum/toy_oracle.py (Qiskit synthesis and gate count of the toy oracle), window/tables.py with circuits.csv (regenerates Tables 3 and 7), figures/ (pgfplots data files).
Software versions.
Python 3.13, NumPy 2.5.3, SciPy 1.18.1, Qiskit 2.5.2 (transpiler only; state vectors are NumPy). No external side-channel library is used.
Seeds and sizes.
Master seed 20261014; the key, plaintexts and noise of cell are drawn from default_rng([20261014, i, j, k]), templates from [20261014, i, 7], toy keys from [20261014, 99]. per cell for AES (9 000 instances per attack), 120 keys for the toy cipher; ; plus for ; 2048 histogram bins per byte; 20 000 profiling traces.
Regenerating the tables.
python window/tables.py –inputs circuits.csv –ccl 15 prints Table 3 and Table 7; the shipped circuits.csv contains the rows of Table 2 with their sources.
References
- [1]Veyrat-Charvillon, N., Gérard, B., Renaud, M., & Standaert, F.-X. (2013). An optimal key enumeration algorithm and its application to side-channel attacks. In Selected Areas in Cryptography – SAC 2012 (LNCS 7707, pp. 390–406). Springer. https://doi.org/10.1007/978-3-642-35999-6_25
- [2]Martin, D. P., O'Connell, J. F., Oswald, E., & Stam, M. (2015). Counting keys in parallel after a side channel attack. In Advances in Cryptology – ASIACRYPT 2015 (LNCS 9453, pp. 313–337). Springer. https://doi.org/10.1007/978-3-662-48800-3_13
- [3]Poussier, R., Standaert, F.-X., & Grosso, V. (2016). Simple key enumeration (and rank estimation) using histograms: An integrated approach. In Cryptographic Hardware and Embedded Systems – CHES 2016 (LNCS 9813, pp. 61–81). Springer. https://doi.org/10.1007/978-3-662-53140-2_4
- [4]Veyrat-Charvillon, N., Gérard, B., & Standaert, F.-X. (2013). Security evaluations beyond computing power. In Advances in Cryptology – EUROCRYPT 2013 (LNCS 7881, pp. 126–141). Springer. https://doi.org/10.1007/978-3-642-38348-9_8
- [5]Glowacz, C., Grosso, V., Poussier, R., Schüth, J., & Standaert, F.-X. (2015). Simpler and more efficient rank estimation for side-channel security assessment. In Fast Software Encryption – FSE 2015 (LNCS 9054, pp. 117–129). Springer. https://doi.org/10.1007/978-3-662-48116-5_6
- [6]David, L., & Wool, A. (2019). Poly-logarithmic side channel rank estimation via exponential sampling. In Topics in Cryptology – CT-RSA 2019 (LNCS 11405, pp. 330–349). Springer. https://doi.org/10.1007/978-3-030-12612-4_17
- [7]Oswald, E. (2021). Side channels: What are they, what can they do, and how should we respond? Presentation slides. NIST Crypto Reading Club. https://csrc.nist.gov/csrc/media/Presentations/2021/crypto-club-2021-side-channels-2/images-media/crclub-2021-side-channels-2.pdf
- [8]Joint Interpretation Library. (2024). Application of attack potential to smartcards and similar devices (Version 3.2.1). Common Criteria Portal.
- [9]ISO/IEC. (2024). ISO/IEC 17825:2024 — Testing methods for the mitigation of non-invasive attack classes against cryptographic modules (2nd ed.).
- [10]Grover, L. K. (1996). A fast quantum mechanical algorithm for database search. In Proceedings of the 28th Annual ACM Symposium on Theory of Computing (STOC '96) (pp. 212–219). ACM. https://doi.org/10.1145/237814.237866
- [11]Brassard, G., Høyer, P., Mosca, M., & Tapp, A. (2002). Quantum amplitude amplification and estimation. In Quantum Computation and Information (Contemporary Mathematics, Vol. 305, pp. 53–74). American Mathematical Society. https://doi.org/10.1090/conm/305/05215
- [12]Montanaro, A. (2011). Quantum search with advice. In Theory of Quantum Computation, Communication, and Cryptography – TQC 2010 (LNCS 6519, pp. 77–93). Springer. https://doi.org/10.1007/978-3-642-18703-6_7
- [13]Martin, D. P., Montanaro, A., Oswald, E., & Shepherd, D. (2018). Quantum key search with side channel advice. In Selected Areas in Cryptography – SAC 2017 (LNCS 10719, pp. 407–422). Springer. https://doi.org/10.1007/978-3-319-72565-9_21
- [14]Bashiri, T., Glaser, T., May, A., & Nowakowski, J. (2026). Super-quadratic quantum speed-ups and guessing many likely keys. In Advances in Cryptology – EUROCRYPT 2026 (LNCS 16541, pp. 457–480). Springer. https://doi.org/10.1007/978-3-032-25291-3_16
- [15]Schubert, M., Paskarbeit, J., Kramer, J., Seifert, J.-P., & Margraf, M. (2026). Certified quantum speed-up exponents for guessing with side information (arXiv:2609.28226). arXiv. https://doi.org/10.48550/arXiv.2609.28226
- [16]National Institute of Standards and Technology. (2016). Submission requirements and evaluation criteria for the post-quantum cryptography standardization process. NIST.
- [17]Jaques, S., Naehrig, M., Roetteler, M., & Virdi, S. F. (2020). Implementing Grover oracles for quantum key search on AES and LowMC. In Advances in Cryptology – EUROCRYPT 2020 (LNCS 12106, pp. 280–310). Springer. https://doi.org/10.1007/978-3-030-45724-2_10
- [18]Zalka, C. (1999). Grover's quantum searching algorithm is optimal. Physical Review A, 60(4), 2746–2751. https://doi.org/10.1103/PhysRevA.60.2746
- [19]Huang, Z., & Sun, S. (2022). Synthesizing quantum circuits of AES with lower T-depth and less qubits. In Advances in Cryptology – ASIACRYPT 2022 (LNCS 13793, pp. 614–644). Springer. https://doi.org/10.1007/978-3-031-22969-5_21
- [20]Liu, Q., Preneel, B., Zhao, Z., & Wang, M. (2023). Improved quantum circuits for AES: Reducing the depth and the number of qubits. In Advances in Cryptology – ASIACRYPT 2023 (LNCS 14440). Springer. https://doi.org/10.1007/978-981-99-8727-6_3
- [21]Jiang, L.-L., Cai, B.-B., Gao, F., Qin, S.-J., Jin, Z.-P., & Wen, Q.-Y. (2025). Constructing resource-efficient quantum circuits for AES. Frontiers in Physics, 13, 1582819. https://doi.org/10.3389/fphy.2025.1582819
- [22]Kotukh, Y. (2026). Quantum resource estimates for Kalyna (DSTU 7624:2014) and the cost of side-channel-assisted key search under depth constraints [Manuscript in preparation].
- [23]Brier, E., Clavier, C., & Olivier, F. (2004). Correlation power analysis with a leakage model. In Cryptographic Hardware and Embedded Systems – CHES 2004 (LNCS 3156, pp. 16–29). Springer. https://doi.org/10.1007/978-3-540-28632-5_2
- [24]Chari, S., Rao, J. R., & Rohatgi, P. (2003). Template attacks. In Cryptographic Hardware and Embedded Systems – CHES 2002 (LNCS 2523, pp. 13–28). Springer. https://doi.org/10.1007/3-540-36400-5_3
- [25]David, L., & Wool, A. (2017). A bounded-space near-optimal key enumeration algorithm for multi-subkey side-channel attacks. In Topics in Cryptology – CT-RSA 2017 (LNCS 10159, pp. 311–327). Springer. https://doi.org/10.1007/978-3-319-52153-4_18
- [26]Martin, D. P., Mather, L., & Oswald, E. (2018). Two sides of the same coin: Counting and enumerating keys post side-channel attacks revisited. In Topics in Cryptology – CT-RSA 2018 (LNCS 10808, pp. 394–412). Springer. https://doi.org/10.1007/978-3-319-76953-0_21
- [27]Bogdanov, A., Kizhvatov, I., Manzoor, K., Tischhauser, E., & Witteman, M. (2016). Fast and memory-efficient key recovery in side-channel attacks. In Selected Areas in Cryptography – SAC 2015 (LNCS 9566, pp. 310–327). Springer. https://doi.org/10.1007/978-3-319-31301-6_19
- [28]Villanueva-Polanco, R. (2019). A comprehensive study of the key enumeration problem. Entropy, 21(10), 972. https://doi.org/10.3390/e21100972
- [29]Boyer, M., Brassard, G., Høyer, P., & Tapp, A. (1998). Tight bounds on quantum searching. Fortschritte der Physik, 46(4–5), 493–505. https://doi.org/10.1002/(SICI)1521-3978(199806)46:4/5<493::AID-PROP493>3.0.CO;2-P
- [30]Yoder, T. J., Low, G. H., & Chuang, I. L. (2014). Fixed-point quantum search with an optimal number of queries. Physical Review Letters, 113(21), 210501. https://doi.org/10.1103/PhysRevLett.113.210501
- [31]Bennett, C. H., Bernstein, E., Brassard, G., & Vazirani, U. (1997). Strengths and weaknesses of quantum computing. SIAM Journal on Computing, 26(5), 1510–1523. https://doi.org/10.1137/S0097539796300933
- [32]Banegas, G., & Villanueva-Polanco, R. (2023). On searching for keys in quantum cold boot attacks. Cryptography and Communications, 15, 495–523. https://doi.org/10.1007/s12095-022-00625-z
- [33]Albrecht, M. R., & Shen, Y. (2022). Quantum augmented dual attack (Cryptology ePrint Archive, Report 2022/656). IACR.arxiv.org/abs/2205.13983
- [34]Høyer, P., Mosca, M., & de Wolf, R. (2003). Quantum search on bounded-error inputs. In Automata, Languages and Programming – ICALP 2003 (LNCS 2719, pp. 291–299). Springer. https://doi.org/10.1007/3-540-45061-0_25
- [35]Arıkan, E. (1996). An inequality on guessing and its application to sequential decoding. IEEE Transactions on Information Theory, 42(1), 99–105. https://doi.org/10.1109/18.481781
- [36]Zou, J., Wei, Z., Sun, S., Liu, X., & Wu, W. (2020). Quantum circuit implementations of AES with fewer qubits. In Advances in Cryptology – ASIACRYPT 2020 (LNCS 12492, pp. 697–726). Springer. https://doi.org/10.1007/978-3-030-64834-3_24
- [37]Jang, K., Baksi, A., Kim, H., Song, G., Seo, H., & Chattopadhyay, A. (2025). Quantum analysis of AES. IACR Communications in Cryptology, 2(1). https://doi.org/10.62056/ay1lzo-3y
- [38]Grassl, M., Langenberg, B., Roetteler, M., & Rötteler, M. (2016). Applying Grover's algorithm to AES: Quantum resource estimates. In Post-Quantum Cryptography – PQCrypto 2016 (LNCS 9606, pp. 29–43). Springer. https://doi.org/10.1007/978-3-319-29360-8_3
- [39]Bonnetain, X., Naya-Plasencia, M., & Schrottenloher, A. (2019). Quantum security analysis of AES. IACR Transactions on Symmetric Cryptology, 2019(2), 55–93. https://doi.org/10.13154/tosc.v2019.i2.55-93
- [40]Kaplan, M., Leurent, G., Leverrier, A., & Naya-Plasencia, M. (2016). Breaking symmetric cryptosystems using quantum period finding. In Advances in Cryptology – CRYPTO 2016 (LNCS 9815, pp. 207–237). Springer. https://doi.org/10.1007/978-3-662-53008-5_8
- [41]Grover, L., & Rudolph, T. (2002). Creating superpositions that correspond to efficiently integrable probability distributions (arXiv:quant-ph/0208112). arXiv. https://doi.org/10.48550/arXiv.quant-ph/0208112
- [42]Ross, N. J., & Selinger, P. (2016). Optimal ancilla-free Clifford+T approximation of z-rotations. Quantum Information and Computation, 16(11–12), 901–953. https://doi.org/10.26421/QIC16.11-12-1
- [43]Benadjila, R., Prouff, E., Strullu, R., Cagli, E., & Dumas, C. (2020). Deep learning for side-channel analysis and introduction to ASCAD database. Journal of Cryptographic Engineering, 10(2), 163–188. https://doi.org/10.1007/s13389-019-00220-8
