English

Optimized circuits for windowed modular arithmetic with applications to quantum attacks against RSA

Quantum Physics 2025-02-25 v1

Abstract

Windowed arithmetic [Gidney, 2019] is a technique for reducing the cost of quantum arithmetic circuits with space--time tradeoffs using memory queries to precomputed tables. It can reduce the asymptotic cost of modular exponentiation from O(n3)O\left(n^3\right) to O(n3/log2n)O\left(n^3/\log^2 n\right) operations, resulting in the current state-of-the-art compilations of quantum attacks against modern cryptography. In this work we introduce four optimizations to windowed modular exponentiation. We (1) show how the cost of unlookups can be reduced by 66%66\% asymptotically in the number of bits, (2) illustrate how certain addresses can be bypassed, reducing both circuit depth and the overall lookup cost, (3) demonstrate that multiple lookup--addition operations can be merged into a single, larger lookup at the start of the modular exponentiation circuit, and (4) reduce the depth of the unary conversion for unlookups. On a logical level, this leads to a 3%3\% improvement in Toffoli count and Toffoli depth for modular exponentiation circuits relevant to cryptographic applications. This translates to some improvements on [Gidney and Eker\r{a}, 2021]'s factoring algorithm: for a given number of physical qubits, our improvements show a reduction in the expected runtime from 2%2\% to 6%6\% for factoring RSA\mathsf{RSA}-20482048 integers.

Keywords

Cite

@article{arxiv.2502.17325,
  title  = {Optimized circuits for windowed modular arithmetic with applications to quantum attacks against RSA},
  author = {Alessandro Luongo and Varun Narasimhachar and Adithya Sireesh},
  journal= {arXiv preprint arXiv:2502.17325},
  year   = {2025}
}

Comments

30 pages

R2 v1 2026-06-28T21:55:47.727Z