Posts

Showing posts from November, 2025

AKS Primality Testing

AKS Primality Testing Algorithm Short Description The AKS (Agrawal–Kayal–Saxena) algorithm is a deterministic polynomial-time algorithm used to test whether a given number is prime. Unlike probabilistic methods such as the Fermat or Miller–Rabin tests, AKS always produces a correct result without relying on randomness. Introduced in 2002 by Agrawal, Kayal, and Saxena, this algorithm resolved a long-standing open problem in computer science by proving that primality testing belongs to the complexity class P . 2. Mathematical Foundation 2.1 Fermat’s Little Theorem (Classical) If p p p is prime and a a a is not divisible by p p p : a p ≡ a ( m o d p ) a^{p} \equiv a \pmod{p} This is the basis of many probabilistic tests. ❗ Problem: Some composite numbers (Carmichael numbers) also satisfy this. 3. Key Insight Behind AKS Instead of working with numbers , AKS works with polynomials . AKS Theorem For an integer n > 1 n > 1 n > 1 , n  is prime     ⟺    ( ...

Galois Field and Operations

  What Is a Galois Field? A Galois Field , or finite field , is a mathematical system with a finite number of elements in which the operations of addition, subtraction, multiplication, and division (except by zero) are well defined and satisfy all field properties. Galois fields are denoted by GF(pⁿ) , where: p is a prime number (called the characteristic) n is a positive integer They are named after Évariste Galois , whose work laid the foundation of modern algebra. Types of Galois Fields 1. Prime Fields: GF(p) A prime field contains exactly p elements : G F ( p ) = { 0 , 1 , 2 , … , p − 1 } GF(p) = \{0, 1, 2, \ldots, p-1\} All arithmetic is performed modulo p . Arithmetic Operations in GF(p) (Mod p Arithmetic) Let us consider GF(7) as an example. 1. Addition (mod p) Add normally and reduce modulo p. 5 + 4 = 9 ≡ 2 ( m o d 7 ) 5 + 4 = 9 \equiv 2 \pmod{7} 2. Subtraction (mod p) Subtract normally and reduce modulo p. 3 − 5 = − 2 ≡ 5 ( m o d 7 ) 3 - 5 = ...

Hash Functions

  Hash Functions: A Number Theory Perspective Introduction A hash function is a mathematical function that takes an input of arbitrary length and maps it to a fixed-size output , called a hash value or digest . Hash functions are fundamental in computer science and cryptography, playing a vital role in data integrity, authentication, digital signatures, and secure storage . From a number theory viewpoint, hash functions rely heavily on modular arithmetic, prime numbers, finite fields, and algebraic structures , making them an interesting and practical application of abstract mathematics. What Is a Hash Function? Formally, a hash function is a function: h : { 0 , 1 } ∗ → { 0 , 1 } n h : \{0,1\}^* \rightarrow \{0,1\}^n that maps an input of any length to a fixed-length output of n n n bits. Key Characteristics A good hash function should satisfy: Determinism – The same input always produces the same output Efficiency – The hash is computed quickly Uniformity –...