Prime Numbers
Prime Numbers Prime Numbers
7.6 Elliptic curve primality proving (ECPP) 369 constant k. Their idea is to find appropriate curves with orders that have large enough “probable prime” factors, and recurse on the notion that these factors should in turn be provably prime. In each recursive level but the last, Theorem 7.6.1 is used with s the probable prime factor of the curve order. This continues for smaller and smaller probable primes, until the number is so small it may be proved prime by trial division. This, in turn, justifies all previous steps, and establishes the primality of the starting number n. Algorithm 7.6.2 (Goldwasser–Kilian primality test). Given a nonsquare integer n>2 32 strongly suspected of being prime (in particular, gcd(n, 6) = 1 and presumably n has already passed a probable prime test), this algorithm attempts to reduce the issue of primality of n to that of a smaller number q. The algorithm returns either the assertion “n is composite” or the assertion “If q is prime then n is prime,” where q is an integer smaller than n. 1. [Choose a pseudocurve over Zn] Choose random (a, b) ∈ [0,n− 1] 2 such that gcd(4a 3 +27b 2 ,n)=1; 2. [Assess curve order] Via Algorithm 7.5.6 calculate the integer m that would be #Ea,b(Zn) if n is prime (however if the point-counting algorithm fails, return “n is composite”); // If n is composite, Algorithm 7.5.6 could fail if each candidate for t (mod l) is rejected or if the final curve order is not in the interval (n +1− 2 √ n, n +1+2 √ n). 3. [Attempt to factor] Attempt to factor m = kq where k>1 and q is a probable prime exceeding n 1/4 +1 2 , but if this cannot be done according to some time-limit criterion, goto [Choose a pseudocurve ...]; 4. [Choose point on Ea,b(Zn)] Choose random x ∈ [0,n− 1] such that Q =(x3 + ax + b) modnhas Q n = −1; Apply Algorithm 2.3.8 or 2.3.9 (with a = Q and p = n) to find an integer y that would satisfy y2 ≡ Q (mod n) if n were prime; if(y2 mod n = Q) return “n is composite”; P =(x, y); 5. [Operate on point] Compute the multiple U =[m/q]P (however if any illegal inversions occur, return “n is composite”); if(U == O) goto [Choose point ...]; Compute V =[q]U (however check the above rule on illegal inversions); if(V = O) return “n is composite”; return “If q is prime, then n is prime”; The correctness of Algorithm 7.6.2 follows directly from Theorem 7.6.1, with q playing the role of s in that theorem.
370 Chapter 7 ELLIPTIC CURVE ARITHMETIC In practice one would iterate the algorithm, getting a chain of inferences, with the last number q so small it can be proved prime by trial division. If some intermediate q is composite, then one can retreat one level in the chain and apply the algorithm again. Iterating the Goldwasser–Kilian scheme not only provides a rigorous primality test but also generates a certificate of primality. This certificate can be thought of as the chain (n = n0,a0,b0,m0,q0,P0), (q0 = n1,a1,b1,m1,q1,P1),... consisting of consecutive n, a, b, m, q, P entities along the recursion. The primary feature of the certificate is that it can be published alongside, or otherwise associated with, the original n that is proven prime. This concise listing can then be used by anyone who wishes to verify that n is prime, using Theorem 7.6.1 at the various steps along the way. The reconstruction of the proof usually takes considerably less time than the initial run that finds the certificate. The certificate feature is nontrivial, since many primality proofs must be run again from scratch if they are to be checked. It should be noted that the elliptic arithmetic in Algorithm 7.6.2 can be sped up using Montgomery coordinates [X : Z] with“Y ”dropped,as discussed in Section 7.2. To aid in the reader’s testing of any implementations, we now report a detailed example. Let us take the prime p =10 20 + 39. On the first pass of Algorithm 7.6.2, we use n = p and obtain random parameters in Step [Choose a pseudocurve ...]as a = 69771859804340235254, b = 10558409492409151218, for which 4a 3 +27b 2 is coprime to n. The number that would be the order of Ea,b(Zn) ifn is indeed prime is found, via Algorithm 7.5.6 to be m =#E = 99999999985875882644 = 2 2 · 59 · 1182449 · q, where 2, 59, 1182449 are known primes (falling below the threshold 2 32 suggested in the algorithm description), and q = 358348489871 is a probable prime. Then, in Step [Choose point ...] the random point obtained is P =[X : Z] = [31689859357184528586 : 1], where for practical simplicity we have adopted Montgomery parameterization, with a view to using Algorithm 7.2.7 for elliptic multiples. Accordingly, it was found that U =[m/q]P = [69046631243878263311 : 1] = O, V =[q]U = O. Therefore, p is prime if q is. So now we assign n = 358348489871 and run again through Algorithm 7.6.2. In so doing the relevant values encountered are a = 34328822753, b = 187921935449, m =#E = 358349377736 = 2 3 · 7 · 7949 · 805019,
- Page 328 and 329: Chapter 7 ELLIPTIC CURVE ARITHMETIC
- Page 330 and 331: 7.1 Elliptic curve fundamentals 321
- Page 332 and 333: 7.2 Elliptic arithmetic 323 the poi
- Page 334 and 335: 7.2 Elliptic arithmetic 325 with EC
- Page 336 and 337: 7.2 Elliptic arithmetic 327 Algorit
- Page 338 and 339: 7.2 Elliptic arithmetic 329 Before
- Page 340 and 341: 7.2 Elliptic arithmetic 331 the “
- Page 342 and 343: 7.3 The theorems of Hasse, Deuring,
- Page 344 and 345: 7.4 Elliptic curve method 335 a ran
- Page 346 and 347: 7.4 Elliptic curve method 337 B1 =
- Page 348 and 349: 7.4 Elliptic curve method 339 facto
- Page 350 and 351: 7.4 Elliptic curve method 341 propa
- Page 352 and 353: 7.4 Elliptic curve method 343 As fo
- Page 354 and 355: 7.4 Elliptic curve method 345 if(1
- Page 356 and 357: 7.5 Counting points on elliptic cur
- Page 358 and 359: 7.5 Counting points on elliptic cur
- Page 360 and 361: 7.5 Counting points on elliptic cur
- Page 362 and 363: 7.5 Counting points on elliptic cur
- Page 364 and 365: 7.5 Counting points on elliptic cur
- Page 366 and 367: 7.5 Counting points on elliptic cur
- Page 368 and 369: 7.5 Counting points on elliptic cur
- Page 370 and 371: 7.5 Counting points on elliptic cur
- Page 372 and 373: 7.5 Counting points on elliptic cur
- Page 374 and 375: 7.5 Counting points on elliptic cur
- Page 376 and 377: 7.5 Counting points on elliptic cur
- Page 380 and 381: 7.6 Elliptic curve primality provin
- Page 382 and 383: 7.6 Elliptic curve primality provin
- Page 384 and 385: 7.7 Exercises 375 7.4. As in Exerci
- Page 386 and 387: 7.7 Exercises 377 (some Bj equals A
- Page 388 and 389: 7.7 Exercises 379 This reduction ig
- Page 390 and 391: 7.8 Research problems 381 multiply-
- Page 392 and 393: 7.8 Research problems 383 highly ef
- Page 394 and 395: 7.8 Research problems 385 is prime.
- Page 396 and 397: Chapter 8 THE UBIQUITY OF PRIME NUM
- Page 398 and 399: 8.1 Cryptography 389 is, if an orac
- Page 400 and 401: 8.1 Cryptography 391 Algorithm 8.1.
- Page 402 and 403: 8.1 Cryptography 393 just to genera
- Page 404 and 405: 8.1 Cryptography 395 where in the l
- Page 406 and 407: 8.2 Random-number generation 397 ar
- Page 408 and 409: 8.2 Random-number generation 399 Al
- Page 410 and 411: 8.2 Random-number generation 401 }
- Page 412 and 413: 8.2 Random-number generation 403 is
- Page 414 and 415: 8.3 Quasi-Monte Carlo (qMC) methods
- Page 416 and 417: 8.3 Quasi-Monte Carlo (qMC) methods
- Page 418 and 419: 8.3 Quasi-Monte Carlo (qMC) methods
- Page 420 and 421: 8.3 Quasi-Monte Carlo (qMC) methods
- Page 422 and 423: 8.3 Quasi-Monte Carlo (qMC) methods
- Page 424 and 425: 8.4 Diophantine analysis 415 [Tezuk
- Page 426 and 427: 8.4 Diophantine analysis 417 9262 3
7.6 Elliptic curve primality proving (ECPP) 369<br />
constant k. Their idea is to find appropriate curves with orders that have<br />
large enough “probable prime” factors, and recurse on the notion that these<br />
factors should in turn be provably prime. In each recursive level but the last,<br />
Theorem 7.6.1 is used with s the probable prime factor of the curve order.<br />
This continues for smaller and smaller probable primes, until the number is<br />
so small it may be proved prime by trial division. This, in turn, justifies all<br />
previous steps, and establishes the primality of the starting number n.<br />
Algorithm 7.6.2 (Goldwasser–Kilian primality test). Given a nonsquare<br />
integer n>2 32 strongly suspected of being prime (in particular, gcd(n, 6) = 1<br />
and presumably n has already passed a probable prime test), this algorithm attempts<br />
to reduce the issue of primality of n to that of a smaller number q. The<br />
algorithm returns either the assertion “n is composite” or the assertion “If q is<br />
prime then n is prime,” where q is an integer smaller than n.<br />
1. [Choose a pseudocurve over Zn]<br />
Choose random (a, b) ∈ [0,n− 1] 2 such that gcd(4a 3 +27b 2 ,n)=1;<br />
2. [Assess curve order]<br />
Via Algorithm 7.5.6 calculate the integer m that would be #Ea,b(Zn) if<br />
n is prime (however if the point-counting algorithm fails, return “n is<br />
composite”);<br />
// If n is composite, Algorithm 7.5.6 could fail if each candidate for t<br />
(mod l) is rejected or if the final curve order is not in the interval<br />
(n +1− 2 √ n, n +1+2 √ n).<br />
3. [Attempt to factor]<br />
Attempt to factor m = kq where k>1 and q is a probable prime exceeding<br />
n 1/4 +1 2 , but if this cannot be done according to some time-limit<br />
criterion, goto [Choose a pseudocurve ...];<br />
4. [Choose point on Ea,b(Zn)]<br />
Choose random x ∈ [0,n− 1] such that Q =(x3 + ax + b) modnhas Q<br />
n = −1;<br />
Apply Algorithm 2.3.8 or 2.3.9 (with a = Q and p = n) to find an integer<br />
y that would satisfy y2 ≡ Q (mod n) if n were prime;<br />
if(y2 mod n = Q) return “n is composite”;<br />
P =(x, y);<br />
5. [Operate on point]<br />
Compute the multiple U =[m/q]P (however if any illegal inversions occur,<br />
return “n is composite”);<br />
if(U == O) goto [Choose point ...];<br />
Compute V =[q]U (however check the above rule on illegal inversions);<br />
if(V = O) return “n is composite”;<br />
return “If q is prime, then n is prime”;<br />
The correctness of Algorithm 7.6.2 follows directly from Theorem 7.6.1, with<br />
q playing the role of s in that theorem.