# Twisted Edwards curve

In algebraic geometry, the **twisted Edwards curves** are plane models of elliptic curves, a generalisation of Edwards curves introduced by Bernstein, Birkner, Joye, Lange and Peters in 2008.^{[1]} The curve set is named after mathematician Harold M. Edwards. Elliptic curves are important in public key cryptography and twisted Edwards curves are at the heart of an electronic signature scheme called EdDSA that offers high performance while avoiding security problems that have surfaced in other digital signature schemes.

## Definition

A twisted Edwards curve [math]\displaystyle{ E_{E,a,d} }[/math] over a field [math]\displaystyle{ \mathbb{K} }[/math] with characteristic not equal to 2 (that is, no element is its own additive inverse) is an affine plane curve defined by the equation:

- [math]\displaystyle{ E_{E,a,d}: a x^2+y^2= 1+dx^2y^2 }[/math]

where [math]\displaystyle{ a, d }[/math] are distinct non-zero elements of [math]\displaystyle{ \mathbb{K} }[/math].

Each twisted Edwards curve is a twist of an Edwards curve. The special case [math]\displaystyle{ a = 1 }[/math] is *untwisted*, because the curve reduces to an ordinary Edwards curve.

Every twisted Edwards curve is birationally equivalent to an elliptic curve in Montgomery form and vice versa.^{[2]}

## Group law

As for all elliptic curves, also for the twisted Edwards curve, it is possible to do some operations between its points, such as adding two of them or doubling (or tripling) one. The results of these operations are always points that belong to the curve itself. In the following sections some formulas are given to obtain the coordinates of a point resulted from an addition between two other points (addition), or the coordinates of point resulted from a doubling of a single point on a curve.

### Addition on twisted Edwards curves

Let [math]\displaystyle{ \mathbb{K} }[/math] be a field with characteristic different from 2. Let [math]\displaystyle{ (x_1,y_1) }[/math] and [math]\displaystyle{ (x_2,y_2) }[/math] be points on the twisted Edwards curve. The equation of twisted Edwards curve is written as;

- [math]\displaystyle{ E_{E, a, d} }[/math]: [math]\displaystyle{ ax^2+y^2=1+dx^2y^2 }[/math].

The sum of these points [math]\displaystyle{ (x_1,y_1), (x_2,y_2) }[/math] on [math]\displaystyle{ E_{E, a, d} }[/math] is:

- [math]\displaystyle{ (x_1,y_1) + (x_2,y_2) = \left(\frac{x_1y_2+y_1x_2}{1+dx_1x_2y_1y_2} , \frac{y_1y_2-ax_1x_2}{1-dx_1x_2y_1y_2}\right) }[/math]

The neutral element is (0,1) and the negative of [math]\displaystyle{ (x_1,y_1) }[/math] is [math]\displaystyle{ (-x_1,y_1) }[/math]

These formulas also work for doubling. If *a* is a *square* in [math]\displaystyle{ \mathbb{K} }[/math] and *d* is a *non-square* in [math]\displaystyle{ \mathbb{K} }[/math], these formulas are *complete*: this means that they can be used for all pairs of points without exceptions; so they work for doubling as well, and neutral elements and negatives are accepted as inputs.^{[3]}^{[failed verification]}

**Example of addition**

Given the following twisted Edwards curve with *a* = 3 and *d* = 2:

- [math]\displaystyle{ 3x^2 + y^2 = 1 + 2x^2y^2 }[/math]

it is possible to add the points [math]\displaystyle{ P_1=(1,\sqrt{2}) }[/math] and [math]\displaystyle{ P_2=(1,-\sqrt{2}) }[/math] using the formula given above. The result is a point P_{3} that has coordinates:

- [math]\displaystyle{ x_3 = \frac{x_1y_2+y_1x_2}{1+dx_1x_2y_1y_2} = 0, }[/math]

- [math]\displaystyle{ y_3 = \frac{y_1y_2-ax_1x_2}{1-dx_1x_2y_1y_2} = -1. }[/math]

### Doubling on twisted Edwards curves

*Doubling* can be performed with exactly the same formula as addition.
Doubling of a point [math]\displaystyle{ (x_1,y_1) }[/math] on the curve [math]\displaystyle{ E_{E, a, d} }[/math] is:

[math]\displaystyle{ 2(x_1,y_1) = (x_3,y_3) }[/math]

where

- [math]\displaystyle{ \begin{align} x_3 & = \frac{x_1y_1+y_1x_1}{1+dx_1x_1y_1y_1}=\frac{2x_1y_1}{ax_1^2+y_1^2} \\[6pt] y_3 & = \frac{y_1y_1-ax_1x_1}{1-dx_1x_1y_1y_1}=\frac{y_1^2-ax_1^2}{2-ax_1^2-y_1^2}. \end{align} }[/math]

Denominators in doubling are simplified using the curve equation [math]\displaystyle{ dx^2y^2 = ax^2 + by^2 - 1 }[/math]. This reduces the power from 4 to 2 and allows for more efficient computation.

**Example of doubling**

Considering the same twisted Edwards curve given in the previous example, with a=3 and d=2, it is possible to double the point [math]\displaystyle{ P_1=(1,\sqrt{2}) }[/math]. The point 2P_{1} obtained using the formula above has the following coordinates:

- [math]\displaystyle{ x_3 = \frac{2x_1y_1}{ax_1^2+y_1^2} = \frac{2\sqrt{2}}{5}, }[/math]

- [math]\displaystyle{ y_3 = \frac{y_1^2-ax_1^2}{2-ax_1^2-y_1^2} = \frac{1}{3}. }[/math]

