Prime Numbers
Prime Numbers Prime Numbers
7.5 Counting points on elliptic curves 355 if(P1 + P2 == O) return 0; // #E = p +1− t with t ≡ 0(modl). P3 = P0; for(1 ≤ k ≤ l/2) { if(X-coordinates of (P1 + P2) and P3 match) { if(Y -coordinates also match) return k; // Y -coordinate check. return l − k; } P3 = P3 + P0; } In the addition tests above for matching of some coordinate between (P1 +P2) and P3, one is asking generally whether (N1/D1,YM1/C1)+(N2/D2,YM2/C2) =(N3/D3,YM3/C3), and such a relation is to be checked, of course, using the usual elliptic addition rules. The polynomial P1 + P2 on the left can be combined—using the elliptic rules of Algorithm 7.2.2, with the coordinates in that algorithm being now, of course, our polynomial ratios—into polynomial form (N ′ /D ′ ,YM ′ /C ′ ), and this is compared with (N3/D3,YM3/C3).Forsuchcomparisoninturnone checks whether the cross products (N3D ′ − N ′ D3) and(M3C ′ − M ′ C3) both vanish mod (Ψl,p). As for the check on whether P1 + P2 = O, we are asking whether M1/C1 = −M2/C2, and this is also an easy cross product relation. The idea is that the entire implementation we are describing involves only polynomial multiplication and the mod (Ψl,p) reductions throughout. And as we have mentioned, both polynomial multiply and mod can be made quite efficient. In case an attempt is made by the reader to implement Algorithm 7.5.6, we give here some small cases within the calculation, for purpose of, shall we say, “algorithm debugging.” For p = 101 and the curve Y 2 = X 3 +3X +4 over Fp, the algorithm gives, for l selections l =2, 3, 5, 7, the results t mod 2 = 0, t mod 3 = 1, t mod 5 = 0, t mod 7 = 3, from which we infer #E = 92. (We might have skipped the prime l = 5, since the product of the other primes exceeds 4 √ p.) Along the way we have, for example, X p2 ,Y p2 [2](X, Y )= Ψ3 =98+16X +6X 2 + X 4 , = 32 + 17X +13X 2 +92X 3 , Y(74 + 96X +14X 2 +68X 3 ) , 2 12 + 53X +89X 16 + 12X +4X3 , Y 74 + 10X +5X2 +64X3 27 + 91X +96X2 +37X3 , (X p ,Y p )= 70 + 61X +83X 2 +44X 3 , Y(43 + 76X +21X 2 +25X 3 ) , where it will be observed that every polynomial appearing in the point coordinates has been reduced mod (Ψ3,p). (Note that p in Step [Analyze
356 Chapter 7 ELLIPTIC CURVE ARITHMETIC ...]is2,whichiswhyweconsider[2](X, Y ).)Itturnsoutthatthelastpoint here is indeed the elliptic sum of the two points previous, consistent with the claim that t mod 3 = 1. There is an important enhancement that we have intentionally left out for clarity. This is that prime powers work equally well. In other words, l = q a can be used directly in the algorithm (with the gcd for l = 2 ignored when l =4, 8, 16,...) to reduce the computation somewhat. All that is required is that the overall product of all prime-power values l used (but no more than one for each prime) exceed 4 √ p. We have been able to assess curve orders, via this basic Schoof scheme, for primes in the region p ≈ 10 80 ,byusingprimepowersl < 100. It is sometimes said in the literature that there is little hope of using l much larger than 30, say, but with the aforementioned enhancements—in particular the large-polynomial multiply/mod algorithms covered in Chapter 8.8—the Schoof prime l can be pressed to 100 and perhaps beyond. By not taking Algorithm 7.5.6 all the way to CRT saturation (that is, not handling quite enough small primes l to resolve the order), and by then employing a Shanks–Mestre approach to finish the calculation based on the new knowledge of the possible orders, one may, in turn, press this rough bound of 10 80 further. However, it is a testimony to the power of the Schoof algorithm that, upon analysis of how far a “Shanks–Mestre boost” can take us, we see that only a few extra decimal digits—say 10 or 20 digits—can be added to the 80 digits we resolve using the Schoof algorithm alone. For such reasons, it usually makes more practical sense to enhance an existing Schoof implementation, rather than to piggyback a Shanks–Mestre atop it. But can one carry out point counting for significantly larger primes? Indeed, the transformation of the Schoof algorithm into a “Schoof–Elkies– Atkin” (SEA) variant (see [Atkin 1986, 1988, 1992] and [Elkies 1991, 1997], with computational enhancements in [Morain 1995], [Couveignes and Morain 1994], [Couveignes et al. 1996]) has achieved unprecedented point-counting performance. The essential improvement of Elkies was to observe that for some of the l (depending on a, b, p; in fact, for about half of possible l values), a certain polynomial fl dividing Ψl but of degree only (l−1)/2 can be employed, and furthermore, that the Schoof relation of (7.10) can be simplified. The Elkies approach is to seek an eigenvalue λ with (X p ,Y p )=[λ](X, Y ), where all calculations are done mod (fl,p), whence #E = p +1− t with t ≡ λ + p/λ (mod l). Because the degrees of fl are so small, this important discovery effectively pulls some powers of ln p off the complexity estimate, to yield O(ln 6 p) rather than the original Schoof complexity O(ln 8 p) [Schoof 1995]. (Note, however, that such estimates assume direct “grammar-school” multiplication of integers, and can be reduced yet further in the power of ln.) The SEA ideas certainly give
- Page 314 and 315: 304 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 316 and 317: 306 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 318 and 319: 308 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 320 and 321: 310 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 322 and 323: 312 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 324 and 325: 314 Chapter 6 SUBEXPONENTIAL FACTOR
- Page 326 and 327: 316 Chapter 6 SUBEXPONENTIAL FACTOR
- 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 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 378 and 379: 7.6 Elliptic curve primality provin
- 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
356 Chapter 7 ELLIPTIC CURVE ARITHMETIC<br />
...]is2,whichiswhyweconsider[2](X, Y ).)Itturnsoutthatthelastpoint<br />
here is indeed the elliptic sum of the two points previous, consistent with the<br />
claim that t mod 3 = 1.<br />
There is an important enhancement that we have intentionally left out for<br />
clarity. This is that prime powers work equally well. In other words, l = q a<br />
can be used directly in the algorithm (with the gcd for l = 2 ignored when<br />
l =4, 8, 16,...) to reduce the computation somewhat. All that is required is<br />
that the overall product of all prime-power values l used (but no more than<br />
one for each prime) exceed 4 √ p.<br />
We have been able to assess curve orders, via this basic Schoof scheme,<br />
for primes in the region p ≈ 10 80 ,byusingprimepowersl < 100. It is<br />
sometimes said in the literature that there is little hope of using l much<br />
larger than 30, say, but with the aforementioned enhancements—in particular<br />
the large-polynomial multiply/mod algorithms covered in Chapter 8.8—the<br />
Schoof prime l can be pressed to 100 and perhaps beyond.<br />
By not taking Algorithm 7.5.6 all the way to CRT saturation (that is,<br />
not handling quite enough small primes l to resolve the order), and by then<br />
employing a Shanks–Mestre approach to finish the calculation based on the<br />
new knowledge of the possible orders, one may, in turn, press this rough<br />
bound of 10 80 further. However, it is a testimony to the power of the Schoof<br />
algorithm that, upon analysis of how far a “Shanks–Mestre boost” can take<br />
us, we see that only a few extra decimal digits—say 10 or 20 digits—can be<br />
added to the 80 digits we resolve using the Schoof algorithm alone. For such<br />
reasons, it usually makes more practical sense to enhance an existing Schoof<br />
implementation, rather than to piggyback a Shanks–Mestre atop it.<br />
But can one carry out point counting for significantly larger primes?<br />
Indeed, the transformation of the Schoof algorithm into a “Schoof–Elkies–<br />
Atkin” (SEA) variant (see [Atkin 1986, 1988, 1992] and [Elkies 1991, 1997],<br />
with computational enhancements in [Morain 1995], [Couveignes and Morain<br />
1994], [Couveignes et al. 1996]) has achieved unprecedented point-counting<br />
performance. The essential improvement of Elkies was to observe that for some<br />
of the l (depending on a, b, p; in fact, for about half of possible l values), a<br />
certain polynomial fl dividing Ψl but of degree only (l−1)/2 can be employed,<br />
and furthermore, that the Schoof relation of (7.10) can be simplified. The<br />
Elkies approach is to seek an eigenvalue λ with<br />
(X p ,Y p )=[λ](X, Y ),<br />
where all calculations are done mod (fl,p), whence #E = p +1− t with<br />
t ≡ λ + p/λ (mod l).<br />
Because the degrees of fl are so small, this important discovery effectively pulls<br />
some powers of ln p off the complexity estimate, to yield O(ln 6 p) rather than<br />
the original Schoof complexity O(ln 8 p) [Schoof 1995]. (Note, however, that<br />
such estimates assume direct “grammar-school” multiplication of integers, and<br />
can be reduced yet further in the power of ln.) The SEA ideas certainly give