10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

342 Chapter 7 ELLIPTIC CURVE ARITHMETIC<br />

in hand a precomputed, stored set of difference multiples [∆]Q =[X∆ : Z∆],<br />

where ∆ has run over some relatively small finite set {2, 4, 6,...}; then a prime<br />

s near to but larger than r can be checked as the outlying prime, by noting<br />

that a “successful strike”<br />

[s]Q =[r +∆]Q = O<br />

can be tested by checking whether the cross product<br />

XrZ∆ − X∆Zr<br />

has a nontrivial gcd with n. Thus, armed with enough multiples [∆]Q, and<br />

a few occasional points [r]Q, we can check outlying prime candidates with 3<br />

multiplies (mod n) per candidate. Indeed, beyond the 2 multiplies for the cross<br />

product, we need to accumulate the product (XrZ∆−X∆Zr) in expectation<br />

of a final gcd of such a product with n. But one can reduce the work still<br />

further, by observing that<br />

XrZ∆ − X∆Zr =(Xr − X∆)(Zr + Z∆)+X∆Z∆ − XrZr.<br />

Thus, one can store precomputed values X∆,Z∆,X∆Z∆, and use isolated<br />

values of Xr,Zr,XrZr for well-separated primes r, to bring the cost of<br />

stage two asymptotically down to 2 multiplies (mod n) per outlying prime<br />

candidate, one for the right-hand side of the identity above and one for<br />

accumulation.<br />

As exemplified in [Brent et al. 2000], there are even more tricks for<br />

such reduction of stage-two ECM work. One of these is also pertinent to<br />

enhancement (3) above, and amounts to mixing into various identities the<br />

notion of transform-based multiplication (see Section 9.5.3). These methods<br />

are most relevant when n is sufficiently large, in other words, when n is in<br />

the region where transform-based multiply is superior to “grammar-school”<br />

multiply. In the aforementioned identity for cross products, one can actually<br />

store transforms (for example DFT’s)<br />

ˆXr, ˆ Zr,<br />

in which case the product (Xr − X∆)(Zr + Z∆) now takes only 1/3 of<br />

a (transform-based) multiply. This dramatic reduction is possible because<br />

the single product indicated is to be done in spectral space, and so is<br />

asymptotically free, the inverse transform alone accounting for the 1/3. Similar<br />

considerations apply to the accumulation of products; in this way one can get<br />

down to about 1 multiply per outlying prime candidate. Along the same lines,<br />

the very elliptic arithmetic itself admits of transform enhancement. Under the<br />

Montgomery parameterization in question, the relevant functions for curve<br />

arithmetic degenerate nicely and are given by equations (7.6) and (7.7); and<br />

again, transform-based multiplication can bring the 6 multiplies required for<br />

addh() down to 4 transform-based multiplies, with similar reduction possible<br />

for doubleh() (see remarks following Algorithm 7.4.4).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!