Contrast various tests for primality

With the increasing popularity and usage of cryptography and network security, prime generation and primality testing has become a significant issue. Various primality tests have been introduced in the past and we compare and contrast some popular primality tests and formulate our own results by implementing and testing them on a million numbers. Primality tests can be classified on the basis of whether they are general or specific, polynomial, deterministic or probabilistic and conditional or unconditional. We have considered AKS which is simultaneously general, polynomial, deterministic and unconditional while the other primality tests considered do not satisfy all these four properties simultaneously. Although AKS is an important algorithm theoretically, it is not used in practice due to it's poor performance versus the other primality test for large inputs. The results from our implementation show that Bailie-PSW performs the best while Fermat performs the poorest in probabilistic algorithms in terms of accuracy. AKS and Pocklington were found to perform as expected on the first five lakh numbers. Prime generation techniques are popular for generation of small primes. The most popular among these are the prime sieves. We implement, compare and contrast two of these namely, Sieve of Eratosthenes and Sieve of Sundaram on various ranges of numbers.