Efficient random search for residue systems with small modular deviation

Establish that, for any RSA modulus N, any multiplication count m used in the controlled modular exponentiation, and any integer f ≥ 1, a randomized search over sets P of small primes can, in expected time O(2^f · poly(m · len N)), find a set P such that L = ∏_{p∈P} p satisfies L ≥ N^m and the modular deviation Δ_N(L) is less than 2^{-f}. This formalizes the efficiency of the proposed brute-force random search strategy for selecting residue systems used in truncated residue arithmetic, ensuring wraparound errors have negligible modular deviation relative to N.

Background

The paper replaces direct modular exponentiation with truncated residue arithmetic, summing contributions from residues modulo small primes and then reducing modulo N. To prevent error amplification when accumulating modulo a large composite L instead of modulo N, the author proposes choosing L = ∏_{p∈P} p so that L ≥ Nm and L mod N has negligible modular deviation, allowing truncated additions to approximate the most significant bits of the result.

Numerical evidence suggests that random sets of small primes produce L mod N values that are uniformly distributed, and that sampling O(2f) such sets often finds an L with deviation below 2{-f}. The author conjectures this behavior holds in general and codifies it as Assumption 1: that a suitable set P can be found with expected time O(2f * poly(m * len N)). This assumption underpins the feasibility of the approximate residue arithmetic approach.

References

Numerically, it seems to be the case that picking random sets of small primes results in values of L \bmod N uniformly distributed over the range [1, N). In cases I've tested, I'm consistently able to find an L with deviation below 2{-f} with high probability by randomly sampling O(2f) sets of small primes. I conjecture this is true in general (see Assumption 1).

How to factor 2048 bit RSA integers with less than a million noisy qubits (2505.15917 - Gidney, 21 May 2025) in Section 2.1 (Approximate Residue Arithmetic), Assumption 1