---
title: Shor's Quantum ECDLP Algorithm
url: https://www.emergentmind.com/topics/shor-s-quantum-ecdlp-algorithm
type: topic
---

# Shor's Quantum ECDLP Algorithm

Shor's Quantum ECDLP Algorithm is the category of quantum algorithms solving the elliptic curve discrete logarithm problem (ECDLP) in polynomial time, rendering classical elliptic curve cryptosystems (ECC) theoretically insecure in the presence of large-scale quantum computers. The core quantum algorithm, originally introduced by Peter Shor, adapts hidden subgroup problem techniques from finite fields to the more complex structure of elliptic curve groups over finite fields. Recent research emphasizes space- and gate-efficient circuit designs—especially modular inversion—and precise resource estimation for practical quantum attacks.

## 1. Mathematical Structure and Quantum Period-Finding

At its foundation, the ECDLP asks: given an elliptic curve $E/\mathbb{F}_p$ of large prime order $r$, a generator $P\in E(\mathbb{F}_p)$, and a target point $Q = [m]P$, recover $m$. Shor’s quantum approach reframes this as a hidden subgroup problem (HSP) in the abelian group $\mathbb{Z}_r \times \mathbb{Z}_r$ via the function 
$$
f(k, \ell) = [k]P + [\ell]Q
$$
which is constant on cosets of the hidden subgroup $H = \{(k,\ell) : k+\ell m \equiv 0 \bmod r\}$. The quantum circuit proceeds as follows:
- Prepare two $(n+1)$-qubit exponent registers in the superposition $\sum_{k,\ell=0}^{2^{n+1}-1} |k, \ell\rangle$ and an accumulator register initialized to the group identity.
- Cohesively compute $|k, \ell\rangle|\mathcal{O}\rangle \to |k, \ell\rangle |[k]P + [\ell]Q\rangle$ via a sequence of controlled point additions and doublings in $E(\mathbb{F}_p)$.
- Apply (semi-)classical or full quantum Fourier transforms (QFTs) to the exponent registers.
- Measure the outputs and post-process (e.g., via continued fractions) to recover $m$ [2604.02311, 1706.06752, 2502.12441].

## 2. Quantum Circuit Architecture: Arithmetic and Group Action

The computational bottleneck is implementing the group-action oracle $\ket{k,\ell}\ket{A} \mapsto \ket{k,\ell}\ket{A+[k]P+[ℓ]Q}$ efficiently and reversibly. Each double-scalar multiplication is realized by decomposing $k,\ell$ into windows of size $w = O(\log n)$ and iteratively applying controlled point addition and doubling circuits. In affine Weierstrass form, point addition involves evaluating the slope $\lambda = (y_2-y_1)/(x_2-x_1)$ and updating coordinates via field operations:
$$
x_3 = \lambda^2 - x_1 - x_2, \qquad y_3 = \lambda(x_1 - x_3) - y_1
$$
With each controlled addition requiring four inversions, four multiplications, one squaring, and several additions/negations, the underlying field arithmetic drives resource demands [2604.02311, 1706.06752, 2001.09580].

A significant advance in [2604.02311] is the introduction of a space-efficient, reversible modular inversion circuit via a refined extended Euclidean algorithm, utilizing register-sharing and dynamic bit-length tracking. The construction reduces the modular inversion circuit width from 7$n$ to $3n+4\lfloor\log_2 n\rfloor + O(1)$ logical qubits.

## 3. Resource Estimates and Scaling Laws

Resource estimates for Shor's ECDLP algorithm depend on both the elliptic curve arithmetic variant and the underlying field size $n = \lceil \log_2 p \rceil$. 

For affine Weierstrass coordinates (prime field):
- Modular inversion: $3n + 4\lfloor\log_2 n\rfloor + O(1)$ qubits, $204n^2 \log_2 n + O(n^2)$ Toffoli gates per inversion [2604.02311].
- Point addition: $5n + 4\lfloor\log_2 n\rfloor + O(1)$ qubits per controlled addition, dominated by the modular inversion.
- Double-scalar multiplication: $O(n^3)$ Toffoli gates per complete oracle query.
- For $n=256$, the total logical-qubit count is reduced to 1333 compared to 2124 in Häner et al., while maintaining $O(n^3)$ Toffoli count [2604.02311, 2001.09580, 1706.06752].

The importance of modular inversion (vs. multiplication or addition) is highlighted by comparative qubit and gate counts. Prior low-width approaches required 7$n$ qubits for inversion; the refined approach in [2604.02311] lowers this to $3n + 4\lfloor\log_2 n\rfloor + O(1)$, which, when substituted into the overall group operation, produces a $5n + 4\lfloor\log_2 n\rfloor + O(1)$ total.

