10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.2 Elliptic arithmetic 325<br />

with ECM, in which case inversion (mod n) for the composite n can be avoided<br />

altogether.<br />

As for explicit elliptic-curve arithmetic, we shall start for completeness<br />

with option (1), though the operations for this option are easy to infer directly<br />

from Definition 7.1.2. An important note: The operations are given here and<br />

in subsequent algorithms for underlying field F , although further work with<br />

“pseudocurves” as in factorization of composite n involves using the ring Zn<br />

with operations mod n instead of mod p, while extension to fields F p k involves<br />

straightforward polynomial or equivalent arithmetic, and so on.<br />

Algorithm 7.2.2 (Elliptic addition: Affine coordinates). We assume an elliptic<br />

curve E(F ) (see note preceding this algorithm), given by the affine equation<br />

Y 2 = X 3 + aX + b, where a, b ∈ F and the characteristic of the field F is not<br />

equal to 2 or 3. We represent points P as triples (x, y, z), where for an affine point,<br />

z =1and (x, y) lies on the affine curve, and for O, the point at infinity, z =0<br />

(the triples (0, 1, 0), (0, −1, 0), both standing for the same point). This algorithm<br />

provides functions for point negation, doubling, addition, and subtraction.<br />

1. [Elliptic negate function]<br />

neg(P ) return (x, −y, z);<br />

2. [Elliptic double function]<br />

double(P ) return add(P, P);<br />

3. [Elliptic add function]<br />

add(P1,P2){<br />

if(z1 == 0) return P2; // Point P1 = O.<br />

if(z2 == 0) return P1; // Point P2 = O.<br />

if(x1 == x2) {<br />

if(y1 + y2 == 0) return (0, 1, 0); // i.e., return O.<br />

m =(3x 2 1 + a)(2y1) −1 ; // Inversion in the field F .<br />

} else {<br />

m =(y2 − y1)(x2 − x1) −1 ; // Inversion in the field F .<br />

}<br />

x3 = m 2 − x1 − x2;<br />

return (x3,m(x1 − x3) − y1, 1);<br />

}<br />

4. [Elliptic subtract function]<br />

sub(P1,P2) return add(P1,neg(P2));<br />

In the case of option (2) using ordinary projective coordinates, consider<br />

the curve Y 2 Z = X 3 + aXZ 2 + bZ 3 and points Pi =[Xi,Yi,Zi] fori =1, 2.<br />

Rule (5) of Definition 7.1.2, for P1 + P2 when P1 = ±P2 and neither P1,P2 is<br />

O, becomes<br />

P3 = P1 + P2 =[X3,Y3,Z3],<br />

where<br />

X3 = α γ 2 ζ − α 2 β ,

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

Saved successfully!

Ooh no, something went wrong!