Prime Numbers
Prime Numbers Prime Numbers
CONTENTS xiii 4.2.2 An improved n + 1 test, and a combined n 2 − 1 test . . 184 4.2.3 Divisors in residue classes . . . . . . . . . . . . . . . . . 186 4.3 The finite field primality test . . . . . . . . . . . . . . . . . . . 190 4.4 Gauss and Jacobi sums . . . . . . . . . . . . . . . . . . . . . . 194 4.4.1 Gauss sums test . . . . . . . . . . . . . . . . . . . . . . 194 4.4.2 Jacobi sums test . . . . . . . . . . . . . . . . . . . . . . 199 4.5 The primality test of Agrawal, Kayal, and Saxena (AKS test) . 200 4.5.1 Primality testing with roots of unity . . . . . . . . . . . 201 4.5.2 The complexity of Algorithm 4.5.1 . . . . . . . . . . . . 205 4.5.3 Primality testing with Gaussian periods . . . . . . . . . 207 4.5.4 A quartic time primality test . . . . . . . . . . . . . . . 213 4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 4.7 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 222 5 EXPONENTIAL FACTORING ALGORITHMS 225 5.1 Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 5.1.1 Fermat method . . . . . . . . . . . . . . . . . . . . . . . 225 5.1.2 Lehman method . . . . . . . . . . . . . . . . . . . . . . 227 5.1.3 Factor sieves . . . . . . . . . . . . . . . . . . . . . . . . 228 5.2 Monte Carlo methods . . . . . . . . . . . . . . . . . . . . . . . 229 5.2.1 Pollard rho method for factoring . . . . . . . . . . . . . 229 5.2.2 Pollard rho method for discrete logarithms . . . . . . . 232 5.2.3 Pollard lambda method for discrete logarithms . . . . . 233 5.3 Baby-steps, giant-steps . . . . . . . . . . . . . . . . . . . . . . . 235 5.4 Pollard p − 1 method . . . . . . . . . . . . . . . . . . . . . . . . 236 5.5 Polynomial evaluation method . . . . . . . . . . . . . . . . . . 238 5.6 Binary quadratic forms . . . . . . . . . . . . . . . . . . . . . . . 239 5.6.1 Quadratic form fundamentals . . . . . . . . . . . . . . . 239 5.6.2 Factoring with quadratic form representations . . . . . . 242 5.6.3 Composition and the class group . . . . . . . . . . . . . 245 5.6.4 Ambiguous forms and factorization . . . . . . . . . . . . 248 5.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 5.8 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 255 6 SUBEXPONENTIAL FACTORING ALGORITHMS 261 6.1 The quadratic sieve factorization method . . . . . . . . . . . . 261 6.1.1 Basic QS . . . . . . . . . . . . . . . . . . . . . . . . . . 261 6.1.2 Basic QS: A summary . . . . . . . . . . . . . . . . . . . 266 6.1.3 Fast matrix methods . . . . . . . . . . . . . . . . . . . . 268 6.1.4 Large prime variations . . . . . . . . . . . . . . . . . . . 270 6.1.5 Multiple polynomials . . . . . . . . . . . . . . . . . . . . 273 6.1.6 Self initialization . . . . . . . . . . . . . . . . . . . . . . 274 6.1.7 Zhang’s special quadratic sieve . . . . . . . . . . . . . . 276 6.2 Number field sieve . . . . . . . . . . . . . . . . . . . . . . . . . 278 6.2.1 Basic NFS: Strategy . . . . . . . . . . . . . . . . . . . . 279 6.2.2 Basic NFS: Exponent vectors . . . . . . . . . . . . . . . 280
xiv CONTENTS 6.2.3 Basic NFS: Complexity . . . . . . . . . . . . . . . . . . 285 6.2.4 Basic NFS: Obstructions . . . . . . . . . . . . . . . . . . 288 6.2.5 Basic NFS: Square roots . . . . . . . . . . . . . . . . . . 291 6.2.6 Basic NFS: Summary algorithm . . . . . . . . . . . . . . 292 6.2.7 NFS: Further considerations . . . . . . . . . . . . . . . . 294 6.3 Rigorous factoring . . . . . . . . . . . . . . . . . . . . . . . . . 301 6.4 Index-calculus method for discrete logarithms . . . . . . . . . . 302 6.4.1 Discrete logarithms in prime finite fields . . . . . . . . . 303 6.4.2 Discrete logarithms via smooth polynomials and smooth algebraic integers . . . . . . . . . . . . . . . . . . . . . . 305 6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 6.6 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 315 7 ELLIPTIC CURVE ARITHMETIC 319 7.1 Elliptic curve fundamentals . . . . . . . . . . . . . . . . . . . . 319 7.2 Elliptic arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . 323 7.3 The theorems of Hasse, Deuring, and Lenstra . . . . . . . . . . 333 7.4 Elliptic curve method . . . . . . . . . . . . . . . . . . . . . . . 335 7.4.1 Basic ECM algorithm . . . . . . . . . . . . . . . . . . . 336 7.4.2 Optimization of ECM . . . . . . . . . . . . . . . . . . . 339 7.5 Counting points on elliptic curves . . . . . . . . . . . . . . . . . 347 7.5.1 Shanks–Mestre method . . . . . . . . . . . . . . . . . . 347 7.5.2 Schoof method . . . . . . . . . . . . . . . . . . . . . . . 351 7.5.3 Atkin–Morain method . . . . . . . . . . . . . . . . . . . 358 7.6 Elliptic curve primality proving (ECPP) . . . . . . . . . . . . . 368 7.6.1 Goldwasser–Kilian primality test . . . . . . . . . . . . . 368 7.6.2 Atkin–Morain primality test . . . . . . . . . . . . . . . . 371 7.6.3 Fast primality-proving via ellpitic curves (fastECPP) . 373 7.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 7.8 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 380 8 THE UBIQUITY OF PRIME NUMBERS 387 8.1 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 8.1.1 Diffie–Hellman key exchange . . . . . . . . . . . . . . . 387 8.1.2 RSA cryptosystem . . . . . . . . . . . . . . . . . . . . . 389 8.1.3 Elliptic curve cryptosystems (ECCs) . . . . . . . . . . . 391 8.1.4 Coin-flip protocol . . . . . . . . . . . . . . . . . . . . . . 396 8.2 Random-number generation . . . . . . . . . . . . . . . . . . . . 397 8.2.1 Modular methods . . . . . . . . . . . . . . . . . . . . . . 398 8.3 Quasi-Monte Carlo (qMC) methods . . . . . . . . . . . . . . . 404 8.3.1 Discrepancy theory . . . . . . . . . . . . . . . . . . . . . 404 8.3.2 Specific qMC sequences . . . . . . . . . . . . . . . . . . 407 8.3.3 Primes on Wall Street? . . . . . . . . . . . . . . . . . . 409 8.4 Diophantine analysis . . . . . . . . . . . . . . . . . . . . . . . . 415 8.5 Quantum computation . . . . . . . . . . . . . . . . . . . . . . . 418 8.5.1 Intuition on quantum Turing machines (QTMs) . . . . . 419
- Page 2 and 3: Prime Numbers
- Page 4 and 5: Richard Crandall Center for Advance
- Page 6 and 7: Preface In this volume we have ende
- Page 8 and 9: Preface ix Examples of computationa
- Page 10 and 11: Contents Preface vii 1 PRIMES! 1 1.
- Page 14 and 15: CONTENTS xv 8.5.2 The Shor quantum
- Page 16 and 17: 2 Chapter 1 PRIMES! where exponents
- Page 18 and 19: 4 Chapter 1 PRIMES! of the most rec
- Page 20 and 21: 6 Chapter 1 PRIMES! decision bit) o
- Page 22 and 23: 8 Chapter 1 PRIMES! 1.1.4 Asymptoti
- Page 24 and 25: 10 Chapter 1 PRIMES! naive subrouti
- Page 26 and 27: 12 Chapter 1 PRIMES! x π(x) 10 2 1
- Page 28 and 29: 14 Chapter 1 PRIMES! Erdős-Turán
- Page 30 and 31: 16 Chapter 1 PRIMES! Let’s hear i
- Page 32 and 33: 18 Chapter 1 PRIMES! Conjecture 1.2
- Page 34 and 35: 20 Chapter 1 PRIMES! It is not hard
- Page 36 and 37: 22 Chapter 1 PRIMES! 1.3 Primes of
- Page 38 and 39: 24 Chapter 1 PRIMES! 9.5.18 and Alg
- Page 40 and 41: 26 Chapter 1 PRIMES! Mersenne conje
- Page 42 and 43: 28 Chapter 1 PRIMES! Again, as with
- Page 44 and 45: 30 Chapter 1 PRIMES! then taken aga
- Page 46 and 47: 32 Chapter 1 PRIMES! McIntosh has p
- Page 48 and 49: 34 Chapter 1 PRIMES! have identitie
- Page 50 and 51: 36 Chapter 1 PRIMES! This theorem i
- Page 52 and 53: 38 Chapter 1 PRIMES! conjectured. T
- Page 54 and 55: 40 Chapter 1 PRIMES! Definition 1.4
- Page 56 and 57: 42 Chapter 1 PRIMES! on the left co
- Page 58 and 59: 44 Chapter 1 PRIMES! sums. These su
- Page 60 and 61: 46 Chapter 1 PRIMES! Vinogradov’s
CONTENTS xiii<br />
4.2.2 An improved n + 1 test, and a combined n 2 − 1 test . . 184<br />
4.2.3 Divisors in residue classes . . . . . . . . . . . . . . . . . 186<br />
4.3 The finite field primality test . . . . . . . . . . . . . . . . . . . 190<br />
4.4 Gauss and Jacobi sums . . . . . . . . . . . . . . . . . . . . . . 194<br />
4.4.1 Gauss sums test . . . . . . . . . . . . . . . . . . . . . . 194<br />
4.4.2 Jacobi sums test . . . . . . . . . . . . . . . . . . . . . . 199<br />
4.5 The primality test of Agrawal, Kayal, and Saxena (AKS test) . 200<br />
4.5.1 Primality testing with roots of unity . . . . . . . . . . . 201<br />
4.5.2 The complexity of Algorithm 4.5.1 . . . . . . . . . . . . 205<br />
4.5.3 Primality testing with Gaussian periods . . . . . . . . . 207<br />
4.5.4 A quartic time primality test . . . . . . . . . . . . . . . 213<br />
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217<br />
4.7 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 222<br />
5 EXPONENTIAL FACTORING ALGORITHMS 225<br />
5.1 Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225<br />
5.1.1 Fermat method . . . . . . . . . . . . . . . . . . . . . . . 225<br />
5.1.2 Lehman method . . . . . . . . . . . . . . . . . . . . . . 227<br />
5.1.3 Factor sieves . . . . . . . . . . . . . . . . . . . . . . . . 228<br />
5.2 Monte Carlo methods . . . . . . . . . . . . . . . . . . . . . . . 229<br />
5.2.1 Pollard rho method for factoring . . . . . . . . . . . . . 229<br />
5.2.2 Pollard rho method for discrete logarithms . . . . . . . 232<br />
5.2.3 Pollard lambda method for discrete logarithms . . . . . 233<br />
5.3 Baby-steps, giant-steps . . . . . . . . . . . . . . . . . . . . . . . 235<br />
5.4 Pollard p − 1 method . . . . . . . . . . . . . . . . . . . . . . . . 236<br />
5.5 Polynomial evaluation method . . . . . . . . . . . . . . . . . . 238<br />
5.6 Binary quadratic forms . . . . . . . . . . . . . . . . . . . . . . . 239<br />
5.6.1 Quadratic form fundamentals . . . . . . . . . . . . . . . 239<br />
5.6.2 Factoring with quadratic form representations . . . . . . 242<br />
5.6.3 Composition and the class group . . . . . . . . . . . . . 245<br />
5.6.4 Ambiguous forms and factorization . . . . . . . . . . . . 248<br />
5.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251<br />
5.8 Research problems . . . . . . . . . . . . . . . . . . . . . . . . . 255<br />
6 SUBEXPONENTIAL FACTORING ALGORITHMS 261<br />
6.1 The quadratic sieve factorization method . . . . . . . . . . . . 261<br />
6.1.1 Basic QS . . . . . . . . . . . . . . . . . . . . . . . . . . 261<br />
6.1.2 Basic QS: A summary . . . . . . . . . . . . . . . . . . . 266<br />
6.1.3 Fast matrix methods . . . . . . . . . . . . . . . . . . . . 268<br />
6.1.4 Large prime variations . . . . . . . . . . . . . . . . . . . 270<br />
6.1.5 Multiple polynomials . . . . . . . . . . . . . . . . . . . . 273<br />
6.1.6 Self initialization . . . . . . . . . . . . . . . . . . . . . . 274<br />
6.1.7 Zhang’s special quadratic sieve . . . . . . . . . . . . . . 276<br />
6.2 Number field sieve . . . . . . . . . . . . . . . . . . . . . . . . . 278<br />
6.2.1 Basic NFS: Strategy . . . . . . . . . . . . . . . . . . . . 279<br />
6.2.2 Basic NFS: Exponent vectors . . . . . . . . . . . . . . . 280