Tutorial of Twisted Edwards Curves in Elliptic Curve Cryptography Emilie Menard Barnard
Total Page:16
File Type:pdf, Size:1020Kb
UC SANTA BARBARA, CS 290G, FALL 2015 1 Tutorial of Twisted Edwards Curves in Elliptic Curve Cryptography Emilie Menard Barnard Abstract| This is a tutorial of Twisted Edwards curves. III. Twisted Edwards Curves I plan to introduce them in comparison to Edwards curves, and review standard group law operations. I will then relate These Edwards curves are a specific kind of Twisted Ed- Twisted Edwards curves and Montgomery curves. I will also wards curves. That is, Twisted Edwards curves are a gen- introduce a projective and other popular coordinate systems for Twisted Edwards curves. In addition, I will compare and eralization of Edwards curves. Specifically, every Twisted contrast Twisted Edwards curves with Edwards curves, and Edwards curve is a quadratic twist of a corresponding Ed- briefly discuss the EdDSA application of Twisted Edwards wards curve[13]. A twist is defined as follows: curves. Lastly, I will present the latest research regarding Twisted Edwards curves and their applications. Definition 1: An elliptic curve E over field k has an asso- ciated quadratic twist when there is another elliptic curve which is isomorphic to E over an algebraic closure of k. I. Introduction Specifically, let E be an elliptic curve over a field k such Edwards curves are a family of elliptic curves often used that the field characteristic is not equal to 2 and E is of for cryptographic schemes. They exist over finite fields and the following form: are not only practically used in security measures, but also often studied for their mathematical properties. 2 3 2 y = x + a2x + a4x + a6 Twisted Edwards curves are a generalization of the more popular Edwards curves. These generalized curves are used Then, if d 6= 0, the quadratic twist of E is the curve Ed in important security schemes as well, and thus are also defined below: worth studying. In this paper, I will introduce Twisted Edwards curves y2 = x3 + da x2 + d2a x + d3a and provide sufficient background information so that one 2 4 6 may apply them in their future studies. d Moreover, the curvesp E and E are isomorphic over the II. Edwards Curves field extension k( d) [14]. Before discussing Twisted Edwards curves, I will briefly In general, a Twisted Edwards curve over the field k review the more commonly-known Edwards curves and (where the characteristic of k is no equal to 2) takes the their group law operations. following form: The original form of an Edwards curve, proposed by 2 2 2 2 Harold Edwards in 2007, is as follows [7]: ax + y = 1 + dx y (2) x2 + y2 = c2 + c2x2y2 with non-zeros a 6= d. It can be shown that eq. (2) is a quadratic twist of the Bernstein and Lange then presented a simpler form given following Edwards curve: below [9]: x2 + y2 = 1 + dx2y2 (1) x¯2 +y ¯2 = 1 + (d=a)¯x2y¯2 where d is a quadratic non-residue, that is, the congruence p x2 ≡ d (mod p) where the mapp (¯x; y¯) ! (x; y) = (¯x a; y¯) is an isomor- phism over k( a) [2]. for an integer 0 < x < p has no solution [15]. Note further that a Twisted Edwards curve is just an The zero or neutral element is (0; 1), meaning (x; y) ⊕ Edwards curve with a = 1: (0; 1) = (x; y) for all x; y. The inverse of (x; y) is given by 2 2 2 2 (−x; y). The addition law for two points P = (x1; y1) and ax + y = 1 + dx y eq. (2) Q = (x ; y ) on an Edwards curve is as follows: 2 2 1 · x2 + y2 = 1 + dx2y2 (let a = 1) x y + x y y y − x x 2 2 2 2 P ⊕ Q = 1 2 2 1 ; 1 2 1 2 x + y = 1 + dx y eq. (1) 1 + dx1x2y1y2 1 − dx1x2y1y2 Note that the resulting point P ⊕ Q is also a point on the IV. Group Law Operations Edwards curve [9]. Just like with Edwards curves, the zero or neutral ele- Author is with the Department of Computer Science, University of ment on a Twisted Edwards curve is (0; 1), and the inverse California, Santa Barbara, CA 93106. E-mail: [email protected] of point (x; y) is (−x; y) [13]. UC SANTA BARBARA, CS 290G, FALL 2015 2 A. Addition B. Doubling Let P = (x1; y1) and Q = (x2; y2) be two points on a We can derive a doubling formula for Twisted Edwards curve. Then the addition law is given [2]P = (x1; y1) ⊕ (x1; y1) from the addition formula given below [2]: by eq (3): x1y2 + y1x2 y1y2 − ax1x2 x1y2 + y1x2 y1y2 − ax1x2 P ⊕ Q = ; P ⊕ Q = ; (3) 1 + dx1x2y1y2 1 − dx1x2y1y2 1 + dx1x2y1y2 1 − dx1x2y1y2 x y + y x y y − ax x 2[P ] = 1 1 1 1 ; 1 1 1 1 For example, consider the following Twisted Edwards 1 + dx1x1y1y1 1 − dx1x1y1y1 curve with a = 3 and d = 2: 2x y y2 − ax2 = 1 1 ; 1 1 1 + dx2y2 1 − dx2y2 3x2 + y2 = 1 + 2x2y2 (4) 1 1 1 1 p This is equivalent to the following: Note that the point (1; 2) is on the curve. We can verify 2x y y2 − ax2 this by plugging the x and y values into eq (4): 1 1 1 1 2[P ] = 2 2 ; 2 2 (5) ax1 + y1 2 − ax1 − y1 2 2 2 2 p 3x + y = 1 + 2x y For example, consider doubling the point (1; 2) on the p p 3(1)2 + ( 2)2 =? 1 + 2(1)2( 2)2 curve given in eq. (4): ? 2x y y2 − ax2 3 · 1 + 2 = 1 + 2 · 1 · 2 2[P ] = 1 1 ; 1 1 ax2 + y2 2 − ax2 − y2 5 = 5 X 1 1 1 1 = (x ; y ) p 3 3 Similarly, we can also very that the point (1; − 2) is on =) the same curve: 2x y x = 1 1 3 ax2 + y2 3x2 + y2 = 1 + 2x2y2 1 p1 p p 2 · 1 · 2 2 2 ? 2 2 3(1) + (− 2) = 1 + 2(1) (− 2) = p 2 3 · 12 + 2 ? p 3 · 1 + 2 = 1 + 2 · 1 · 2 2 2 = 5 = 5 X 5 y2 − ax2 p p y = 1 1 Thus, we can use eq. (3) to find (1; 2) ⊕ (1; − 2): 2 2 2 2 − ax1 − y1 p 2 2 p p x1y2 + y1x2 y1y2 − ax1x2 2 − 3 · 1 (1; 2) ⊕ (1; − 2) = ; = p 2 2 1 + dx1x2y1y2 1 − dx1x2y1y2 2 − 3 · 1 − 2 −1 = (x3; y3) = =) −3 p p 1 1 · (− 2) + 1 · ( 2) = x3 = p p 3 1 + 2 · 1 · 1 · 2 · (− 2) p p Thus, [2](1; 2) = 2 2 ; 1 . Let's confirm that [2]P is 0 5 3 = 1 + 2 · (−2) indeed on the Twisted Edwards curve: = 0 3x2 + y2 = 1 + 2x2y2 p p p 2 p 2 2 · (− 2) − 3 · 1 · 1 ! 2 ! 2 2 2 1 ? 2 2 1 y3 = p p 3 + = 1 + 2 1 − 2 · 1 · 1 · 2 · (− 2) 5 3 5 3 −2 − 3 = 4 · 2 1 ? 4 · 2 1 1 − 2 · (−2) 3 + = 1 + 2 25 9 25 9 = −1 24 1 225 16 + =? + p p 25 9 225 255 Therefore, (1; 2)⊕(1; − 2) = (0; −1). We can also check 216 25 ? 241 that this point is on our curve given by eq. (4): + = 225 225 225 241 241 3x2 + y2 = 1 + 2x2y2 = 225 255 X 2 2 ? 2 2 3(0) + (−1) = 1 + 2(0) (−1) Therefore [2]P is on the Twisted Edwards curve, as ex- 1 = 1 X pected. UC SANTA BARBARA, CS 290G, FALL 2015 3 V. Twisted Edwards Curves and Montgomery C. Projective Coordinate System Curves An affine point (x; y) can also be considered in the pro- Twisted Edwards curves and Montgomery curves are jective coordinate system. X; Y and Z represent the x and closely related. First, I will provide a brief introduction y coordinates using the following rules: to Montgomery curves. Fix a field k with characteristic of k not equal to 2. Fix x = X=Z specific A; B 2 k. Then the following: y = Y=Z By2 = x3 + Ax2 + x The corresponding projective Twisted Edwards curve is of the form below: is a Montgomery curve [11]. It can be shown that every Twisted Edwards curve over (aX2 + Y 2)Z = Z4 + dX2Y 2 a field k is birationally equivalent over k to a Montgomery curve [2]. A birational equivalence is defined as follows: where Z 6= 0 [3]. Definition 2: Two varieties are said to be birationally Using the projective coordinate system, inversion costs equivalent if there exits a birational map between them, or can be avoided [13]. an isomorphism of their function fields as extensions of the base field. VII. Twisted Edwards Curves versus Edwards In the case of Twisted Edwards curves and Montgomery Curves curves, their rational function fields are isomorphic. Simi- In some cases, there are advantages to using Twisted Ed- larly, every Montgomery curve over k is birationally equiv- wards curves over Edwards curves. Even when a curve can alent over k to a Twisted Edwards curve. Thus, the set be expressed in the form of an Edwards curve, expressing of Montgomery curves over k is equivalent to the set of it as a Twisted Edwards curve oven saves arithmetic time. Twisted Edwards curves over k [2]. If you are free to choose the curve in your application, you can use this knowledge to your advantage to save time [2]. VI. Alternate Coordinate Systems Twisted Edwards curves also cover more elliptic curves There are various alternate coordinate systems in which than Edwards curves over fields over prime p where one can work with coordinates on a given Twisted Edwards p ≡ 1 (mod 4).