Advances in Factoring and Primality Testing: From Classical to Quantum Algorithms
Pith reviewed 2026-05-24 14:38 UTC · model grok-4.3
The pith
Quantum factoring algorithms outperform classical ones while quantum primality testing shows no such advantage.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
While quantum factoring algorithms, particularly Shor's algorithm and its refinements, have introduced significant advancements over their classical counterparts, quantum primality testing algorithms have not demonstrated comparable advantages.
What carries the argument
Comprehensive review, classification, and performance comparison of classical and quantum factorization and primality testing algorithms, including time complexities and practical implementations.
If this is right
- Shor's algorithm and its refinements provide significant advancements in factoring over classical methods.
- Quantum primality testing algorithms do not show comparable advantages to their classical counterparts.
- The comparison reveals specific speed/accuracy tradeoffs and time complexities for both factoring and primality testing.
- Insights apply directly to the security assumptions in systems like RSA that depend on factoring difficulty.
Where Pith is reading between the lines
- Efforts to create quantum primality tests with advantages comparable to Shor's in factoring could change the balance between the two tasks.
- Classical primality tests may stay dominant even as quantum hardware improves for other cryptographic problems.
- Extending the performance comparison to newer quantum hardware could test whether implementation details alter the observed lack of advantage.
Load-bearing premise
That the specific algorithms selected for implementation and the metrics used in the performance comparison fairly represent the current state of both classical and quantum approaches without selection bias or implementation artifacts.
What would settle it
A demonstration of a quantum primality testing algorithm that significantly outperforms the best classical methods in speed or accuracy on large numbers would falsify the claim of no comparable advantage.
Figures
read the original abstract
Many modern asymmetric encryption methods rely on prime numbers, as they have distinctive properties. For instance, the security of RSA cryptosystem relies on the computational difficulty of factoring a large composite number in its prime factors, a problem that remains challenging for classical computers but potentially solvable using quantum algorithms. On the other hand, generating large prime numbers is also challenging due to their irregular distribution among integers, necessitating the use of primality testing algorithms to verify candidate primes. In this paper, we intensively review and classify various classical and quantum algorithms for factorization and primality testing, highlighting their advantages, limitations, speed/accuracy tradeoffs, time complexities, along with a brief summary. Furthermore, we apply and compare these algorithms to gain practical insights and conduct a comprehensive performance comparison. The insights from this paper show that while quantum factoring algorithms, particularly Shor's algorithm and its refinements, have introduced significant advancements over their classical counterparts, quantum primality testing algorithms have not demonstrated comparable advantages.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript reviews and classifies classical and quantum algorithms for integer factorization and primality testing. It discusses advantages, limitations, speed/accuracy tradeoffs, and time complexities, provides brief summaries, and reports a performance comparison of selected algorithms. From this comparison the authors conclude that quantum factoring algorithms (particularly Shor's and refinements) have introduced significant advancements over classical methods, whereas quantum primality testing algorithms have not demonstrated comparable advantages.
Significance. If the performance comparison is adequately documented and free of selection or implementation artifacts, the survey would usefully distinguish the asymmetric impact of quantum methods on the two problems that underpin RSA security. The classification of complexities and tradeoffs could serve as a reference for the cryptography community.
major comments (1)
- [Abstract] Abstract (performance comparison paragraph): the central claim that quantum primality testing algorithms have not demonstrated comparable advantages rests on an empirical comparison, yet the text supplies no dataset sizes, selection criteria, metrics, error bars, or exclusion rules for the runs. This absence directly undermines support for the comparative conclusion.
minor comments (1)
- Ensure every algorithm discussed is accompanied by its original reference citation.
Simulated Author's Rebuttal
We thank the referee for their review and the opportunity to address the concern regarding documentation of the performance comparison. We respond to the major comment below.
read point-by-point responses
-
Referee: [Abstract] Abstract (performance comparison paragraph): the central claim that quantum primality testing algorithms have not demonstrated comparable advantages rests on an empirical comparison, yet the text supplies no dataset sizes, selection criteria, metrics, error bars, or exclusion rules for the runs. This absence directly undermines support for the comparative conclusion.
Authors: We agree that the manuscript does not supply the requested details on the empirical comparison (dataset sizes, selection criteria, metrics, error bars, or exclusion rules). This omission weakens support for the central claim in the abstract. We will revise both the abstract and the performance comparison section to document these elements explicitly, including the range of integer sizes tested, how test cases were generated, the precise metrics recorded, variability across runs, and any filtering applied. This revision will be made in the next version of the manuscript. revision: yes
Circularity Check
Review paper with no derivations or fitted parameters; no circularity present
full rationale
This is a survey paper that reviews, classifies, and compares existing classical and quantum algorithms for factoring and primality testing. The abstract and structure indicate no original mathematical derivations, equations, or parameter-fitting steps. The central claim (quantum factoring advances vs. limited quantum primality gains) rests on literature summary and performance comparisons of known algorithms, not on any self-referential construction, self-citation chain, or renaming of results. No load-bearing steps reduce to the paper's own inputs by definition or construction. This matches the default expectation for non-derivational review papers.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
A lightweight password-based authentication protocol using smart card
Chenyu Wang, Ding Wang, Guoai Xu, and Yanhui Guo. A lightweight password-based authentication protocol using smart card. International Journal of Communication Systems, 30(16):e3336, 2017
work page 2017
-
[2]
New directions in cryptography.IEEE transactions on Information Theory, 22(6):644–654, 1976
Whitfield Diffie and Martin Hellman. New directions in cryptography.IEEE transactions on Information Theory, 22(6):644–654, 1976
work page 1976
-
[3]
Primality testing and integer factorization in public-key cryptography
Song Y Yan. Primality testing and integer factorization in public-key cryptography. 2009
work page 2009
-
[4]
Ulrich Daepp and Pamela Gorkin. Fermat’s little theorem. In Reading, Writing, and Proving, pages 315–323. Springer, 2011
work page 2011
-
[5]
Great Internet Mersenne Prime Search
George Woltman, Luke Welsh, and Ernst Mayer. Great Internet Mersenne Prime Search. https://www. mersenne.org/, 2018. [Online; accessed 17-April-2020]
work page 2018
-
[6]
A method for obtaining digital signatures and public-key cryptosystems
Ronald L Rivest, Adi Shamir, and Leonard Adleman. A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2):120–126, 1978
work page 1978
-
[7]
Elementary number theory: primes, congruences, and secrets: a computational approach
William Stein. Elementary number theory: primes, congruences, and secrets: a computational approach. Springer Science & Business Media, 2008
work page 2008
-
[8]
Raphael M Robinson. Mersenne and fermat numbers. Proceedings of the American Mathematical Society , 5(5):842–846, 1954
work page 1954
-
[9]
Numerical verification of the ternary goldbach conjecture up to 8.875· 1030
Harald A Helfgott and David J Platt. Numerical verification of the ternary goldbach conjecture up to 8.875· 1030. Experimental Mathematics, 22(4):406–409, 2013
work page 2013
-
[10]
David M Burton. Elementary number theory. Tata McGraw-Hill Education, 2006
work page 2006
-
[11]
The so-called sieve of eratosthenes
GA Miller. The so-called sieve of eratosthenes. Science, 68(1760):273–274, 1928
work page 1928
-
[12]
Evaluation and comparison of two efficient probabilistic primality testing algorithms
Louis Monier. Evaluation and comparison of two efficient probabilistic primality testing algorithms. Theoretical Computer Science, 12(1):97–108, 1980
work page 1980
-
[13]
Four primality testing algorithms
René Schoof. Four primality testing algorithms. arXiv preprint arXiv:0801.3840, 2008
work page internal anchor Pith review Pith/arXiv arXiv 2008
-
[14]
Three primality tests and maple implementation
Renee Marie Canfield. Three primality tests and maple implementation. PhD thesis, University of Georgia, 2008
work page 2008
-
[15]
Primality tests using algebraic groups
Masanari Kida. Primality tests using algebraic groups. Experimental Mathematics, 13(4):421–427, 2004
work page 2004
-
[16]
Randomized and deterministic primality testing
Monica Perrenoud. Randomized and deterministic primality testing. Technical report, 2009
work page 2009
-
[17]
Framework for evaluation and comparison of primality testing algorithms
Cristina-Loredana Duta, Laura Gheorghe, and Nicolae Tapus. Framework for evaluation and comparison of primality testing algorithms. In 2015 20th International Conference on Control Systems and Computer Science, pages 483–490. IEEE, 2015
work page 2015
-
[18]
A Verilog description and efficient hardware implementation of the Baillie-PSW primality test
Yasaswy Kasarabada. A Verilog description and efficient hardware implementation of the Baillie-PSW primality test. PhD thesis, University of Cincinnati, 2016
work page 2016
-
[19]
Hardware implementation of the baillie-psw primality test
Carla Purdy, Yasaswy Kasarabada, and George Purdy. Hardware implementation of the baillie-psw primality test. In 2017 IEEE 60th International Midwest Symposium on Circuits and Systems (MWSCAS), pages 651–654. IEEE, 2017
work page 2017
-
[20]
Fermat’s theorem and its generalization by euler
T Nagell. Fermat’s theorem and its generalization by euler. Introduction to Number Theory, Wiley, NY, pages 71–73, 1951
work page 1951
-
[21]
Pseudoprime statistics to 1019
Jens Kruse Andersen and Harvey Dubner. Pseudoprime statistics to 1019. Experimental Mathematics, 16(2):209– 213, 2007
work page 2007
-
[22]
On composite numbers p which satisfy the fermat congruence ap−1≡ 1modp
Robert D Carmichael. On composite numbers p which satisfy the fermat congruence ap−1≡ 1modp. The American Mathematical Monthly, 19(2):22–27, 1912
work page 1912
-
[23]
There are infinitely many carmichael numbers.Annals of Mathematics, pages 703–722, 1994
William R Alford, Andrew Granville, and Carl Pomerance. There are infinitely many carmichael numbers.Annals of Mathematics, pages 703–722, 1994
work page 1994
-
[24]
A fast monte-carlo test for primality.SIAM journal on Computing, 6(1):84–85, 1977
Robert Solovay and V olker Strassen. A fast monte-carlo test for primality.SIAM journal on Computing, 6(1):84–85, 1977
work page 1977
-
[25]
Riemann’s hypothesis and tests for primality
Gary L Miller. Riemann’s hypothesis and tests for primality. Journal of computer and system sciences, 13(3):300– 317, 1976
work page 1976
-
[26]
Probabilistic algorithm for testing primality
Michael O Rabin. Probabilistic algorithm for testing primality. Journal of number theory, 12(1):128–138, 1980
work page 1980
-
[27]
Sur la série des nombres premiers
François Proth. Sur la série des nombres premiers. Nouvelle Correspondance Mathématique, 4:236–240, 1878. 17 A PREPRINT - J UNE 16, 2020
work page 2020
-
[28]
A primality test for k p n + 1 numbers
José Grau, Antonio Oller-Marcén, and Daniel Sadornil. A primality test for k p n + 1 numbers. Mathematics of Computation, 84(291):505–512, 2015
work page 2015
-
[29]
Caldwell Chris K. The top twenty Proth numbers . https://primes.utm.edu/top20/page.php?id=66,
-
[30]
[Online; accessed 5-June-2020]
work page 2020
-
[31]
Robert Baillie and Samuel S Wagstaff. Lucas pseudoprimes. Mathematics of Computation, 35(152):1391–1417, 1980
work page 1980
-
[32]
The determination of the prime or composite nature of large numbers by fermat’s theorem
Henry C Pocklington. The determination of the prime or composite nature of large numbers by fermat’s theorem. Proc. Cambridge Philosophical Society, 1914, 18:29–30, 1914
work page 1914
-
[33]
Pe Pepin. Sur la formule 22n + 1. des seances de l’Academie des sciences, 85:329–331, 1877
-
[34]
Fermat and mersenne numbers in pepin’s test
Alena Šolcová and Michał Kˇrižek. Fermat and mersenne numbers in pepin’s test. Demonstratio Mathematica, 39(4):737–742, 2006
work page 2006
-
[35]
Derrick H Lehmer. Tests for primality by the converse of fermat’s theorem.Bulletin of the American Mathematical Society, 33(3):327–340, 1927
work page 1927
-
[36]
Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. Primes is in p. Annals of mathematics, pages 781–793, 2004
work page 2004
-
[37]
Primality tests in polynomial time
Alberto Bedodi and Francesco Pappalardi. Primality tests in polynomial time . PhD thesis, Master’s thesis, Universitá Degli Studi Roma TRE, 2010
work page 2010
- [38]
- [39]
-
[40]
Are there counter-examples to the baillie-psw primality test
Carl Pomerance. Are there counter-examples to the baillie-psw primality test. Dopo Le Parole aangeboden aan Dr. AK Lenstra. Privately published Amsterdam, 1984
work page 1984
-
[41]
Fermat primes: primes of the form 22k + 1 , for some k > = 0
Neil James Sloane and David Wilson. Fermat primes: primes of the form 22k + 1 , for some k > = 0 . . http://oeis.org/A019434, 2010. [Online; accessed 2-June-2020]. A Appendix A Table 6: Two big Mersenne numbers. Number Value #-digits Type (21279− 1) 1040793219466439908192524032736408553861526224726670 4805319112350403608059673360298012239441732324184842 4...
work page 2010
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.