Skip to main content
QUICK REVIEW

[Paper Review] Deterministic Primality Testing - understanding the AKS algorithm

Vijay Menon|arXiv (Cornell University)|Nov 15, 2013
Chaos-based Image/Signal Encryption1 references3 citations
TL;DR

This paper provides a comprehensive, self-contained explanation of the AKS primality test, a deterministic polynomial-time algorithm for primality testing, which was a landmark theoretical breakthrough in 2002. It details the algorithm’s mathematical foundations in number theory and algebra, implements it in SAGE, and evaluates its practical inefficiency despite its theoretical significance.

ABSTRACT

Prime numbers play a very vital role in modern cryptography and especially the difficulties involved in factoring numbers composed of product of two large prime numbers have been put to use in many modern cryptographic designs. Thus, the problem of distinguishing prime numbers from the rest is vital and therefore there is a need to have efficient primality testing algorithms. Although there had been many probabilistic algorithms for primality testing, there wasn't a deterministic polynomial time algorithm until 2002 when Agrawal, Kayal and Saxena came with an algorithm, popularly known as the AKS algorithm, which could test whether a given number is prime or composite in polynomial time. This project is an attempt at understanding the ingenious idea behind this algorithm and the underlying principles of mathematics that is required to study it. In fact, through out this project, one of the major objectives has been to make it as much self contained as possible. Finally, the project provides an implementation of the algorithm using Software for Algebra and Geometry Experimentation (SAGE) and arrives at conclusions on how practical or otherwise it is.

Motivation & Objective

  • To provide a self-contained understanding of the AKS algorithm, emphasizing its underlying number theory and algebraic principles.
  • To investigate the feasibility and practicality of implementing the AKS algorithm in real-world applications.
  • To evaluate the performance of the AKS algorithm through implementation in SAGE, particularly for large integers.
  • To compare the AKS algorithm with existing probabilistic primality tests in terms of efficiency and reliability.
  • To contribute to the understanding of deterministic primality testing by analyzing the algorithm’s correctness and computational complexity.

Proposed method

  • The paper begins with foundational concepts in number theory, including prime and composite numbers, GCD, and modular arithmetic.
  • It introduces essential algebraic structures, such as polynomial rings and quotient rings, required to understand the AKS algorithm.
  • The core of the algorithm is based on a modified version of Fermat’s Little Theorem, using polynomial congruences modulo $ (x^r - 1) $ and $ n $.
  • The algorithm checks whether $ (x + a)^n \equiv x^n + a \mod (x^r - 1, n) $ for $ a = 1 $ to $ l $, where $ l = \lfloor \sqrt{\phi(r)} \log n \rfloor $.
  • An implementation in SAGE is developed, including subroutines for perfect-power detection, finding the smallest suitable $ r $, and verifying polynomial congruences.
  • Performance is evaluated by testing the algorithm on various integers, including large numbers like 9965468763136528274628451, which took approximately 70 minutes to process.

Experimental results

Research questions

  • RQ1How does the AKS algorithm achieve deterministic primality testing in polynomial time?
  • RQ2What are the key number-theoretic and algebraic principles that underlie the correctness of the AKS algorithm?
  • RQ3How does the AKS algorithm compare in performance to probabilistic primality tests like Miller-Rabin or Solovay-Strassen?
  • RQ4What are the computational bottlenecks in the AKS algorithm that limit its practical applicability?
  • RQ5Can the AKS algorithm be optimized or adapted for practical use in cryptographic applications?

Key findings

  • The AKS algorithm correctly identifies primes and composites, as verified through testing on numbers like 11, 28, 43, and 132, with results matching known primality.
  • The perfect-power detection subroutine successfully identifies composite numbers such as $ 2^5 = 32 $, returning 'Composite' with the correct base and exponent.
  • The algorithm finds the smallest $ r $ such that the multiplicative order $ O_r(n) > \log^2 n $, with values like $ r = 5 $ for $ n = 11 $, and $ r = 941 $ for $ n = 1189 $.
  • For $ n = 9965468763136528274628451 $, the algorithm correctly identifies the number as composite, though the computation took approximately 70 minutes.
  • Despite its theoretical significance, the AKS algorithm is found to be impractically slow for large integers, especially when compared to probabilistic alternatives.
  • The implementation in SAGE confirms the correctness of the algorithm’s logic but highlights its high computational cost, particularly in the polynomial congruence checks over large $ r $ and $ n $.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.