# Optimized AKS Primality Testing: A Fluctuation Theory Perspective

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Randomized AKS Primality Testing

Algorithm 1: The AKS algorithm (the AKS primality testing [1] of an integer) | |

1- | An integer $1<n\in \mathbb{N}$ is said to be a composite number if there exists a pair $\left(a,b\right)$ such that $n={a}^{b}$ for some $a\in \mathbb{N}$ and $b>1$. |

2- | Given a triple $\left(a,b,r\right)$ with $gcd\left(a,r\right)=1$, find the smallest $r$ such that ${a}^{b}=1\left(mod\text{}r\right)$ holds. Then, the order ${o}_{r}\left(n\right)$ of $a$ modulo $r$ must satisfy the inequality ${o}_{r}\left(n\right)>lo{g}^{2}n$. |

3- | For an integer $n$ with its factor $a\le r$, $n$ is said to be composite if $1<\mathrm{gcd}\left(a,n\right)<n$. |

4- | The input integer $n$ returns a prime if we have $n\le r$. |

5- | For $a=1,2,\dots ,l$, an integer $n$ is said to be composite, if the Equation (A3) as in Appendix A.2 is not satisfied over $\left(mod\text{}{X}^{r}-1,\text{}n\right)$, where $l=\text{}\sqrt{\varphi \left(r\right)}\mathrm{log}n$. Here, $\varphi \left(r\right)$ denotes the Euler totient function, which counts the relatively prime numbers less than $r$. |

6- | Otherwise the input integer $n$ is a prime. |

## 3. Fluctuation Theory Perspective

#### 3.1. Stability Analysis

#### 3.2. Limiting Stability Analysis

#### 3.3. Eigenvalues and Eigenvectors of $H$

#### 3.3.1. Evaluation of Eigenvalues

#### 3.3.2. Evaluation of Eigenvectors

## 4. Discussion of the Results

## 5. Summary and Conclusions

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Appendix A

#### Appendix A.1. A Brief Account of the Evolution of Primality Testing

#### Appendix A.2. The AKS Algorithm: An Overview

## References

- Agrawal, M.; Kayal, N.; Saxena, N. PRIMES is in P. Ann. Math.
**2004**, 160, 781–793. [Google Scholar] [CrossRef] [Green Version] - Savu, L. Cryptography role in information security. In Proceedings of the 5th WSEAS International Conference on Communications and Information Technology (CIT11), Corfu Island, Greece, 14–17 July 2011; pp. 36–41. [Google Scholar]
- Knudsen, L.R.; Matthew, J.B.R. The Block Cipher Companion; Springer: Berlin/Heidelberg, Germany, 2011. [Google Scholar]
- Van Sinderen, M.; Pires, L.F.; Vissers, C.A. Protocol design and implementation using formal methods. Comput. J.
**1992**, 35, 478–491. [Google Scholar] [CrossRef] - Sharp, R. Principles of Protocol Design; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
- Clark, K. An Algorithm that Decides PRIMES in Polynomial Time. Available online: https://sites.math.washington.edu/~morrow/336_11/papers/kevin.pdf (accessed on 20 April 2019).
- Cook, S. The P versus NP problem. In The Millennium Prize Problems; Carlson, J., Carlson, J.A., Jaffe, A., Wiles, A., Eds.; Clay Mathematics Institute: Cambridge, MA, USA; American Mathematical Society: Providence, RI, USA, 2006; pp. 87–104. [Google Scholar]
- Fortnow, L.; Homer, S. A Short History of Computational Complexity; Computer Science: Technical Reports, 2003-10-02; Boston University Computer Science Department: Boston, MA, USA, 2003. [Google Scholar]
- Sudan, M. The P vs. NP problem. Available online: http://madhu.seas.harvard.edu/papers/2010/pnp.pdf (accessed on 20 April 2019).
- Creignou, N.; Khanna, S.; Sudan, M. Complexity Classifications of Boolean Constraint Satisfaction Problems; SIAM: Philadelphia, PA, USA, 2001. [Google Scholar]
- Agrawal, M.; Biswas, S. Primality and identity testing via Chinese remaindering. J. ACM (JACM)
**2003**, 50, 429–443. [Google Scholar] [CrossRef] - Sudan, M. Algebra and Computation, Lecture 12. Available online: http://people.csail.mit.edu/madhu/ST12/scribe/lect12.pdf (accessed on 20 April 2019).
- Kopparty, S. Primality Testing, Lecture 14, Algorithmic Number Theory. Available online: http://www.math.rutgers.edu/~sk1233/courses/ANT-F14/lec14.pdf (accessed on 20 April 2019).
- Hansen, P.B. Primality Testing. Available online: http://surface.syr.edu/eecs_techreports/169/ (accessed on 20 April 2019).
- Smart, N.P. Cryptography: An Introduction, 3rd ed.; Mcgraw-Hill: New York, NY, USA, 2003; pp. 1–22. [Google Scholar]
- Hardy, G.H.; Wright, E.M. Introduction to the Theory of Numbers, 6th ed.; Oxford University Press: Oxford, UK, 2008; pp. 63–72. [Google Scholar]
- Sudan, M. Primality Testing, Lecture 12, Algebra and Computation. Available online: http://people.csail.mit.edu/madhu/ST12/scribe/lect12.pdf (accessed on 20 April 2019).
- Turing, A.M. On computable numbers, with an application to the Entscheidungsproblem. Proc. Lond. Math. Soc.
**1937**, 2, 230–265. [Google Scholar] [CrossRef] - Ruppeiner, G. Riemannian geometry in thermodynamic fluctuation theory. Rev. Mod. Phys.
**1995**, 67, 605–659. [Google Scholar] [CrossRef] - Tiwari, B.N. Geometric perspective of entropy function: Embedding, spectrum and convexity. arXiv
**2011**, arXiv:1108.4654. [Google Scholar] - Tiwari, B.N.; Adeegbe, J.M.; Kibindé, J.K. Randomized Cunningham Numbers in Cryptography: Randomization theory, Cryptanalysis, RSA cryptosystem, Primality testing, Cunningham numbers, Optimization theory; LAP LAMBERT Academic Publishing: Riga, Latvia, 2018. [Google Scholar]
- Rosen, K.H. Discrete Mathematics and Its Applications, 7th ed.; McGraw-Hill Pub: New York, NY, USA, 1998; pp. 237–310. [Google Scholar]
- Atiyah, M.F.; MacDonald, I.G. Introduction to Commutative Algebra; Addison-Wesley Series in Mathematics; CRC Press: Boca Raton, FL, USA, 1994. [Google Scholar]
- Borwein, J.; Borwein, P.B. Pi and the AGM: A Study in Analytic Number Theory and Computational Complexity; Wiley: New York, NY, USA, 1987; p. 6. [Google Scholar]
- Conrad, K. The Miller–Rabin Test. Available online: http://www.math.uconn.edu/~kconrad/blurbs/ugradnumthy/millerrabin.pdf (accessed on 20 April 2019).
- Conrad, K. The Solovay–Strassen Test. Available online: http://www.math.uconn.edu/~kconrad/blurbs/ugradnumthy/solovaystrassen.pdf (accessed on 20 April 2019).
- Impagliazzo, R.; Paturi, R. Exact Complexity and Satisfiability. In Parameterized and Exact Computation, Proceedings of the International Symposium on Parameterized and Exact Computation, IPEC 2013, Sophia Antipolis, France, 4–6 September 2013; Gutin, G., Szeider, S., Eds.; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2013; Volume 8246, pp. 1–3. [Google Scholar]
- Baez, J.C. The Octonions. Bull. Amer. Math. Soc.
**2002**, 39, 145–205. [Google Scholar] [CrossRef] - Creignou, N.; Schmidt, J.; Thomas, M. Complexity Classifications for Propositional Abduction in Post’s Framework. J. Logic Comput.
**2012**, 22, 1145–1170. [Google Scholar] [CrossRef] - Wang, X.Z.; Wang, R.; Xu, C. Discovering the relationship between generalization and uncertainty by incorporating complexity of classification. IEEE Trans. Cybern.
**2018**, 48, 703–715. [Google Scholar] [CrossRef] [PubMed]

