Efficient Finite Field and Elliptic Curve Arithmetic
Laurent Imbert
CNRS, LIRMM, Universit´ e Montpellier 2
Efficient Finite Field and Elliptic Curve Arithmetic Laurent Imbert - - PowerPoint PPT Presentation
Efficient Finite Field and Elliptic Curve Arithmetic Laurent Imbert CNRS, LIRMM, Universit e Montpellier 2 Summer School ECC 2011 Nancy, September 12-16, 2011 Part 2 Elliptic curve arithmetic 1/41 The two facets of an elliptic curve
CNRS, LIRMM, Universit´ e Montpellier 2
1/41
◮ a geometrical object: a nonsingular curve given by an equation
◮ an algebraic object: one can “add” stuff! This composition
2/41
3/41
◮ An elliptic curve over a field K of characteristic = 2, 3 is given by an
◮ The set of K-rational points of an elliptic curve is
◮ In the general case, we consider the long Weierstrass form
4/41
1 + a
5/41
◮ P + O = O + P = P ◮ P + (−P) = O ◮ (P + Q) + R = P + (Q + R) ◮ P + Q = Q + P
◮ the group operation is easy to implement (basic algebraic
◮ if K is a well chosen finite field, the computation of discrete
q)1
1Vanessa’s lecture 6/41
2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36
7/41
◮ Prime fields Fp, where p is a nice prime (software implementations)
◮ Binary fields F2m = F2[X]/(f(X)), where f(X) is a nice ireducible
◮ Alternatives: Fpm where both p and the irreducible polynomial have
8/41
◮ #E(Fq) = h × n ◮ n is prime, h is small (ideally h = 1) ◮ n > 2160 to avoid BSGS/Pollard ρ attacks in O(√n) ◮ n = p to avoid anomalous attack ◮ qt ≡ 1 (mod n) for all t ≤ 20 to avoid the MOV attack ◮ m is prime to avoid Weil descent attacks
9/41
25 n 3,000 2,500 2,000 1,000 1,500 100 500 50 75 125
10/41
◮ # field addition/subtraction (A) ◮ # field multiplications (M) ◮ # field squarings (S) ◮ # field inversions (I) ◮ # “small” field multiplications (e.g. (a))
◮ A ≪ M ◮ Over Fp: S ≈ 0.8M,
◮ Over F2m: S ≪ M (negligible)
11/41
◮ Identity: P + O = P and P + (−P) = O for all P ∈ E(K) ◮ Point negation: Let P = (x1, y1) ∈ E(K). Then −P = (x, −y) ◮ Point addition: Let P = (x1, y1), Q = (x2, y2) with P = ±Q. Then
◮ Point doubling: If P = (x1, y1), where P = −P. Then
1 + a
1 + a
12/41
13/41
14/41
15/41
1 and y1 by Y1/Z3 1 in the affine doubling formula
3 : Y ′ 3 : 1), with
3 = (3X2 1 + aZ4 1)2 − 8X1Y 2 1
1 Z2 1
3 = 3X2 1 + aZ4 1
1
3
1
3Z2 3 and
3Z3 3 to get (X3 : Y3 : Z3)
1 + aZ4 1)2 − 8X1Y 2 1
1 + aZ4 1)(4X1Y 2 1 − X3) − 8Y 4 1
16/41
◮ Common-subexpression elimination ◮ Trade multiplication for squarings: 2XY = (X + Y )2 − X2 − Y 2 ◮ Curve parameters: If a = −3, 3X2 1 + aZ4 1 can be computed as a
◮ Add redundancy: Modified Jacobian: (X : Y : Z : T), x = X/Z2,
◮ Mixed formula (Z = 1) ◮ Readdition ◮ co-Z formula ◮ etc.
17/41
18/41
19/41
20/41
n
21/41
n, k′ n−1, . . . , k′ 0)SD2
i ← ci + ki − 2ci+1
n, k′ n−1, . . . , k′ 0)
22/41
23/41
24/41
i=0 ki2i, with each ki = 0 is odd, |ki| < 2w−1, at
◮ k has a unique width-w NAF, denoted NAFw(k). ◮ NAF2(k) = NAF(k) ◮ Length: at most n + 1 digits if |k| = n ◮ Average density: 1/(w + 1)
25/41
26/41
m−1
◮ Yao/Meloni’s algorithm ◮ Hybrid binary-ternary ◮ Tree-based approach ◮ Multi-base (see Patrick Longa’s talk at ECC) ◮ etc.
27/41
28/41
29/41
1
1
t
t
t
30/41
◮ H. M. Edwards, Bulletin of the AMS, 2007
◮ D. Bernstein and T. Lange introduced parameter d to cover more
31/41
◮ Addition: (x1, y1) + (x2, y2) = (x3, y3)
◮ Neutral element: affine point of coordinates (0, c) ◮ Negative of a point: −(x, y) = (−x, y) ◮ Doubling: [2](x, y) =
32/41
◮ If d is not a square then Edwards addition law is complete
◮ Formula is correct for all affine point including (0, c) , P + (−P). ◮ Doubling formula is exactly identical to addition formula
33/41
34/41
1
1
1
35/41
36/41
◮ Timing attacks ◮ Simple power analysis ◮ Differential power analysis ◮ Electromagnetic analysis ◮ etc.
◮ Unified formulæ ◮ Double-and-always-add ◮ Atomic blocks ◮ Randomization ◮ etc.
37/41
38/41
39/41
40/41
41/41