Академический Документы
Профессиональный Документы
Культура Документы
3™/D2
2DrafttxtTrialUsetxtGorRPorSTD for
3varTitlePAR
4
5 Annex A (informative)
6 Number-Theoretic Background
7
9varCommittee Committee
14This document is an unapproved draft of a proposed IEEE Standard. As such, this document is subject to
15change. USE AT YOUR OWN RISK! Because this is an unapproved draft, this document must not be
16utilized for any conformance/compliance purposes. Permission is hereby granted for IEEE Standards
17Committee participants to reproduce this document for purposes of international standardization
18consideration. Prior to adoption of this document, in whole or in part, by another standards development
19organization, permission must first be obtained from the IEEE Standards Activities Department
20(stds.ipr@ieee.org). Other entities seeking permission to reproduce this document, in whole or in part, must
21also obtain permission from the IEEE Standards Activities Department.
22IEEE Standards Activities Department
23445 Hoes Lane
24Piscataway, NJ 08854, USA
1 1
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1Abstract: This standard specifies common identity-based public-key cryptographic techniques that use
2pairings, including mathematical primitives for secret value (key) derivation, public-key encryption, and
3digital signatures, and cryptographic schemes based on those primitives. It also specifies related
4cryptographic parameters, public keys and private keys. The purpose of this standard is to provide a
5reference for specifications of a variety of techniques from which applications may select.
6Keywords: Public-key cryptography, encryption, identity-based encryption, pairing-based encryption,
7pairing-based cryptography.
8
9
34A.12. Pairings.............................................................................................................................................55
35A.12.1. Pairing Types...............................................................................................................................55
36A.12.2. The Miller Loop..........................................................................................................................55
37A.12.3. Pairing Calculations....................................................................................................................56
38A.12.4. The Weil Pairing.........................................................................................................................56
39A.12.5. Tate..............................................................................................................................................56
40A.12.6. Eta................................................................................................................................................56
41A.12.7. Ate...............................................................................................................................................57
42A.12.8. R-Ate...........................................................................................................................................57
1 4
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.1. Integer and Modular Arithmetic: Overview
2A.1.1. Modular arithmetic
4Modular arithmetic is based on a fixed integer m > 1 called the modulus. The fundamental operation is
5reduction modulo m. To reduce an integer a modulo m, one divides a by m and takes the remainder r. This
6operation is written
7 r := a mod m.
10 11 mod 8 = 3
11 7 mod 9 = 7
12 –2 mod 11 = 9
13 12 mod 12 = 0
14A.1.1.2. Congruences
15Two integers a and b are said to be congruent modulo m if they have the same result upon reduction
16modulo m. This relationship is written
17 a º b (mod m).
18Two integers are congruent modulo m if and only if their difference is divisible by m.
19Example:
20 11 º 19 (mod 8).
23 a0 + a1 º b0 + b1 (mod m)
24 a0 – a1 º b0 – b1 (mod m)
25 a0a1 º b0b1 (mod m).
27The integers modulo m are the possible results of reduction modulo m. Thus the set of integers modulo m
28is
29 Zm = {0, 1, …, m – 1}.
30One performs addition, subtraction, and multiplication on the set Zm by performing the corresponding
31integer operation and reducing the result modulo m. For example, in Z7
1 5
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 3=6+4
2 5=1–3
3 6 = 4 ´ 5.
5If v is a positive integer and g is an integer modulo m, then modular exponentiation is the operation of
6computing gv mod m (also written exp (g, v) mod m). Section A.2.1. contains an efficient method for
7modular exponentiation.
9If m and h are integers, the greatest common divisor (or G.C.D.) is the largest positive integer d dividing
10both m and h. If d = 1, then m and h are said to be relatively prime (or coprime). Section A.2.2. contains an
11efficient method for computing the G.C.D.
12The least common multiple (or L.C.M.) is the smallest positive integer l divisible by both m and h. The
13G.C.D. and L.C.M. are related by
15(for h and m positive), so that the L.C.M. is easily computed if the G.C.D. is known.
17The multiplicative inverse of h modulo m is the integer k modulo m such that hk º 1 (mod m). The
18multiplicative inverse of h is commonly written h–1 (mod m). It exists if h is relatively prime to m and not
19otherwise.
20If g and h are integers modulo m, and h is relatively prime to m, then the modular quotient g/h modulo m is
21the integer gh–1 mod m. If c is the modular quotient, then c satisfies g º hc (mod m).
22The process of finding the modular quotient is called modular division. Section A.2.2. contains an efficient
23method for modular division.
26In the case in which m equals a prime p, the set Zp forms a prime finite field and is denoted GF (p).
27In the finite field GF (p), modular division is possible for any denominator other than 0. The set of nonzero
28elements of GF (p) is denoted GF (p)*.
29A.1.2.2. Orders
30The order of an element c of GF (p)* is the smallest positive integer v such that cv º 1 (mod p). The order
31always exists and divides p – 1. If k and l are integers, then ck º cl (mod p) if and only if k º l (mod v).
32A.1.2.3. Generators
33If v divides p – 1, then there exists an element of GF (p)* having order v. In particular, there always exists
34an element g of order p – 1 in GF (p)*. Such an element is called a generator for GF (p)* because every
1 6
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1element of GF (p)* is some power of g. In number-theoretic language, g is also called a primitive root for
2p.
4Suppose that the element g of GF (p)* has order v. Then an element h of GF (p)* satisfies
5 h º g l (mod p)
6for some l if and only if h v º 1 (mod p). The exponent l is called the discrete logarithm of h (with respect
7to the base g). The discrete logarithm is an integer modulo v.
a
10If p > 2 is prime, and a is any integer, then the Legendre symbol is defined as follows. If p divides a,
p
a a
11then = 0. If p does not divide a, then equals 1 if a is a square modulo p and –1 otherwise.
p p
12(Despite the similarity in notation, a Legendre symbol should not be confused with a rational fraction; the
13distinction must be made from the context.)
16Let p be an odd prime, and let g be an integer with 0 £ g < p. A square root modulo p of g is an integer z
17with 0 £ z < p and
18 z 2 º g (mod p).
g
19The number of square roots modulo p of g is 1+J, where J is the Jacobi symbol .
p
20If g = 0, then there is one square root modulo p, namely z = 0. If g ¹ 0, then g has either 0 or 2 square roots
21modulo p. If z is one square root, then the other is p – z.
22A procedure for computing square roots modulo a prime is given in A.2.5..
25Modular exponentiation can be performed efficiently by the binary method outlined below.
27Output: gv mod m.
28
291. Let v = vrvr–1...v1v0 be the binary representation of v, where the most significant bit vr of v is 1.
1 7
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
12. Set x ¬ g.
23. For i from r – 1 downto 0 do
3 3.1 Set x ¬ x2 mod m.
4 3.2 If vi = 1 then set x ¬ gx mod m.
54. Output x.
6There are several modifications that improve the performance of this algorithm. These methods are
7summarized in [Gor98].
9The following algorithm computes efficiently the G.C.D. d of m and h. If m and h are relatively prime, the
10algorithm also finds the quotient g/h modulo m.
11Input: an integer m > 1 and integers g and h > 0. (If only the G.C.D. of m and h is desired, no input g is
12required.)
13Output: the G.C.D. d of m and h and, if d = 1, the integer c with 0 < c < m and c º g/h (mod m).
14
151. If h = 1 then output d := 1 and c := g and stop.
162. Set r0 ¬ m.
173. Set r1 ¬ h mod m.
184. Set s0 ¬ 0.
195. Set s1 ¬ g mod m.
206. While r1 > 0
21 6.1 Set q ¬ ë r0 / r1û.
22 6.2 Set r2 ¬ r0 – qr1 mod m
23 6.3 Set s2 ¬ s0 – qs1 mod m
24 6.4 Set r0 ¬ r1
25 Set r1 ¬ r2
26 Set s0 ¬ s1
27 Set s1 ¬ s2
287. Output d : = r0.
298. If r0 = 1 then output c := s0
30If m is prime, the quotient exists provided that h ( 0 (mod m), and can be found efficiently using
31exponentiation via
32 c := g hm–2 mod m.
a
36Output: the Legendre symbol .
p
37
381. Set x ¬ a, y ¬ p, L ¬ 1
392. While y > 1
40 2.1 Set x ¬ (x mod y)
41 2.2 If x > y/2 then
1 8
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 2.2.1 Set x ¬ y – x.
2 2.2.2 If y º 3(mod 4) then set L ¬ –L
3 2.3 If x = 0 then set x ¬ 1, y ¬ 0, L ¬ 0
4 2.4 While 4 divides x
5 2.4.1 Set x ¬ x/4
6 2.5 If 2 divides x then
7 2.5.1 Set x ¬ x/2.
8 2.5.2 If y º ± 3 (mod 8) then set L¬ –L
9 2.6 If x º 3 (mod 4) and y º 3 (mod 4) then set L ¬ –L
10 2.7 Switch x and y
113. Output L
12The Legendre symbol can also be found efficiently using exponentiation via
a
13 := a (p – 1)/2 mod p.
p
17This recursion is adequate for computing Vk for small values of k. For large k, one can compute Vk modulo
18an odd integer n > 2 using the following algorithm (see [JQ96]). The algorithm also computes the quantity
19Q ëk/2û mod n; this quantity will be useful in the application given in A.2.5..
20Input: an odd integer n > 2, integers P and Q, and a positive integer k.
39Output: a square root modulo p of g if one exists. (In Case III, the message “no square roots exist” is
40returned if none exists.)
1 9
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1
2I. p º 3 (mod 4), that is p = 4k + 3 for some positive integer k. (See [Leh69].)
3 1. Compute (via A.2.1.) and output z := g k + 1 mod p.
4II. p º 5 (mod 8), that is p = 8k + 5 for some positive integer k. (See [Atk92].)
5 1. Compute g := (2g)k mod p via A.2.1.
6 2. Compute i := 2gg 2 mod p
7 3. Compute and output z := gg (i – 1) mod p
8III p º 1 (mod 8). (See [Leh69].)
9 1. Set Q ¬ g.
10 2. Generate a value P with 0 < P < p not already chosen.
11 3. Compute via A.2.4. the quantities
18NOTES
191—To perform the modular division of an integer V by 2 (needed in Step 4 of case III), one can simply divide by 2 the
20integer V or V + p (whichever is even). (The integer division by 2 can be accomplished by shifting the binary
21expansion of the dividend by one bit.)
222—As written, the algorithm for Case III works for all p º 1 (mod 4), although it is less efficient than the algorithm for
23Case II when p º 5 (mod 8).
243—In Case III, a given choice of P will produce a solution if and only if P 2 – 4Q is not a quadratic residue modulo p.
25If P is chosen at random, the probability of this is at least 1/2. Thus only a few values of P will be required. It may
26therefore be possible to speed up the process by restricting to very small values of P and implementing the
27multiplications by P in A.2.4. by repeated addition.
284—In cases I and II, the algorithm produces a solution z provided that one exists. If it is unknown whether a solution
29exists, then the output z should be checked by comparing w := z 2 mod p with g. If w = g, then z is a solution; otherwise
30no solutions exist. In case III, the algorithm performs the determination of whether or not a solution exists.
35 a = ar–1...a1a0,
36 b = br–1...b1b0,
37 h = hr–1...h1h0.
38Input: an integer r > 2, and a positive integer a º 1 (mod 8) less than 2r.
39Output: the positive integer b less than 2r–2 such that b2 º a (mod 2r).
40
411. Set h ¬ 1.
422. Set b ¬ 1.
433. For j from 2 to r – 2 do
44 If hj+1 ¹ aj+1 then
45 Set bj ¬ 1.
1 10
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 If 2j < r
2 then h ¬ (h + 2j+1b – 22j) mod 2 r.
3 else h ¬ (h + 2j+1b) mod 2 r.
44. If br–2 = 1 then set b ¬ 2r–1 – b.
55. Output b.
7Let p be a prime and let g satisfy 1 < g < p. The following algorithm determines the order of g modulo p
8when the factorization of p-1 is known.
18Let p be a prime and let T divide p – 1. The following algorithm generates an element of GF (p) of order T
19when the factorization of p-1 is known.
29A finite field (or Galois field) is a set with finitely many elements in which the usual algebraic operations
30(addition, subtraction, multiplication, division by nonzero elements) are possible, and in which the usual
31algebraic laws (commutative, associative, distributive) hold. The order of a finite field is the number of
32elements it contains. If q > 1 is an integer, then a finite field of order q exists if q is a prime power and not
33otherwise.
34The finite field of a given order is unique, in the sense that any two fields of order q display identical
35algebraic structure. Nevertheless, there are often many ways to represent a field. It is traditional to denote
36the finite field of order q by Fq or GF (q); this Standard uses the latter notation for typographical reasons. It
37should be borne in mind that the expressions “the field GF (q)” and “the field of order q” usually imply a
38choice of field representation.
39In pairing based cryptography one makes use of GF(pn) for various n and p.
1 11
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.3.2. Polynomials over Finite Fields
2A polynomial over GF (q) is a polynomial with coefficients in GF (q). Addition and multiplication of
3polynomials over GF (q) are defined as usual in polynomial arithmetic, except that the operations on the
4coefficients are performed in GF (q).
5A polynomial over the prime field GF (p) is commonly called a polynomial modulo p. Addition and
6multiplication are the same as for polynomials with integer coefficients, except that the coefficients of the
7results are reduced modulo p.
9 (t 2 + 4t + 5) + (t 3 + t + 3) = t 3 + t 2 + 5t + 1
10 (t 2 + 3t + 4) (t + 4) = t 3 + 2t + 2.
13 (t 3 + 1) + (t 3 + t) = t + 1
14 (t 2 + t + 1) (t +1) = t 3 + 1.
15A polynomial over GF (q) is reducible if it is the product of two smaller degree polynomials over GF (q);
16otherwise it is irreducible. For instance, the above examples show that t 3 + 2t + 2 is reducible over GF (7)
17and that the binary polynomial t 3 + 1 is reducible.
18Every nonzero polynomial over GF (q) has a unique representation as the product of powers of irreducible
19polynomials. (This result is analogous to the fact that every positive integer has a unique representation as
20the product of powers of prime numbers.) The degree-1 factors correspond to the roots of the polynomial.
22Modular reduction and congruences can be defined among polynomials over GF (q), in analogy to the
23definitions for integers given in A.1.1.. To reduce a polynomial a (t) modulo a nonconstant polynomial
24m (t), one divides a (t) by m (t) by long division of polynomials and takes the remainder r (t). This
25operation is written
27The remainder r (t) must either equal 0 or have degree smaller than that of m (t).
28If m (t) = t – c for some element c of GF (q), then a (t) mod m (t) is just the constant a (c).
29Two polynomials a (t) and b (t) are said to be congruent modulo m (t) if they have the same result upon
30reduction modulo m (t). This relationship is written
32One can define addition, multiplication, and exponentiation of polynomials (to integral powers) modulo
33m (t), analogously to how they are defined for integer congruences in A.1.1.. In the case of a prime field
34GF (p), each of these operations involves both reduction of the polynomials modulo m (t) and reduction of
35the coefficients modulo p.
1 12
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.3.3. Extension Fields
2If m is a positive integer, the extension field GF (pm) consists of the pm possible m-tuples of integers modulo
3p. Thus, for example,
5 GF (32) = {00, 01, 02, 10, 11, 12, 20, 21, 22}.
8A.3.3.1. Addition
9For m > 1, addition of two elements is implemented by component-wise addition modulo p. Thus, for
10example in GF(25) we have,
14A.3.3.2. Multiplication
15There is more than one way to implement multiplication in GF (pm). To specify a multiplication rule, one
16chooses a basis representation for the field. The basis representation is a rule for interpreting each m-tuple;
17the multiplication rule follows from this interpretation.
20In a polynomial basis representation, each element of GF (pm) is represented by a different polynomial
21modulo p of degree less than m. More explicitly, the tuple (am-1 … a2 a1 a0) is taken to represent the binary
22polynomial
27Multiplication is defined in terms of an irreducible binary polynomial f(t) of degree m, called the field
28polynomial for the representation. The product of two elements is simply the product of the corresponding
29polynomials, reduced modulo f(t).
30There is a polynomial basis representation for GF (pm) corresponding to each irreducible polynomial f(t)
31modulo p of degree m. Irreducible polynomials modulo p exist of every degree. Roughly speaking, every
32one out of m polynomials modulo p of degree m is irreducible.
1 13
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.3.5. Extension Fields (cont'd)
2A.3.5.1. Exponentiation
3If k is a positive integer and a is an element of GF (pm), then exponentiation is the operation of computing
4a k. Section A.4.3. contains an efficient method for exponentiation.
5A.3.5.2. Division
6If a and b ¹ 0 are elements of the field GF (pm), then the quotient a /b is the element g such that a = bg.
7In the finite field GF (pm), modular division is possible for any denominator other than 0. The set of
8nonzero elements of GF (pm) is denoted GF (pm)*.
10A.3.5.3. Orders
11The order of an element g of GF (pm)* is the smallest positive integer v such that g v = 1. The order always
12exists and divides pm – 1. If k and l are integers, then g k = g l in GF (pm) if and only if k º l (mod v).
13A.3.5.4. Generators
14If v divides pm – 1, then there exists an element of GF (pm)* having order v. In particular, there always
15exists an element g of order pm – 1 in GF (pm)*. Such an element is called a generator for GF (pm)* because
16every element of GF (pm)* is some power of g.
17A.3.5.5. Exponentiation and discrete logarithms
18Suppose that the element g of GF (pm)* has order v. Then an element h of GF (pm)* satisfies h = g l for
19some l if and only if h v = 1. The exponent l is called the discrete logarithm of h (with respect to the base
20g). The discrete logarithm is an integer modulo v.
21A.3.5.6. Field extensions
22Given two extensions K = GF (pn) and L = GF (pm), L is an extension of K if and only if n | m. For pairing
23based cryptography we often require that K be embedded in the extension L. This is defined in A.5.7..
27A.4.1. Exponentiation
30Output: a k.
31
321. Let k = kr kr–1 ... k1 k0 be the binary representation of k, where the most significant bit kr of k is 1.
332. Set x ¬ a.
1 14
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
13. For i from r – 1 downto 0 do
2 3.1 Set x ¬ x2.
3 3.2 If ki = 1 then set x ¬ a x.
44. Output x.
5There are several modifications that improve the performance of this algorithm. These methods are
6summarized in [Gor98].
7A.4.2. Division
8The quotient a /b can be computed directly (i.e. in one step by an algorithm with inputs a and b), or
9indirectly (by computing the multiplicative inverse b –1 and then multiplying it by a). The common method
10of performing division in a finite field GF (pm) is the indirect method using,
23This algorithm produces the t(x), the multiplicative inversion of g(x) modulo f(x). By ë f(x) / g(x)û is meant
24the quotient upon polynomial division, dropping any remainder.
25A.4.3. Squares
26To determine whether a given element is a square, the Legendre symbol can be computed as follows:
n
13 can be computed by forming n(q-1)/2
q
17The value of Tr () is 0 for half the elements of GF (2m), and 1 for the other half.
18The trace can be computed efficiently as follows.
25If many traces are to be computed with respect to a fixed polynomial basis
26 {t m–1, …, t, 1},
28 t = (tm–1…t1t0)
30 tj = Tr (t j)
31is computed via the basic algorithm. Subsequent traces can be computed via
32 Tr (a) = a × t,
1 16
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1where the “dot product” of the bit strings is given by bitwise AND (or bitwise multiplication).
14 z2 + z =
15has 2 – 2T solutions over GF (2m), where T = Tr (). Thus, there are either 0 or 2 solutions. If z is one
16solution, then the other solution is z + 1. In the case = 0, the solutions are 0 and 1.
17The following algorithms compute a solution if one exists.
18Input: a field GF (2m) along with a polynomial or normal basis for representing its elements; an element
19¹ 0.
21If m is odd, then compute z := half-trace of via A.4.6.. For m even, proceed as follows.
22
231. Choose random r Î GF (2m)
242. Set z ¬ 0 and w ¬r.
253. For i from 1 to m – 1 do
26 3.1 Set z ¬ z2 + w 2.
27 3.2 Set w ¬ w2 + r.
284. If w = 0 then go to Step 1
295. Output z.
30If the latter algorithm is to be used repeatedly for the same field, and memory is available, then it is more
31efficient to precompute and store r and the values of w. Any element of trace 1 will serve as r, and the
32values of w depend only on r and not on
33The above algorithm produces a solution z provided that one exists. If it is unknown whether a solution
34exists, then the output z should be checked by comparing g := z2 + z with b. If g = b, then z is a solution;
35otherwise no solutions exist.
1 17
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.5. Polynomials over a Finite Field
2The computations below can take place either over a prime field (having a prime number p of elements) or
3over a binary field (having 2m elements).
5If k is a positive integer and f(t) and m(t) are polynomials with coefficients in the field GF (q), then f(t)k
6mod m(t) can be computed efficiently by the binary method outlined below.
7Input: a positive integer k, a field GF (q), and polynomials f(t) and m(t) with coefficients in GF (q).
16There are several modifications that improve the performance of this algorithm. These methods are
17summarized in [Gor98].
19If f(t) and g(t) ¹ 0 are two polynomials with coefficients in the field GF (q), then there is a unique monic
20polynomial d(t) of largest degree which divides both f(t) and g(t). The polynomial d(t) is called the
21greatest common divisor or G.C.D. of f(t) and g(t). The following algorithm computes the G.C.D. of two
22polynomials.
23Input: a finite field GF (q) and two polynomials f(t), g(t) ¹ 0 over GF (q).
24Output: d(t) = GCD( f(t), g(t)).
25
261. Set a(t) ¬ f(t), b(t) ¬ g(t).
272. While b(t) ¹ 0
28 2.1 Set c(t) ¬ the remainder when a(t) is divided by b(t).
29 2.2 Set a(t) ¬ b(t).
30 2.3 Set b(t) ¬ c(t).
313. Set ¬ the leading coefficient of a(t).
324. Set d(t) ¬ a –1 a(t).
335. Output d(t).
35Let f(t) be a polynomial with coefficients in the field GF (p), and suppose that f(t) factors into distinct
36irreducible polynomials of degree d. (This is the special case needed in A.10..) The following algorithm
37finds a random degree-d factor of f(t) efficiently.
38Input: a prime p > 2, a positive integer d, and a polynomial f(t) which factors modulo p into distinct
39irreducible polynomials of degree d.
12Let f(t) be a polynomial with coefficients in the field GF (2), and suppose that f(t) factors into distinct
13irreducible polynomials of degree d. (This is the special case needed in A.10..) The following algorithm
14finds a random degree-d factor of f(t) efficiently.
15Input: a positive integer d, and a polynomial f(t) which factors modulo 2 into distinct irreducible
16polynomials of degree d.
30If f(t) is a polynomial with coefficients in the field GF (2r), then f(t) can be tested efficiently for
31irreducibility using the following algorithm.
33Output: the message “True” if f(t) is irreducible; the message “False” otherwise.
34
351. Set d ¬ degree of f(t).
362. Set u(t) ¬ t.
373. For i from 1 to ëd/2û do
38 3.1 For j from 1 to r do
39 Set u(t) ¬ u(t)2 mod f(t)
40 Next j
41 3.2 Set g(t) ¬ GCD(u(t) + t, f(t)).
42 3.3 If g(t) ¹ 1 then output “False” and stop.
433. Output “True.”
1 19
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.5.6. Finding a Root in GF (2m) of an Irreducible Binary Polynomial
2If f(t) is an irreducible polynomial modulo 2 of degree d dividing m, then f(t) has d distinct roots in the field
3GF (2m). A random root can be found efficiently using the following algorithm.
4Input: an irreducible polynomial modulo 2 of degree d, and a field GF (2m), where d divides m.
18Given a field F = GF (pd), the following algorithm embeds F into an extension field K = GF (pde).
19Input: integers d and e; a polynomial basis B for F = GF (pd) with field polynomial f(t); a polynomial
20basis for K = GF (pde).
31A plane curve is defined to be the set of points satisfying an equation F (x, y) = 0. The simplest plane
32curves are lines (whose defining equation has degree 1 in x and y) and conic sections (degree 2 in x and y).
33The next simplest are the cubic curves (degree 3). These include elliptic curves, so called because they
34arose historically from the problem of computing the circumference of an ellipse. This Standard restricts its
35attention to cubic plane curves, although other representations could be defined. The coefficients of such a
36curve must satisfy a side condition to guarantee the mathematical property of nonsingularity. The side
37condition is given below for each family of curves.)
38An elliptic curve is a non-singular (smooth) algebraic curve of genus one with a defined point. The set of
39points on an elliptic curve is topologically equivalent to a torus - a surface with one hole in it – and,
40simplistically, the number of holes in a surface is the definition of the term genus. Elliptic curves should
41strictly be written as a pair (E, O) where E is the curve and O the defined point. However, O is invariably
1 20
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1taken to be the point at infinity and the elliptic curve is often simply referred to as E. (Note: see [Sil86] for
2a mathematically precise definition of “elliptic curve.”)
3In cryptography, the elliptic curves of interest are those defined over finite fields. That is, the coefficients
4of the defining equation F (x, y) = 0 are elements of GF (q), and the points on the curve are of the form P =
5(x, y), where x and y are elements of GF (q). Examples are given below.
7There are several kinds of defining equations for elliptic curves, but the most common are the Weierstrass
8equations. This standard will be concerned with both ordinary and supersingular curves.
9
10— For the finite fields GF (pm) with p > 3, the standard Weierstrass equation for ordinary curves is
11 y 2 = x 3 + ax + b
12 where a and b are integers modulo p for which 4a 3 + 27b 2 ( 0 (mod p).
13
14— For the binary finite fields GF (2m), the standard Weierstrass equation for ordinary curves is
15 y 2 + xy = x 3 + ax 2 + b
40
1 21
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1Given a Weierstrass equation, the elliptic curve E consists of the solutions (x, y) over GF (q) to the defining
2equation, along with an additional element called the point at infinity (denoted O). The points other than O
3are called finite points. The number of points on E (including O) is called the order of E and is denoted by
4#E (GF (q)).
6 y 2 = x 3 + 10 x + 5
8 {O, (1,4), (1,9), (3,6), (3,7), (8,5), (8,8), (10,0), (11,4), (11,9)}.
11 y 2 + xy = x 3 + (t + 1) x 2 + 1
12over the field GF (23) given by the polynomial basis with field polynomial t 3 + t + 1 = 0. Then the points
13on E are
20A.6.1.2. Pairings
21The primitives defined in the body of this standard use the general concept of a pairing. Here, we define a
22pairing e as a bilinear map between elements of two finite, cyclic, additive groups, G1 and G2 to a third
23finite, cyclic group GT defined multiplicatively. Both of G1 and G2 are of prime order r, as is GT.
24Notationally, we have:
25 e:G1 × G2 GT
27 For all P, P’ G1 and all Q, Q’ G2, e(P + P’,Q) = e(P,Q)e(P’,Q) and e(P,Q + Q’) = e(P,Q) e(P,Q’)
28We also impose the condition that the map be non-degenerate, i.e:
31For cryptographic use, the groups G1 and G2 over which the pairings are defined are sub-groups of points
32on an elliptic curve.
33Elliptic curves fall into two general categories: supersingular curves and ordinary curves. The former are
34curves where the kernel of the ‘multiplication by p’ map (where p is the characteristic of K) is trivial.
1 22
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1Supersingular curves were the first to be considered for use in pairing-based cryptography because they
2possess maps (non F_q-rational endomorphisms) that prove useful in constructing the Tate pairing.
3The first pairing-based cryptosystems used the Weil and Tate pairings on supersingular curves. Further
4research in pairing-based cryptography has led to a range of suitable pairings and families of curves. Apart
5from super-singular curves, all the curve families are of ordinary curves. The primary factors that dictate
6which pairing and curve to use are the efficiency of computations and the security level. As with most
7cryptography, increasing levels of security can be obtained by increasing the size of the field over which
8the operations are defined, but not all curve-pairing combinations have the same relationship between
9security and efficiency. To give some guidance for the best choices, section A.13.1. suggests some
10appropriate system parameters for different levels of security and section A.13.2. suggests appropriate
11combinations of pairings and curves.
12A.6.1.3. Twists
13For a field K, if char (K) ≠ 2,3 we define quadratic, quartic and sextic twists of E(K) as follows. Let
14 E: y 2 = x 3 + Ax + B
15Case 1: if A, B ≠ 0, there are Quadratic Twists only, one can define the twist by giving a value and D
16 givingto produce the curve
17 E': y 2 = x 3 + D2Ax +D3B
18 Essentially there are two such values of D, one producing the original curve and one producing the
19 quadratic twist.
20Case 2: if B = 0, there are Quartic Twists and Quadratic Twistsonly and D giving. By giving a value D
21 one can define the quartic twists by
22 E': y 2 = x 3 + DAx
23 There are essentially four such values of D, which produce non-isomorphic curves over the base
24 field. One of these produces the same curve, two the quartic twists and the remaining one produces
25 the quadratic twist of E.
26Case 2: if A = 0, there are Sextic Twists and Quadratic twistsonly and D giving. By giving a suitable value
27 of D one can define the twists via
28 E': y 2 = x 3 + DB
29 There are essentially six such values of D, one produces the curve itself, one produces the quadratic
30 twist, two produce a cubic twist, whilst the remaining two produce sextic twists.
32There is an addition operation on the points of an elliptic curve which possesses the algebraic properties of
33ordinary addition (e.g. commutativity and associativity). This operation can be described geometrically as
34follows.
( x, y ) if p 3
36 P ( x, x y ) if q = 2m and E is ordinary
( x, c y )
m
if q = 2 and E is supersingular
37Then the sum P + Q of the points P and Q is the point R with the property that P, Q, and –R lie on a
38common line.
1 23
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.6.2.1. The point at infinity
2The point at infinity O plays a role analogous to that of the number 0 in ordinary addition. Thus
3 P + O = P,
4 P + (– P) = O
7When implementing the formulae for elliptic curve addition, it is necessary to distinguish between
8doubling (adding a point to itself) and adding two distinct points that are not inverses of each other,
9because the formulae are different in the two cases. Besides this, there are also the special cases involving
10O. By full addition is meant choosing and implementing the appropriate formula for the given pair of
11points. Algorithms for full addition are given in A.7.1., A.7.2., A.7.3. and A.7.9..
13Elliptic curve points can be added but not multiplied. It is, however, possible to perform scalar
14multiplication, which is another name for repeated addition of the same point. If n is a positive integer and
15P a point on an elliptic curve, the scalar multiple nP is the result of adding n copies of P. Thus, for
16example, 5P = P + P + P + P + P.
17The notion of scalar multiplication can be extended to zero and the negative integers via
18 0P = O, (–n) P = n (–P).
20A.6.3.1. Orders
21The order of a point P on an elliptic curve is the smallest positive integer r such that rP = O. The order
22always exists and divides the order of the curve #E(GF (q)). If k and l are integers, then kP = lP if and only
23if k º l (mod r).
24A.6.3.2. Elliptic curve discrete logarithms
25Suppose that the point G on E has prime order r where r 2 does not divide the order of the curve #E(GF (q)).
26Then a point P satisfies P = lG for some l if and only if rP = O. The coefficient l is called the elliptic curve
27discrete logarithm of P (with respect to the base point G). The elliptic curve discrete logarithm is an
28integer modulo r.
30Suppose that the base point G on E has order r as described in the preceding paragraph. Then a key pair
31can the defined as follows.
32
33— The private key s is an integer modulo r.
34— The corresponding public key W is a point on E defined by W := sG.
35It is necessary to compute an elliptic curve discrete logarithm in order to derive a private key from its
36corresponding public key. For this reason, public-key cryptography based on key pairs of this type relies
37for its security on the difficulty of the elliptic curve discrete logarithm problem. Thus it is an example of
1 24
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1EC-based cryptography. The difficulty of the elliptic curve discrete logarithm problem is discussed in
2Annex D.4.2.
4The discrete logarithm problem in finite fields GF (q)* and the elliptic curve discrete logarithm are in some
5sense the same abstract problem in two different settings. As a result, the primitives and schemes of DL
6and EC based cryptography are closely analogous to each other. The following table makes these analogies
7explicit.
DL EC
9The most difficult part of generating EC parameters is finding a base point of prime order. Generating such
10a point requires knowledge of the curve order n = #E(GF (q)). Since r must divide n, one has the following
11problem: given a field F = GF (q), find an elliptic curve defined over F whose order is divisible by a
12sufficiently large prime r. (Note that “sufficiently large” is defined in terms of the desired security; see
13Annex A.6.3. and A.13.1..) This section discusses this problem.
16 q–2 q + 1 £ n £ q + 2 q + 1.
1 25
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.6.5.2. Near primality
2Given a trial division bound lmax, the positive integer k is called smooth if every prime divisor of k is at most
3lmax. Given large positive integers rmin and rmax, u is called nearly prime if u = kr for some prime r in the
4interval rmin £ r £ r max and some smooth integer k. (The requirement that k be smooth is omitted in most
5definitions of near primality. It is included here to guarantee that there exists an efficient algorithm to
6check for near primality.) In the case in which a prime order curve is desired, the bound lmax is set to 1.
7NOTE—since all elliptic curves over GF (q) have order at most umax = q + 2 q + 1, then rmax should be no greater
8than umax. (If no maximum is desired, e.g., as in draft ANSI X9.62 [ANS98e], then one takes rmax ¬ umax.) Moreover, if
9rmin is close to umax, then there will be a small number of possible curves to choose from, so that finding a suitable one
10will be more difficult. If a prime-order curve is desired, a convenient choice is rmin = q + q.
12This section discusses the issues involved in choosing representations for points on elliptic curves, for
13purposes of internal computation and for external communication.
15A finite point on E is specified by two elements x, y in GF (q) satisfying the defining equation for E. These
16are called the affine coordinates for the point. The point at infinity O has no affine coordinates. For
17purposes of internal computation, it is most convenient to represent O by a pair of coordinates (x, y) not on
18E. For q = 2 m, the simplest choice is O = (0,0). For q = pm, one chooses O = (0, 0) unless b = 0, in which
19case O = (0, 1).
21The affine coordinates of a point require 2ml bits to store and transmit where q itself requires l bits to
22represent it. This is far more than is needed, however. For purposes of external communication, therefore,
23it can be advantageous to compress one or both of the coordinates.
24The y coordinate can always be compressed. The compressed y coordinate, denoted ~y , is a single bit,
25defined as follows.
26
27— if q is a power of an odd prime, then ~
y := y mod 2, where y is interpreted as a positive integer less
28 ~
than q. Put another way, y is the rightmost bit of y.
29— ~
if q is a power of 2, then y is the rightmost bit of the field element y x –1 (except when x = 0, in
30 ~
which case y := 0).
31NOTES
332—There are many other possible ways to compress coordinates; the methods given here are the ones that have
34appeared in the literature (see [Men95], [Ser98]).
36If division within GF (q) is relatively expensive, then it may pay to keep track of numerators and
37denominators separately. In this way, one can replace division by with multiplication of the denominator
38by . This is accomplished by the projective coordinates X, Y , and Z, given by
1 26
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
X Y
1 x 2
,y 3.
Z Z
8The formulae above provide the method for converting a finite point from projective coordinates to affine.
9To convert from affine to projective, one proceeds as follows.
10 X ¬ x, Y ¬ y, Z ¬ 1.
11Projective coordinates are well suited for internal computation, but not for external communication since
12they require so many bits. They are more common over GF (p) since division tends to be more expensive
13there.
16The following algorithm implements a full addition (on a curve modulo p) in terms of affine coordinates.
17Note that this algorithm can also be used for supersingular curves of characteristic 3.
18Input: a field K = GF(pn) for p > 3; coefficients a, b for an elliptic curve E: y 2 = x 3 + ax + b over K;
19points P0 = (x0, y0) and P1 = (x1, y1) on E.
34To subtract the point P = (x, y), one adds the point –P = (x, –y).
1 27
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.7.2. Full Addition and Subtraction (binary case)
2The following algorithm implements a full addition (on an ordinary curve over GF (2m)) in terms of affine
3coordinates.
4Input: a field GF (2m); coefficients a, b for an elliptic curve E: y 2 + xy = x 3 + ax 2 + b over GF (2m); points
5P0 = (x0, y0) and P1 = (x1, y1) on E.
21The above algorithm requires 2 general multiplications, a squaring, and a multiplicative inversion.
22To subtract the point P = (x, y), one adds the point –P = (x, x + y).
25The following algorithm implements a full addition (on a supersingular curve over GF (2m)) in terms of
26affine coordinates.
27Input: a field GF (2m); coefficients a, b for an elliptic curve E: y 2 + y = x 3 + ax + b over GF (2m); points
28P0 = (x0, y0) and P1 = (x1, y1) on E.
1 28
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1The above algorithm requires 2 general multiplications, a squaring, and a multiplicative inversion.
2To subtract the point P = (x, y), one adds the point –P = (x, x + y).
4Scalar multiplication can be performed efficiently by the addition-subtraction method outlined below.
18There are several modifications that improve the performance of this algorithm. These methods are
19summarized in [Gor98].
21The projective form of the doubling formula on the curve y 2 = x 3 + ax + b over GF(pm) for p > 3 is
23where
24 M = 3 X 12 + a Z14 ,
25 Z2 = 2Y1Z1,
26 S = 4X1 Y12 ,
27 X2 = M 2 – 2S,
28 T = 8 Y14 ,
29 Y2 = M (S – X2) – T.
31Input: a modulus p; the coefficients a and b defining a curve E modulo p; projective coordinates (X1, Y1,
32Z1) for a point P1 on E.
33Output: projective coordinates (X2, Y2, Z2) for the point P2 = 2P1.
34
351. T1 ¬ X1
362. T2 ¬ Y1
373. T3 ¬ Z1
384. If T2 = 0 or T3 = 0 then output (1, 1, 0) and stop.
395. If a = p – 3 then
1 29
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 T4 ¬ T32
2 T5 ¬ T1 – T4
3 T4 ¬ T1 + T4
4 T5 ¬ T4 ´ T5
5 T4 ¬ 3 ´ T5
6 =M
7 else
8 T4 ¬ a
9 T5 ¬ T32
10 T5 ¬ T52
11 T5 ¬ T4 ´ T5
12 T4 ¬ T12
13 T4 ¬ 3 ´ T4
14 T4 ¬ T4 + T5
15 =M
166. T3 ¬ T2 ´ T3
177. T3 ¬ 2 ´ T3 = Z2
188. T2 ¬ T22
199. T5 ¬ T1 ´ T2
2010. T5 ¬ 4 ´ T5 =S
2111. T1 ¬ T42
2212. T1 ¬ T1 – 2 ´ T5
23 = X2
2
2413. T2 ¬ T2
2514. T2 ¬ 8 ´ T2 =T
2615. T5 ¬ T5 – T1
2716. T5 ¬ T4 ´ T5
2817. T2 ¬ T5 – T2
29 = Y2
3018. X2 ¬ T 1
3119. Y2 ¬ T2
3220. Z2 ¬ T3
33This algorithm requires 10 field multiplications and 5 temporary variables. If a is small enough that
34multiplication by a can be done by repeated addition, only 9 field multiplications are required. If a = p – 3,
35then only 8 field multiplications are required (see [CC87]). The proportion of elliptic curves modulo p that
36can be rescaled so that a = p – 3 is about 1/4 if p º 1 (mod 4) and about 1/2 if p º 3 (mod 4). (See Annex
37A.6.5., Basic Facts.)
39The projective form of the adding formula on the curve y 2 = x 3 + ax + b over GF(pm) for p > 3, is
41where
42 U0 = X0 Z12 ,
43 S0 = Y0 Z13 ,
1 30
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 U1 = X1 Z 02 ,
2 S1 = Y1 Z 03 ,
3 W = U0 – U1,
4 R = S0 – S1,
5 T = U0 + U1,
6 M = S0 + S1,
7 Z2 = Z0Z1W,
8 X2 = R 2 – TW 2,
9 V = TW 2 – 2X2,
10 2Y2 = VR – MW 3.
12Input: a modulus p; the coefficients a and b defining a curve E modulo p; projective coordinates (X0, Y0,
13Z0) and (X1, Y1, Z1) for points P0 and P1 on E, where Z0 and Z1 are nonzero.
14Output: projective coordinates (X2, Y2, Z2) for the point P2 = P0 + P1, unless P0 = P1. In this case, the
15triplet (0, 0, 0) is returned. (The triplet (0, 0, 0) is not a valid projective point on the curve, but rather a
16marker indicating that routine Double should be used.)
17
181. T1 ¬ X0 = U0 (if Z1 = 1)
192. T2 ¬ Y0 = S0 (if Z1 = 1)
203. T3 ¬ Z0
214. T4 ¬ X1
225. T5 ¬ Y1
236. If Z1 ¹ 1 then
24 T6 ¬ Z1
25 T7 ¬ T62
26 T1 ¬ T1 ´ T7 = U0 (if Z1 ¹ 1)
27 T7 ¬ T6 ´ T7
28 T2 ¬ T2 ´ T7 = S0 (if Z1 ¹ 1)
297. T7 ¬ T32
308. T4 ¬ T4 ´ T7 = U1
319. T7 ¬ T3 ´ T7
3210. T5 ¬ T5 ´ T7 = S1
3311. T4 ¬ T1 – T4 =W
3412. T5 ¬ T2 – T5 =R
3513. If T4 = 0 then
36 If T5 = 0 then output (0,0,0) and stop
37 else output (1, 1, 0) and stop
3814. T1 ¬ 2 ´ T1 – T4 =T
3915. T2 ¬ 2 ´ T2 – T5 =M
4016. If Z1 ¹ 1 then
41 T3 ¬ T3 ´ T6
4217. T3 ¬ T3 ´ T4 = Z2
4318. T7 ¬ T42
4419. T4 ¬ T4 ´ T7
4520. T7 ¬ T1 ´ T7
4621. T1 ¬ T52
4722. T1 ¬ T1 – T7 = X2
4823. T7 ¬ T7 – 2 ´ T1 =V
1 31
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
124. T5 ¬ T5 ´ T7
225. T4 ¬ T2 ´ T4
326. T2 ¬ T5 – T4
427. T2 ¬ T2 / 2 = Y2
528. X2 ¬ T 1
629. Y2 ¬ T2
730. Z2 ¬ T3
8NOTE—the modular division by 2 in Step 27 can be carried out in the same way as in A.2.4..
9This algorithm requires 16 field multiplications and 7 temporary variables. In the case Z1 = 1, only 11 field
10multiplications and 6 temporary variables are required. (This is the case of interest for elliptic scalar
11multiplication.)
13The projective form of the doubling formula on the curve y 2 + xy = x 3 + ax 2 + b over GF (2m) uses, not the
14coefficient b, but rather the field element
m 2
15 c := b2 ,
18where
19 Z2 = X1 Z12 ,
20 X2 = (X1 + c Z12 )4,
21 U = Z2 + X 12 + Y1Z1,
22 Y2 = X 14 Z2 + UX2.
24Input: a field of 2m elements; the field elements a and c specifying a curve E over GF (2m); projective
25coordinates (X1, Y1, Z1) for a point P1 on E.
26Output: projective coordinates (X2, Y2, Z2) for the point P2 = 2P1.
27
281. T1 ¬ X1
292. T2 ¬ Y1
303. T3 ¬ Z1
314. T4 ¬ c
325. If T1 = 0 or T3 = 0 then output (1, 1, 0) and stop.
336. T2 ¬ T2 ´ T3
347. T3 ¬ T32
358. T4 ¬ T3 ´ T4
369. T3 ¬ T1 ´ T3 = Z2
3710. T2 ¬ T2 + T3
3811. T4 ¬ T1 + T4
1 32
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
112. T4 ¬ T42
213. T4 ¬ T42 = X2
314. T1 ¬ T12
415. T2 ¬ T1 + T2 =U
516. T2 ¬ T2 ´ T4
617. T1 ¬ T12
718. T1 ¬ T1 ´ T3
819. T2 ¬ T1 + T2 = Y2
920. T1 ¬ T4
1021. X2 ¬ T 1
1122. Y2 ¬ T2
1223. Z2 ¬ T3
13This algorithm requires 5 field squarings, 5 general field multiplications, and 4 temporary variables.
15The projective form of the adding formula on the curve y 2 + xy = x 3 + ax2 + b over GF (2m) is
17where
18 U0 = X0 Z12 ,
19 S0 = Y0 Z13 ,
20 U1 = X1 Z 02 ,
21 W = U0 + U1,
22 S1 = Y1 Z 03 ,
23 R = S0 + S1,
24 L = Z0 W
25 V = RX1 + LY1,
26 Z2 = LZ1,
27 T = R + Z 2,
28 X2 = a Z22 + TR + W 3,
29 Y2 = TX2 + VL 2.
31Input: a field of 2m elements; the field elements a and b defining a curve E over GF (2m); projective
32coordinates (X0, Y0, Z0) and (X1, Y1, Z1) for points P0 and P1 on E, where Z0 and Z1 are nonzero.
33Output: projective coordinates (X2, Y2, Z2) for the point P2 = P0 + P1, unless P0 = P1. In this case, the
34triplet (0, 0, 0) is returned. (The triplet (0, 0, 0) is not a valid projective point on the curve, but rather a
35marker indicating that routine Double should be used.)
36
371. T1 ¬ X0 = U0 (if Z1 = 1)
382. T2 ¬ Y0 = S0 (if Z1 = 1)
393. T3 ¬ Z0
404. T4 ¬ X1
1 33
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
15. T5 ¬ Y1
26. If a ¹ 0 then
3 T9 ¬ a
47. If Z1 ¹ 1 then
5 T6 ¬ Z1
6 T7 ¬ T62
7 T1 ¬ T1 ´ T7 = U0 (if Z1 ¹ 1)
8 T7 ¬ T6 ´ T7
9 T2 ¬ T2 ´ T7 = S0 (if Z1 ¹ 1)
108. T7 ¬ T32
119. T8 ¬ T4 ´ T7 = U1
1210. T1 ¬ T1 + T8 =W
1311. T7 ¬ T3 ´ T7
1412. T8 ¬ T5 ´ T7 = S1
1513. T2 ¬ T2 + T8 =R
1614. If T1 = 0 then
17 If T2 = 0 then output (0, 0, 0) and stop
18 else output (1, 1, 0) and stop
1915. T4 ¬ T2 ´ T4
2016. T3 ¬ T1 ´ T3 = L (= Z2 if Z1 =
21 1)
2217. T5 ¬ T3 ´ T5
2318. T4 ¬ T4 + T5 =V
2419. T5 ¬ T32
2520. T7 ¬ T4 ´ T5
2621. If Z1 ¹ 1 then
27 T3 ¬ T3 ´ T6 = Z2 (if Z1 ¹ 1)
2822. T4 ¬ T2 + T3 =T
2923. T2 ¬ T2 ´ T4
3024. T5 ¬ T12
3125. T1 ¬ T1 ´ T5
3226. If a ¹ 0 then
33 T8 ¬ T32
34 T9 ¬ T8 ´ T9
35 T1 ¬ T1 + T9
3627. T1 ¬ T1 + T2 = X2
3728. T4 ¬ T1 ´ T4
3829. T2 ¬ T4 + T7 = Y2
3930. X2 ¬ T 1
4031. Y2 ¬ T2
4132. Z2 ¬ T3
42This algorithm requires 5 field squarings, 15 general field multiplications and 9 temporary variables. If
43a = 0, then only 4 field squarings, 14 general field multiplications and 8 temporary variables are required.
44(About half of the elliptic curves over GF (2m) can be rescaled so that a = 0. They are precisely the curves
45with order divisible by 4. See Annex A.6.5., Basic Facts.)
46In the case Z1 = 1, only 4 field squarings, 11 general field multiplications, and 8 temporary variables are
47required. If also a = 0, then only 3 field squarings, 10 general field multiplications, and 7 temporary
48variables are required. (These are the cases of interest for elliptic scalar multiplication.)
1 34
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.7.9. Projective Full Addition and Subtraction
2The following algorithm FullAdd implements a full addition in terms of projective coordinates.
3Input: a field of q elements; the field elements a and b defining a curve E over GF (q); projective
4coordinates (X0, Y0, Z0) and (X1, Y1, Z1) for points P0 and P1 on E.
5Output: projective coordinates (X2, Y2, Z2) for the point P2 = P0 + P1.
6
71. If Z0 = 0 then output (X2, Y2, Z2) ¬ (X1, Y1, Z1) and stop.
82. If Z1 = 0 then output (X2, Y2, Z2) ¬ (X0, Y0, Z0) and stop.
93. Set (X2, Y2, Z2) ¬ Add[(X0, Y0, Z0), (X1, Y1, Z1)].
104. If (X2, Y2, Z2) = (0, 0, 0) then set (X2, Y2, Z2) ¬ Double[(X1, Y1, Z1)]
115. Output (X2, Y2, Z2).
13 Subtract[(X0, Y0, Z0), (X1, Y1, Z1)] = FullAdd[(X0, Y0, Z0), (X1, U, Z1)]
14where
Y1 mod p if q p
15 U=
X 1Z1 Y1 if q 2 m
40There are several modifications that improve the performance of this algorithm. These methods are
41summarized in [Gor98].
1 35
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.7.11. Decompression of y Coordinates (prime case)
2The following algorithm recovers the y coordinate of an elliptic curve point from its compressed form.
3Input: a prime number p, an elliptic curve E defined over K = GF(pm) for p > 3, the x coordinate of a point
4(x, y) on E, and the compressed representation ~y of the y coordinate.
13NOTE—when implementing the algorithm from A.2.5., the existence of modular square roots should be checked.
14Otherwise, a value may be returned even if no modular square roots exist.
16The following algorithm recovers the y coordinate of an elliptic curve point from its compressed form.
17Input: a field GF (2m), an elliptic curve E defined over GF (2m), the x coordinate of a point (x, y) on E, and
18the compressed representation ~y of the y coordinate.
29NOTES
301—When implementing the algorithm from A.4.7., the existence of solutions to the quadratic equation should be
31checked. Otherwise, a value may be returned even if no solutions exist.
34The following algorithm provides an efficient method for finding a random point (other than O) on a given
35elliptic curve over the finite field GF (p).
36Input: a field K = GF(pm) where p > 3 and the parameters a, b of an elliptic curve E over K.
8 b 2 º .
9
106. Generate a random bit m and set y ¬ (–1) m b.
117. Output (x, y).
13The following algorithm provides an efficient method for finding a random point (other than O) on a given
14elliptic curve over the finite field GF (2m).
15Input: a field GF (2m) and the parameters a, b of an elliptic curve E over GF (2m).
30If the order #E(GF (q)) = u of an elliptic curve E is nearly prime, the following algorithm efficiently
31produces a random point on E whose order is the large prime factor r of u = kr. (See A.6.5. for the
32definition of nearly prime.)
33Input: a prime r, a positive integer k not divisible by r, and an elliptic curve E over the field GF (q).
34Output: if #E(GF (q)) = kr, a point G on E of order r. If not, the message “wrong order.”
35
361. Generate a random point P (not O) on E via A.8.1. or A.8.2..
372. Set G ¬ kP.
383. If G = O then go to Step 1.
394. Set Q ¬ rG.
405. If Q ¹ O then output “wrong order” and stop.
416. Output G.
1 37
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.8.4. Curve Orders over Small Binary Fields
2If d is “small” (i.e. it is feasible to perform 2 d arithmetic operations), then the order of the curve y2 + xy = x3
3+ ax2 + b over GF (2d) can be calculated directly as follows. Let
4 m = (–1) Tr (a).
6 l (x) = Tr (x + b/x2).
7Then
8 #E(GF (2d)) = 2d + 1 + ( 1)
x 0
(x)
.
10Given the order of an elliptic curve E over a finite field GF (2d), the following algorithm computes the
11order of E over the extension field GF (2de).
12Input: positive integers d and e, an elliptic curve E defined over GF (2d), and the order w of E over
13GF (2d).
21The algorithms of A.8.4. and A.8.5. allow construction of elliptic curves with known orders over GF (2m),
22provided that m is divisible by an integer d that is small enough for A.8.4.. The following algorithm finds
23such curves with nearly prime orders when such exist. (See Annex A.6.5. for the definition of nearly
24prime.)
25Input: a field GF (2m); a subfield GF (2d) for some (small) d dividing m; lower and upper bounds rmin and
26rmax for the base point order.
27Output: elements a, b Î GF (2m) specifying an elliptic curve E, along with the nearly prime order n =
28#E(GF (2m)), if one exists; otherwise, the message “no such curve.”
29
301. Select elements a0, b0 Î GF (2d) such that b0 has not already been selected. (If all of the b0’s have
31 already been tried, then output the message “no such curve” and stop.) Let E be the elliptic curve y2
32 + xy = x3 + a0 x2 + b0.
332. Compute the order w = #E(GF (2d)) via A.8.4..
343. Compute the order u = #E(GF (2m)) via A.8.5..
354. Test u for near-primality using the techniques in [ANS98g].
365. If u is nearly prime, then set l ¬ 0 and n ¬ u and go to Step 9.
376. Set u¢ = 2m+1 + 2 – u.
387. Test u¢ for near-primality using the techniques in [ANS98g].
398. If u¢ is nearly prime, then set l ¬ 1 and n ¬ u¢, else go to Step 1.
1 38
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
19. Find the elements a1, b1 Î GF (2m) corresponding to a0 and b0 via A.5.7..
210. If l = 0 then set t ¬ 0. If l = 1 and m is odd, then set t ¬ 1. Otherwise, find an element t Î
3 GF (2m) of trace 1 by trial and error using A.4.5..
411. Set a ¬ a1 + t and b ¬ b1
512. Output n, a, b.
6NOTE—It follows from the Basic Facts of A.6.5. that any a0 can be chosen at any time in Step 1.
9A.9.1. Overview
A B
11 S
B C
18The determinant D := AC – B 2 of S will be assumed throughout this section to be positive and squarefree
19(i.e., containing no square factors).
20Given D, the class group H (D) is the set of all reduced symmetric matrices of determinant D. The class
21number h(D) is the number of matrices in H(D).
22The class group is used to construct the reduced class polynomial. This is a polynomial wD (t) with integer
23coefficients of degree h (D). The reduced class polynomial is used in A.10. to construct elliptic curves with
24known orders.
26The following algorithm produces a list of the reduced symmetric matrices of a given determinant D. See
27[Bue89].
15Let
(1) z
( 3 j 2 j )/ 2 2
16 F(z) = 1 +
j
z (3 j j )/ 2
j 1
18and
D Bi
19 q = exp .
A
20Let
24NOTE—since
25 | | e 3/ 2
0.0658287 ,
26the series F (z) used in computing the numbers ƒJ(A, B, C) converges as quickly as a power series in e 3/2 .
G
28 C(A, B, C) = (N BL 2–I/6 (ƒJ (A, B, C))K) ,
29[MRC: a correction has been made to change –BL to BL in the above expression following a comment
30from another working group member. Is this correct?]
1 40
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1where:
2 G = GCD(D,3),
0 for AC odd,
4 J 1 for C even,
2 for A even ,
1 if D 5 (mod 8)
or D 3 (mod 8) and AC odd
or D 7 (mod 8) and AC even,
9 N M if D 1,2,6 (mod 8)
or D 7 (mod 8) and AC odd,
M if D 3 (mod 8) and AC even,
10 = e p iK/24.
11If [A1, B1, C1], ..., [Ah ,Bh ,Ch] are the reduced symmetric matrices of (positive squarefree) determinant D,
12then the reduced class polynomial for D is
1 41
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
h
1 wD(t) = (t C( A , B , C )) .
j 1
j j j
3NOTE—The above computations must be performed with sufficient accuracy to identify each coefficient of the
4polynomial wD (t). Since each such coefficient is an integer, this means that the error incurred in calculating each
5coefficient should be less than 1/2.
6Example.
1
7w71(t)= t f0 1,0,71
2
e i / 8 e i / 8
8 t f1 31
, ,24 t f1 3,1,24
2 2
e 23i / 24 e 23i / 24
9 t f2 8,1,9 t f2 8,1,9
2 2
11= (t – 2.13060682983889533005591468688942503...)
12 (t – (0.95969178530567025250797047645507504...) +
13 (0.34916071001269654799855316293926907...) i)
14 (t – (0.95969178530567025250797047645507504...) –
15 (0.34916071001269654799855316293926907...) i)
16 (t + (0.7561356880400178905356401098531772...) +
17 (0.0737508631630889005240764944567675...) i)
18 (t + (0.7561356880400178905356401098531772...) –
19 (0.0737508631630889005240764944567675...) i)
20 (t + (0.2688595121851000270002877100466102...) –
21 (0.84108577401329800103648634224905292...) i)
22 (t + (0.2688595121851000270002877100466102...) +
23 (0. 84108577401329800103648634224905292...) i)
1 42
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1= t 7 – 2t 6 – t 5 + t 4 + t 3 + t 2 – t – 1.
3A.10.1. Overview
5 Z = 4q – (q + 1 – u)2
6is positive by the Hasse bound (see Annex A.6.5.). Thus there is a unique factorization
7 Z = DV 2
8where D is squarefree (i.e. contains no square factors). Thus, for each non-supersingular elliptic curve over
9GF (q) of order u, there exists a unique squarefree positive integer D such that
10(*) 4q = W 2 + DV 2,
11(**) u=q+1±W
13It is said that E has complex multiplication by D (or, more properly, by D ). D is called a CM
14discriminant for q.
15If one knows D for a given curve E, one can compute its order via (*) and (**). As will be demonstrated
16below, one can construct the curves with CM by small D. Therefore one can obtain curves whose orders u
17satisfy (*) and (**) for small D. The near-primes are plentiful enough that one can find curves of nearly
18prime order with small enough D to construct.
19Over GF (p), the CM technique is also called the Atkin-Morain method (see [Mor91]); over GF (2m), it is
20also called the Lay-Zimmer method (see [LZ94]). Although it is possible (over GF (p)) to choose the order
21first and then the field, it is preferable to choose the field first since there are fields in which the arithmetic
22is especially efficient.
23There are two basic steps involved: finding an appropriate order, and constructing a curve having that
24order. More precisely, one begins by choosing the field size q, the minimum point order rmin, and trial
25division bound lmax. Given those quantities, D is called appropriate if there exists an elliptic curve over
26GF (q) with CM by D and having nearly prime order.
27
28Step 1 (A.10.2. and A.10.3., Finding a Nearly Prime Order):
29 Find an appropriate D. When one is found, record D, the large prime r, and the positive integer k
30 such that u = kr is the nearly prime curve order.
31
32Step 2 (A.10.4. and A.10.5., Constructing a Curve and Point):
33 Given D, k and r, construct an elliptic curve over GF (q) and a point of order r.
1 43
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.10.2. Finding a Nearly Prime Order over GF (p)
3A squarefree positive integer D can be a CM discriminant for p only if it satisfies the following congruence
4conditions. Let
p 1
2
5 K .
rmin
6
7— If p º 3 (mod 8), then D º 2, 3, or 7 (mod 8).
8— If p º 5 (mod 8), then D is odd.
9— If p º 7 (mod 8), then D º 3, 6, or 7 (mod 8).
10— If K = 1, then D º 3 (mod 8).
11— If K = 2 or 3, then D ( 7 (mod 8).
13If K = 1, then
14 D = 3, 11, 19, 35, 43, 51, 59, 67, 83, 91, 107, 115, ….
3Input: a prime p and a squarefree positive integer D satisfying the congruence conditions from A.10.2.1..
5 4p = W 2 + DV 2
6for some V. [In the cases D = 1 or 3, the output also includes V.] If not, the message “not a CM
7discriminant.”
8
91. Apply the appropriate technique from A.2.5. to find a square root modulo p of –D or determine that
10 none exist.
112. If the result of Step 1 indicates that no square roots exist, then output “not a CM discriminant” and
12 stop. Otherwise, the output of Step 1 is an integer B modulo p.
133. Let A ¬ p and C ¬ (B 2 + D) / p.
A B 1
144. Let S and U .
B C 0
155. Until |2B| £ A £ C, repeat the following steps.
B 1
16 5.1 Let .
C 2
0 1
17 5.2 Let T .
1
18 5.3 Replace U by T –1U.
19 5.4 Replace S by T t S T, where T t denotes the transpose of T.
206. If D = 11 and A = 3, let d ¬ 0 and repeat 5.2, 5.3, 5.4.
217. Let X and Y be the entries of U. That is,
X
22 U .
Y
23
248. If D = 1 or 3 then output W ¬ 2X and V ¬ 2Y and stop.
259. If A = 1 then output W ¬ 2X and stop.
2610. If A = 4 then output W ¬ 4X + BY and stop.
2711. Output “not a CM discriminant.”
29Input: a prime p, a trial division bound lmax, and lower and upper bounds rmin and rmax for base point order.
30Output: a squarefree positive integer D, a prime r in the interval rmin £ r £ rmax, and a smooth integer k
31such that u = kr is the order of an elliptic curve modulo p with complex multiplication by D.
32
331. Choose a squarefree positive integer D, not already chosen, satisfying the congruence conditions of
34 A.10.2.1..
D
352. Compute via A.2.3. the Jacobi symbol J = . If J = –1 then go to Step 1.
p
363. List the odd primes l dividing D.
1 45
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
p
14. For each l, compute via A.2.3 the Jacobi symbol J = . If J = –1 for some l, then go to Step 1.
l
25. Test via A.10.2.2. whether D is a CM discriminant for p. If the result is “not a CM discriminant,” go
3 to Step 1. (Otherwise, the result is the integer W, along with V if D = 1 or 3.)
46. Compile a list of the possible orders, as follows.
5 — If D = 1, the orders are
6 p + 1 ± W, p + 1 ± V.
7
8 — If D = 3, the orders are
9 p + 1 ± W, p + 1 ± (W + 3V)/2, p + 1 ± (W – 3V)/2.
10
11 — Otherwise, the orders are p + 1 ± W.
127. Test each order for near-primality. If any order is nearly prime, output (D, k, r) and stop.
138. Go to Step 1.
1 D 2
15 p = 4X 2 – 2XY + Y and p + 1 – (4X – Y) = r
4
16where D = 235,
17 X = –31037252937617930835957687234,
18 Y = 5905046152393184521033305113,
20 r = 6277101735386680763835789423337720473986773608255189015329.
26 2 d+2 = W 2 + DV 2,
1 46
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
B 1
1 4.1 Let .
C 2
0 1
2 4.2 Let T
1
3 4.3 Replace U by T –1U.
4 4.4 Replace S by T t S T, where T t denotes the transpose of T.
55. Let X and Y be the entries of U. That is,
X
6 U .
Y
7
86. If A = 1, then output W ¬ X and stop.
97. If A = 4 and Y is even, then output W ¬ (4X + BY) / 2 and stop.
108. Output “not a CM discriminant.”
12Input: a field degree d, a trial division bound lmax, and lower and upper bounds rmin and rmax for base point
13order.
14Output: a squarefree positive integer D, a prime r in the interval rmin £ r £ rmax, and a smooth integer k
15such that u = kr is the order of an elliptic curve over GF (2d) with complex multiplication by D.
16
171. Choose a squarefree positive integer D º 7 (mod 8), not already chosen.
182. Compute H ¬ the class group for D via A.9.2..
193. Set h ¬ the number of elements in H.
204. If d does not divide h, then go to Step 1.
215. Test via A.14.3.1 whether D is a CM discriminant for 2 d. If the result is “not a CM discriminant,” go
22 to Step 1. (Otherwise, the result is the integer W.)
236. The possible orders are 2d + 1 ± W.
247. Test each order for near-primality. If any order is nearly prime, output (D, k, r) and stop.
258. Go to Step 1.
27 4q = X 2 + DY 2 and q + 1 – X = 4r
29 r = 11417981541647679048466230373126290329356873447.
33Given a prime p and a CM discriminant D, the following technique produces an elliptic curve y2 º x3 + a0 x
34+ b0 (mod p) with CM by D. (Note that there are at least two possible orders among curves with CM by D.
35The curve constructed here will have the proper CM, but not necessarily the desired order. This curve will
36be replaced in A.10.4.2. by one of the desired order.)
1 47
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1For nine values of D, the coefficients of E can be written down at once:
D a0 b0
1 1 0
2 –30 56
3 0 1
7 –35 98
11 –264 1694
19 –152 722
43 –3440 77658
67 –29480 1948226
5 y 2 º x 3 + a0x + b0 (mod p)
6has CM by D.
7
81. Compute w(t) ¬ wD(t) mod p via A.9.3..
92. Let W be the output from A.10.2.2..
103. If W is even, then use A.5.3. with d = 1 to compute a linear factor t – s of wD(t) modulo p. Let
t 24 mod g ( t ) if 3 | D,
18 V ( t ):
256t mod g ( t ) if 3 | D,
8
3 a0 := st mod p,
4 b0 := st 2 mod p.
5
65. Output (a0, b0).
8 wD (t) = t 6 – 10 t 5 + 22 t 4 – 24 t 3 + 16 t 2 – 4 t + 4.
13 a0 = –2089023816294079213892272128,
14 b0 = –36750495627461354054044457602630966837248.
25 y2 º x3 + ax + b (mod p)
26 via A.8.3..
27
284. If the output of A.8.3. is “wrong order” then output the message “wrong order” and stop.
295. Output the coefficients a, b and the point G.
30The method of selecting x in the first step of this algorithm depends on the kind of coefficients desired.
31Two examples follow.
32
33— If D ¹ 1 or 3, and it is desired that a = –3 (see A.7.6.), then take x to be a solution of the congruence
34 a0x 2 º –3 (mod p), provided one exists. If one does not exist, or if this choice of x leads to the
35 message “wrong order,” then select another curve as follows. If p º 3 (mod 4) and the result was
36 “wrong order,” then choose p – x in place of x; the result leads to a curve with a = –3 and the right
37 order. If no solution x exists, or if p º 1 (mod 4), then repeat A.10.4. with another root of the
38 reduced class polynomial. The proportion of roots leading to a curve with a = –3 and the right order
39 is roughly one-half if p º 3 (mod 4), and one-quarter if p º 1 (mod 4).
1 49
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1— If there is no restriction on the coefficients, then choose x at random. If the output is the message
2 “wrong order,” then repeat the algorithm until a set of parameters a, b G is obtained. This will
3 happen for half the values of x, unless D = 1 (one-quarter of the values) or D = 3 (one-sixth of the
4 values).
7Input: a field GF (2m), a CM discriminant D for 2m, and the desired curve order u.
9 y2 + xy = x3 + ax2 + b
26wD(t) º 1 + t 2 + t 6 + t 10 + t 12 + t 13 + t 16 + t 17 + t 20 + t 22 + t 24 + t 27 + t 30 + t 33 + t 35 + t 36 + t 37 + t 41 + t 42 + t 43 +
27t 45 + t 49 + t 51 + t 54 + t 56 + t 57 + t 59 + t 61 + t 65 + t 67 + t 68 + t 69 + t 70 + t 71 + t 72 + t 74 + t 75 + t 76 + t 82 + t 83 + t 87
28+ t 91 + t 93 + t 96 + t 99 + t 100 + t 101 + t 102 + t 103 + t 106 + t 108 + t 109 + t 110 + t 114 + t 117 + t 119 + t 121 + t 123 + t 125 +
29t 126 + t 128 + t 129 + t 130 + t 133 + t 134 + t 140 + t 141 + t 145 + t 146 + t 147 + t 148 + t 150 + t 152 + t 154 + t 155 + t 157 + t 158 +
30t 160 + t 161 + t 166 + t 167 + t 171 + t 172 + t 175 + t 176 + t 179 + t 180 + t 185 + t 186 + t 189 + t 190 + t 191 + t 192 + t 195 + t 200 +
31t 201 + t 207 + t 208 + t 209 + t 210 + t 211 + t 219 + t 221 + t 223 + t 225 + t 228 + t 233 + t 234 + t 235 + t 237 + t 238 + t 239 + t 241 +
32t 242 + t 244 + t 245 + t 248 + t 249 + t 250 + t 252 + t 253 + t 255 + t 257 + t 260 + t 262 + t 263 + t 264 + t 272 + t 273 + t 274 + t 276 +
33t 281 + t 284 + t 287 + t 288 + t 289 + t 290 + t 292 + t 297 + t 299 + t 300 + t 301 + t 302 + t 304 + t 305 + t 306 + t 309 + t 311 + t 312 +
34t 313 + t 314 + t 317 + t 318 + t 320 + t 322 + t 323 + t 325 + t 327 + t 328 + t 329 + t 333 + t 335 + t 340 + t 341 + t 344 + t 345 + t 346 +
35t 351 + t 353 + t 354 + t 355 + t 357 + t 358 + t 359 + t 360 + t 365 + t 366 + t 368 + t 371 + t 372 + t 373 + t 376 + t 377 + t 379 + t 382 +
36t 383 + t 387 + t 388 + t 389 + t 392 + t 395 + t 398 + t 401 + t 403 + t 406 + t 407 + t 408 + t 409 + t 410 + t 411 + t 416 + t 417 + t 421 +
37t 422 + t 423 + t 424 + t 425 + t 426 + t 429 + t 430 + t 438 + t 439 + t 440 + t 441 + t 442 + t 443 + t 447 + t 448 + t 450 + t 451 + t 452 +
38t 453 + t 454 + t 456 + t 458 + t 459 + t 460 + t 462 + t 464 + t 465 + t 466 + t 467 + t 471 + t 473 + t 475 + t 476 + t 481 + t 482 + t 483 +
39t 484 + t 486 + t 487 + t 488 + t 491 + t 492 + t 495 + t 496 + t 498 + t 501 + t 503 + t 505 + t 507 + t 510 + t 512 + t 518 + t 519 + t 529 +
40t 531 + t 533 + t 536 + t 539 + t 540 + t 541 + t 543 + t 545 + t 546 + t 547 + t 548 + t 550 + t 552 + t 555 + t 556 + t 557 + t 558 + t 559 +
41t 560 + t 563 + t 565 + t 566 + t 568 + t 580 + t 585 + t 588 + t 589 + t 591 + t 592 + t 593 + t 596 + t 597 + t 602 + t 604 + t 606 + t 610 +
42t 616 + t 620 (mod 2).
43This polynomial factors into 4 irreducibles over GF (2), each of degree 155. One of these is
1 50
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1p(t) = 1 + t + t 2 + t 6 + t 9 + t 10 + t 11 + t 13 + t 14 + t 15 + t 16 + t 18 + t 19 + t 22 + t 23 + t 26 + t 27 + t 29 + t 31 + t 49 + t 50
2+ t 51 + t 54 + t 55 + t 60 + t 61 + t 62 + t 64 + t 66 + t 70 + t 72 + t 74 + t 75 + t 80 + t 82 + t 85 + t 86 + t 88 + t 89 + t 91 + t 93 +
3t 97 + t 101 + t 103 + t 104 + t 111 + t 115 + t 116 + t 117 + t 118 + t 120 + t 121 + t 123 + t 124 + t 126 + t 127 + t 128 + t 129 + t 130 +
4t 131 + t 132 + t 134 + t 136 + t 137 + t 138 + t 139 + t 140 + t 143 + t 145 + t 154 + t 155.
6 y 2+xy = x 3 + t 3
8 r = 11417981541647679048466230373126290329356873447.
10Input: a field size GF (2m), an appropriate D, the corresponding k and r from A.10.3.2..
19If we let p denote the characteristic of K, the equation can be simplified for different values of p. If p > 3
21If p = 2
22 y2 + xy = x3 + ax2 + b, where b ≠ 0.
24 y2 = x3 + ax + b, where b ≠ 0.
26 y2 + cy = x3 + ax + b, where c ≠ 0.
27
28To be useful for pairing-based cryptography a notion of ‘pairing-friendly’ curves has become established
29and this may be formalized by the following conditions. First we define the embedding degree of E with
30respect to r be defined as the smallest integer k such that r | qk – 1. Then an elliptic curve is pairing-friendly
31if:
33 k < log2(r) /8
1 51
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.11.1. Curve Families
2All the curves we consider are defined over a finite field K = GF (q). For cryptographic use we also need a
3suitable subgroup of E(K) of size r. If #E(K) is the order of the group of points of E lying in K, the trace t
4of E/K is t = q + 1 - #E(K). Note that r | #E(K) and for h = #E(K) / r we define GT to be the subgroup of
5order r of GF(ph).
6The search for, and analysis of, pairing-friendly curves has led to a grouping of curves into families, which
7can often be described by equations in the parameters t, r, and q.
8If k is the embedding degree of E, we let be the degrreesize of the maximal twist of E, which we denote
9E'. Note that | k so we define the degree of field over which we consider the twist to be d = k/.
10Curves may then be classified as follows:
11 E1 = E(GF(p))
12 E2 = E(GF(pk))
13 E3 = E'(GF(pd))
15The elements of E1 of order r form the 1-eigenspace of the Frobenius map with respect to r. This will in all
16cases be equal to the pairing group G1. The r-eigenspace of Frobenius lies in E2.
17Pairings may be classified into 3 different types according to the curve types. In particular the types depend
18on how the group G2 is represented.
19In all cases there is a map ζ:G2 → E2 and the Miller loop is always applied to ζ(Q), rather than the element
20Q itself.
25G2 = a subgroup of E2 of order r which is distinct from both the 1-eigenspace and the q-eigenspace of
26Frobenius.
1 52
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.11.2.1. Super-Singular Curves with Embedding Degree 2
2In fields GF (2s) of characteristic 2, curves with k = 2 are of the form
6In fields of prime characteristic q = p > 3 supersingular curves with k = 2 can be defined by:
10Input: q
24E: y2 = x3 – x d where d GF (q) with “Tr d = 1” [MRC: define, and / or give an algm to compute it]
29Output: GF(q), and elliptic curve E such that |E(GF(q))| = cl where c ≤ cmax and l is prime
30 1. λ ← -2k/2 + 4
1 53
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 2. For c from 1 to cmax do
3 a. nk ← λc + c'
4 b. m ← 4c – c'
5 c. fk ← nk2 – m2
7 1. r ← c'mD
9 i. t ← (y – nk)/m + 1
11 iii. q ← cl + t – 1
14 3. return ‘fail’
D
18 1. Choose a prime r such that k | r – 1 and 1
r
20 3. t' ← z + 1
24 7. q ← (t2 + Dy2)/4
1 54
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.11.5. BN Curves
2Barreto Naehrig Curves are of the form E: y2 = x3+b, parameterised by
5 t(x) = 6x2 + 1
6where r and q are both prime. For such curves, k = 12. To find a BN curve, choose random values for x
7until r and q are both prime then choose b GF(q) such that #E(GF(p)) = r.
9A.12. Pairings
10All pairing algorithms defined here are based on the Miller algorithm [Mil86]. Optimizations, e.g. for
11specific curves, are usually not listed; these may be applied as appropriate provided the resulting algorithm
12produces identical results to the one given.
16Type 1 (E Supersingular)
18Type 2 (E Ordinary)
22Type 3 (E Ordinary)
27 fQ',n(P)
28where P, Q G1, Q' = ζ(Q) E2. In defining the Miller loop we consider two arbitrary points on the curve
29and an arbitrary loop length n. When using this loop within a pairing calculation we will specify more
30precisely the values of P, Q and n.
3 1) Set T P, f 1
m 1
4 2) Write n as n 2
i 0
i
i
with ni {0,1}
17The line functions lA,B(Q) are the functions obtained from producing the straight line y-mx-c which passes
18through the points A and B, and then substituting into this equation the x and y coordinate of the point Q.
3The pairing e2 is computed from e1 via e2 (P,Q) = e1 (Q,P) so from now on we shall only consider e1 which
4we will denote e (P,Q).
5To compute e (P,Q) there are a number of pairings which can be used. They all, however, follow the same
6strategy: The element Q is mapped from G2 into E2 using the map ζ., then the Miller function is applied one
7or more times. Finally the resulting values are combined and possibly raised to some power. All of these
8operations can be heavily optimized but in this standard we only present the un-optimized methods.
f p ,r (Q ' )
12 e( P, Q) (1) r
f ( P)
Q ', r
14 Let t > 2 be prime, and let P and Q be points on E with tP = tQ = O. The following procedure
15 computes the Weil pairing.
16
17Given three points (x0, y0), (x1, y1), (u, v) on E, define the function g ((x0, y0), (x1, y1), (u, v)) by
u x1 if x0 x1 and y0 y1
2
18 (3x1 a )( u x1 ) 2 y1 ( v y1 ) if x0 x1 and y0 y1
( x x )v ( y y )u ( x y x y ) if x x
0 1 0 1 0 1 1 0 0 1
19if E is the curve y2 = x3 + ax + b over GF (p), and
u x1 if x 0 x1 and y 0 x1 y1
3
20 x1 ( x1 y1 )u x1 v if x 0 x1 and y 0 y1
2
( x x )v ( y y )u ( x y x y ) if x x
0 1 0 1 0 1 1 0 0 1
22
25
28
1 57
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 — Given points P and Q on E with lP = lQ = O, the Weil pairing <P, Q> is computed as
2 follows:
4 V = P + T, W = Q + U.
5 Then
7 If, in evaluating <P, Q>, one encounters g((x0, y0), (x1, y1), (u, v)) = 0, then the calculation fails. In
8 this (unlikely) event, repeat the calculation with newly chosen T and U.
9 In the case t = 2, the Weil pairing is easily computed as follows: <P, Q> equals 1 if P = Q and –1
10 otherwise.
12 Tate
13The (reduced) Tate Pairing is defined as:
k
1) / r
15 such that e( P, Q ) f P ,r (Q ' ) ( p
17b) The line function l used in the construction of the Tate pairing algorithm is
18Input A, B E(GF(p))[r], Q E(GF(pk))[r]
19Output: lA,B(Q)
20If A = -B,
21 Return Qx – Ax
22 1) If A = B,
23 Set λ = 3Ax2 / 2Ay
24 2) Else
25 Set λ = (By – Ay) / (Bx – Ax)
26 3) Return λ(Qx – Ax) + Ay - Qy
27c) [Proposal: Define this generally in terms of the Miller loop and a generic line function]
11m) Set f f k ( p ) / r
12n) Return f
13o) Eta
14[TBA]
15The Eta-Pairing is only defined for supersingular elliptic curves and is given by, where again Q’ is the
16image of Q under ζ,
k
1) / r
17 e( P, Q) f P ,t 1 (Q ' ) ( p
18A.12.4. Ate
19The Ate pairing may be computed as follows, where again Q’ is the image of Q under ζ,
20by reversing the roles of P and Q in the Tate pairing, giving the following:
( p k 1) / r
21 e( P, Q) f Q ',t 1 ( P) where t is the trace of E/K
22 [Proposal: Define this generally in terms of the Miller loop and a generic line
23function]
25 Output: e(P,Q)
26 Set T P, f 1
27 Let s = t – 1
1 59
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1 Loop for i = (lg(s)) – 1 down to 0
2 Set f f.2lT,T(Q)
3 Set T 2T
5 Set f f.lT,P(Q)
6 Set T T + P
7 End if
8 End loop
p 1
9 Set f f
1) / k ( p )
10 Set f f ( p
k ( p ) / r
11 Set f f
12 Return f
13A.12.5. R-Ate
14[MRC: This has quickly been taken from Scott: pairings in software section 2.3. Is the Q,P order consistent
15with the above? What is z? Is this formulation particular to BN curves?]
16
e Q, P f f l aQ,Q P l aQQ ,aQ P
P
( p12 1) / r
1 60
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4
1A.13.2. Curve-Pairing Compatibility
2[MRC: Shall we drop KSS since they’re not mentioned above?]
Weil ?
Tate ?
Eta ?
Ate ? ?
R-Ate ? ?
1 61
2 Copyright © <year> IEEE. All rights reserved.
3 This is an unapproved IEEE Standards Draft, subject to change.
4