**Figure 1.**The AKS primality testing function as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 2.**The input integer rate ${f}_{x}\left(x,y\right)$ as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 3.**The rate ${f}_{y}\left(x,y\right)$ as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 4.**The input integer capacity ${f}_{xx}\left(x,y\right)$ as a function of the input integer x and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in $ (1, 100).

**Figure 5.**The local runtime capacity ${f}_{yy}\left(x,y\right)$ as a function of the input integer x and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in $ (1, 100).

**Figure 6.**The correlation ${f}_{xy}\left(x,y\right)$ as a function of the input integer x and the cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 7.**The determinant $\u2206\left(x,y\right)$ of the Hessian matrix $H$ as a function of the input integer x and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in \left(1,\text{}100\right)$.

**Figure 8.**The discriminant as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in \left(1,\text{}100\right)$.

**Figure 9.**The eigenvalue ${\gimel}_{1}$ of the Hessian matrix $H$ as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 10.**The eigenvalue ${\gimel}_{2}$ of the Hessian matrix $H$ as a function of the input integer $x$ and cardinality $y$ of the set of alphabets of the machine executing the AKS algorithm plotted in the range $x,y\in \left(1,\text{}100\right)$.

**Figure 11.**The trace $tr\left(H\right)$ of the Hessian matrix $H$ as a function of the input integer $x$ and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in \left(1,\text{}100\right)$.

**Figure 12.**The norm $\left|{v}_{1}\right|$ corresponding to the eigenvalue ${\gimel}_{1}$ of the Hessian matrix H as a function of the input integer x and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in \text{}\left(1,\text{}100\right)$.

**Figure 13.**The norm $\left|{v}_{2}\right|$ corresponding to the eigenvalue ${\gimel}_{2}$ of the Hessian matrix H as a function of the input integer x and cardinality y of the set of alphabets of the machine executing the AKS algorithm plotted in the interval $x,y\in \text{}\left(1,\text{}100\right)$.

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Tiwari, B.N.; Kuipo, J.K.; Adeegbe, J.M.; Marina, N.
Optimized AKS Primality Testing: A Fluctuation Theory Perspective. *Cryptography* **2019**, *3*, 12.
https://doi.org/10.3390/cryptography3020012

**AMA Style**

Tiwari BN, Kuipo JK, Adeegbe JM, Marina N.
Optimized AKS Primality Testing: A Fluctuation Theory Perspective. *Cryptography*. 2019; 3(2):12.
https://doi.org/10.3390/cryptography3020012

**Chicago/Turabian Style**

Tiwari, Bhupendra Nath, Jude Kibinde Kuipo, Joshua M. Adeegbe, and Ninoslav Marina.
2019. "Optimized AKS Primality Testing: A Fluctuation Theory Perspective" *Cryptography* 3, no. 2: 12.
https://doi.org/10.3390/cryptography3020012