Windowed arithmetic further optimizes circuit depth and gate count. By decomposing scalars into windows and employing table look-ups for precomputed multiples, the number of point addition steps is reduced from $O(n)$ to $O(n/\log n)$, yielding leading Toffoli and CNOT count expressions of $O(n^3/\log n)$ [2001.09580, 2305.11410].

## 4. Coordinate Systems: Affine vs. Projective Representations

While projective coordinates eliminate explicit inversions by representing points as $(X:Y:Z)$ and using only multiplications/additions for point operations, they introduce substantial uncomputation and reversibility overhead. Each addition involves 32–62 multiplications instead of two inversions and two multiplications in the affine case, and the need to canonicalize superpositions or uncompute intermediates inhibits resource savings. As shown in [2502.12441], affine coordinates remain superior in resource efficiency due to lower depth, T-count, and qubit requirements per operation:
- Affine: $11n+18.9$ qubits, $432n^2$ depth, $1182n^2$ T-gates
- Projective: $19n+12.2$ qubits, $1327n^2$–$685n^2$ depth, $2344n^2$–$1210n^2$ T-gates

## 5. Success Probability and Algorithmic Optimizations

Baseline implementations of Shor’s ECDLP algorithm achieve a single-run success probability of $60\%$–$82\%$ when using the semiclassical Fourier transform. By introducing small amounts of register padding (increasing control qubit length by $s$), and conducting limited 1D or 2D classical searches in the post-processing stage, the probability can be boosted to $>99\%$ in one run, with only linear quantum overhead [1905.09084]. The cost to further increase the success probability to near-unity decreases rapidly as $s$ and search window sizes grow. The computational burden remains polynomial in $n$ with these enhancements, and the number of required algorithm runs to reach high confidence is bounded independently of $n$.

## 6. Impact of Modular Inversion and Recent Advances

Modular inversion is the dominant operation in quantum resource requirements for ECDLP circuits. In [2604.02311], the presented modular inversion quantum circuit achieves both correctness and space efficiency by sharing registers, tracking the bit-length of intermediates, and location-controlled swaps based on the status of the extended Euclidean update. The inversion cost is quantified as $204 n^2 \log_2 n + O(n^2)$ Toffoli gates, a marked improvement over previous 448 $n^3 \log_2 n$-level designs.

Integrating this inversion block into the overall affine addition circuit reduces circuit width to $5n + 4 \lfloor \log_2 n \rfloor + O(1)$ logical qubits and maintains $O(n^3)$ Toffoli scaling, facilitating an end-to-end attack on ECDLP with minimized logical-qubit overhead.

## 7. Practical Feasibility, Cost Metrics, and Cryptanalytic Outlook

Recent resource estimates across multiple hardware paradigms (surface code, repetition cat, and LDPC cat codes), for the 256-bit secp256k1 curve, forecast logical resource requirements in the $1$–$3\times 10^3$ qubit regime with $O(5\times 10^9)$–$O(10^{11})$ Toffoli gates. Total physical qubits (with fault tolerance) typically range between $4\times10^4$ to $5\times10^6$ and runtimes from hours (aggressive error rates, photonic codes) to weeks (conservative surface codes) [2508.14011]. 

In terms of classical-to-quantum cryptanalytic comparison, ECC offers an easier quantum target than RSA due to smaller parameter sizes and lower total gate counts. For example, attacking P-256 requires $\sim2\times$ fewer qubits and $\sim150\times$ fewer Toffolis than RSA-3072 [1706.06752]. A plausible implication is that quantum attacks on ECC will become practical before equivalent threats to RSA reach feasibility.

Current trends project that end-to-end breaks of 256-bit ECC by large-scale, fault-tolerant quantum computers could be realized in the late 2020s or early 2030s, motivating proactive cryptographic migration strategies [2508.14011].

---

**References**:  
- "Space-Efficient Quantum Algorithm for Elliptic Curve Discrete Logarithms with Resource Estimation" [2604.02311]  
- "Quantum resource estimates for computing elliptic curve discrete logarithms" [1706.06752]  
- "Revisiting Shor's quantum algorithm for computing general discrete logarithms" [1905.09084]  
- "Minimizing CNOT-count in quantum circuit of the extended Shor's algorithm for ECDLP" [2305.11410]  
- "Choosing Coordinate Forms for Solving ECDLP Using Shor's Algorithm" [2502.12441]  
- "Quantum resource estimates for computing binary elliptic curve discrete logarithms" [2503.02984]  
- "Brace for impact: ECDLP challenges for quantum cryptanalysis" [2508.14011]  
- "Improved quantum circuits for elliptic curve discrete logarithms" [2001.09580]

Source: https://www.emergentmind.com/topics/shor-s-quantum-ecdlp-algorithm