It is easy to see, with some little computations, that the point [math]\displaystyle{ P_3=\left(\frac{2\sqrt{2}}{5}, \frac{1}{3}\right) }[/math] belongs to the curve [math]\displaystyle{ 3x^2 + y^2 = 1 + 2x^2y^2 }[/math].

## Extended coordinates

There is another kind of coordinate system with which a point in the twisted Edwards curves can be represented.
A point [math]\displaystyle{ (x,y,z) }[/math] on [math]\displaystyle{ ax^2+y^2= 1+dx^2y^2 }[/math] is represented as *X*, *Y*, *Z*, *T* satisfying the following equations *x* = *X*/*Z*, *y* = *Y*/*Z*, *xy* = *T*/*Z*.

The coordinates of the point (*X*:*Y*:*Z*:*T*) are called the **extended twisted Edwards coordinates**. The identity element is represented by (0:1:1:0). The negative of a point is (−*X*:*Y*:*Z*:−*T*).

### Inverted twisted Edwards coordinates

The coordinates of the point [math]\displaystyle{ (X_1:Y_1:Z_1) }[/math] are called the **inverted twisted Edwards coordinates** on the curve
[math]\displaystyle{ (X^2+aY^2)Z^2= X^2Y^2+dZ^4 }[/math]with [math]\displaystyle{ X_1Y_1Z_1 \ne 0 }[/math]; this point to the affine one [math]\displaystyle{ (Z_1/X_1, Z_1/Y_1) }[/math] on [math]\displaystyle{ E_{E, a, d} }[/math].
Bernstein and Lange introduced these inverted coordinates, for the case a=1 and observed that the coordinates save time in addition.

### Projective twisted Edwards coordinates

The equation for the projective twisted Edwards curve is given as:
[math]\displaystyle{ (aX^2+Y^2)Z^2= Z^4+dX^2Y^2 }[/math] For *Z*_{1} ≠ 0 the point (X_{1}:Y_{1}:Z_{1}) represents the affine point (*x*_{1} = *X*_{1}/*Z*_{1}, *y*_{1} = *Y*_{1}/*Z*_{1}) on *E*_{E,a,d}.

Expressing an elliptic curve in twisted Edwards form saves time in arithmetic, even when the same curve can be expressed in the Edwards form.

## Addition in projective twisted curves

The addition on a projective twisted Edwards curve is given by

- (X
_{3}:Y_{3}:Z_{3}) = (X_{1}:Y_{1}:Z_{1}) + (X_{2}:Y_{2}:Z_{2})

and costs 10**M**ultiplications + 1**S**quaring + 2**D** + 7 **a**dditions, where the 2**D** are one multiplication by *a* and one by *d*.

- Algorithm

- A = Z
_{1}· Z_{2}, - B = A
^{2} - C = X
_{1}· X_{2} - D = Y
_{1}· Y_{2} - E = dC · D
- F = B − E
- G = B + E
- X
_{3}= A · F((X_{1}+ Y_{1}) · (X_{2}+ Y_{2}) − C − D) - Y
_{3}= A · G · (D − aC) - Z
_{3}= F · G

### Doubling on projective twisted curves

Doubling on the projective twisted curve is given by

- (X
_{3}:Y_{3}:Z_{3}) = 2(X_{1}:Y_{1}:Z_{1}).

This costs 3**M**ultiplications + 4**S**quarings + 1**D** + 7**a**dditions, where 1**D** is a multiplication by **a**.

- Algorithm

- B = (X
_{1}+ Y_{1})^{2} - C = X
_{1}^{2} - D = Y
_{1}^{2} - E = aC
- F = E + D
- H = Z
_{1}^{2} - J = F − 2H
- X
_{3}= (B − C − D).J - Y
_{3}= F · (E − D) - Z
_{3}= F · J^{[1]}

## See also

- EdDSA
- For more information about the running time required in a specific case, see Table of costs of operations in elliptic curves.

## Notes

- ↑
^{1.0}^{1.1}Bernstein, Daniel J.; Birkner, Peter; Joye, Marc; Lange, Tanja; Peters, Christiane (2008). Vaudenay, Serge. ed (in en).*Twisted Edwards Curves*. Lecture Notes in Computer Science.**5023**. Berlin, Heidelberg: Springer. 389–405. doi:10.1007/978-3-540-68164-9_26. ISBN 978-3-540-68164-9. https://link.springer.com/chapter/10.1007/978-3-540-68164-9_26. - ↑ Daniel J. Bernstein; Peter Birkner. "Twisted Edwards Curves". https://eprint.iacr.org/2008/013.pdf. Retrieved 28 January 2020.
- ↑ Daniel J. Bernstein and Tanja Lange,
*Faster addition and doubling on elliptic curves*

## References

- Daniel J. Bernstein; Marc Joye; Tanja Lange; Peter Birkner; Christiane Peters,
*Twisted Edwards Curves*, http://eprint.iacr.org/2008/013.pdf

- Huseyin Hisil, Kenneth Wong, Gary Carter, Ed Dawson. (2008), "Twisted Edwards Curves revisited",
*Cryptology ePrint Archive*, http://eprint.iacr.org/2008/522

- Daniel J. Bernstein; Tanja Lange; Peter Birkner; Christiane Peters,
*ECM using Edwards curves*, http://eprint.iacr.org/2008/016.pdf

## External links

- http://hyperelliptic.org/EFD/g1p/index.html
- http://hyperelliptic.org/EFD/g1p/auto-twisted.html
- The Ed25519 algorithm: http://ed25519.cr.yp.to/

Original source: https://en.wikipedia.org/wiki/Twisted Edwards curve.
Read more |