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 1 Modular and finite field arithmetic 1/40 2/40 Finite fields The
CNRS, LIRMM, Universit´ e Montpellier 2
1/40
2/40
◮ The order of a finite field is always a prime or a prime power ◮ If q = pk is a prime power, there exists a unique finite field of order
◮ p is called the field characteristic and Fp ⊂ Fpk ◮ If k = 1 the prime field Fp is the field of residue classes modulo p
◮ If k > 1: degree-k extension of Fp
◮ Finite fields GF(2k) are often called binary fields
3/40
◮ How do we represent the elements and how do we compute the basic
◮ What are the best know algorithms for arbitrary primes p? ◮ How do we represent the elements and how do we compute
◮ Are there any special finite fields for which these operations can be
4/40
◮ Single precision: 32 or 64 bits on current processors ; 8 or 16 bits on
◮ Large integers: base β expansion, array of word-size “integers”
◮ Polynomials: array of coefficients: A(X) = d−1 i=0 aiXi
5/40
◮ Addition, subtraction: O(n) ◮ Multiplication: M(n) ◮ Division: O(M(n))
6/40
◮ Addition, subtraction: O(n) ◮ Multiplication: M(n) ◮ Division: O(M(n))
◮ Scholar multiplication: M(n) = O(n2) ◮ Karatsuba multiplication: M(n) = O(nlog2 3) ◮ Toom-Cook r-way multiplication: M(n) = O(nlogr(2r−1)) ◮ FFT-based multiplication: M(n) = O(n log n log log n)
6/40
7/40
8/40
8/40
8/40
9/40
◮ Evaluation at 0, 1, ∞:
◮ Multiplication:
◮ Interpolation:
10/40
◮ View A, B as A0 + · · · + Ar−1xr−1 and B0 + · · · + Br−1xr−1
◮ Evaluate A(x) and B(x) at 2r − 1 distinct points ◮ Interpolate and compute C(β⌈n/r⌉)
11/40
12/40
14/40
15/40
16/40
17/40
18/40
19/40
20/40
21/40
21/40
◮ Partial products AB0 and AB1
◮ AB1 mod P: partial Barrett reduction (3n/2 → n)
◮ AB0β−n/2 mod P: partial Montgomery reduction (3n/2 → n)
22/40
◮ Ideal choice: P = βn ± 1
◮ Pseudo Mersenne: P = βn ± a, with a “small”
◮ Generalized Mersenne [Solinas 99]: P = f(2n) where f ∈ F2[X]
23/40
24/40
25/40
26/40
27/40
28/40
29/40
◮ If A and B are both even, then gcd(A, B) = 2 gcd(A/2, B/2) ◮ If A is even and B is not, then gcd(A, B) = gcd(A/2, B) ◮ If A and B are both odd, gcd(A, B) = gcd(|A − B|, min(A, B))
30/40
j
31/40
32/40
32/40
1
1
32/40
2, b′ 2
1, b′ 1
2, b′ 2 = HalfGcd(a′ 1, b′ 1)
1
1
2
2 32/40
2, b′ 2
1, b′ 1
2, b′ 2 = HalfGcd(a′ 1, b′ 1)
2, b′ 2)t ·2n/4 +M′ ·(a′ 0, b′ 0)t
1
1
2
2
32/40
aw−1 . . . . . . . . . . . . a1a0 . . . . . . . . . . . . . . . am−1 . . . a(t−1)w 000
33/40
34/40
35/40
35/40
36/40
37/40
38/40
◮ p = 2n − c with |c| ≤ n/2 ◮ there exists a ∈ Fp s.t. f(X) = Xm − a is irreducible
39/40
Modern Computer Arithmetic. Cambridge University Press, 2010.
Handbook of Elliptic and Hyperelliptic Curve Cryptography. CRC Press, 2005.
Prime Numbers. A Computational Perspective. Springer, 2001.
Guide to Elliptic Curve Cryptography. Springer, 2004.
The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. Addison-Wesley, Reading, MA, third edition, 1997.
Handbook of applied cryptography. CRC Press, 1997.
Modern Computer Algebra. Cambridge University Press, 1999.
40/40