# Twisted Hessian curves

In mathematics, twisted Hessian curves are a generalization of Hessian curves; they were introduced in elliptic curve cryptography to speed up the addition and doubling formulas and to have strongly unified arithmetic. In some operations (see the last sections), it is close in speed to Edwards curves. Twisted Hessian curves were introduced by Bernstein, Lange, and Kohel.

## Definition

Let K be a field. The twisted Hessian form in affine coordinates is given by:
$a\cdot x^{3}+y^{3}+1=d\cdot x\cdot y$
and in projective coordinates by
$a\cdot X^{3}+Y^{3}+Z^{3}=d\cdot X\cdot Y\cdot Z,$
where x = X/Z and y = Y/Z and a,d ∈ K. These curves are birationally equivalent to Hessian curves, and Hessian curves are just the special case of twisted Hessian curves in which a = 1.
Considering the equation a · x$^3$ + y$^3$ + 1 = d · x · y, note that, if a has a cube root in K, then there exists a unique b such that a = b$^3$; otherwise, it is necessary to consider an extension field of K, such as K(a$^{1/3}$). Then, since b$^3$x$^3$ = ax$^3$, defining t = bx, the following equation is needed (in Hessian form) to do the transformation:
$t^{3}+y^{3}+1=d\cdot x\cdot y$.
This means that twisted Hessian curves are birationally equivalent to elliptic curves in Weierstrass form.

## Group law

It is interesting to analyze the group law of the elliptic curve, defining the addition and doubling formulas (because the simple power analysis and differential power analysis attacks are based on the running time of these operations). In general, the group law is defined in the following way: if three points lies in the same line then they sum up to zero. So, by this property, the explicit formulas for the group law depend on the curve shape.
Let P = (x$_1$, y$_1$) be a point; its inverse is then −P = (x$_1$/y$_1$, 1/y$_1$) in the plane. In projective coordinates, let P = (X : Y : Z) be a point; then −P = (X$_1$/Y$_1$ : 1/Y$_1$ : Z) is its inverse. Furthermore, the neutral element in affine plane is θ = (0, −1), and in projective coordinates it is θ = (0 : −1 : 1).
In some applications of elliptic curves for cryptography and integer factorization, it is necessary to compute scalar multiples of P, say [n]P for some integer n, and they are based on the double-and-add method, so the addition and doubling formulas are needed. Using affine coordinates, the addition and doubling formulas for this elliptic curve are as follows.

### Addition formulas

Let P = (x$_1$, y$_1$) and Q = (x$_2$, y$_2$); then, R = P + Q = (x$_3$, y$_3$), where
$x_{3}={\frac {x_{1}-y_{1}^{2}\cdot x_{2}\cdot y_{2}}{a\cdot x_{1}\cdot y_{1}\cdot x_{2}^{2}-y_{2}}}$
$y_{3}={\frac {y_{1}\cdot y_{2}^{2}-a\cdot x_{1}^{2}\cdot x_{2}}{a\cdot x_{1}\cdot y_{1}\cdot x_{2}^{2}-y_{2}}}$

### Doubling formulas

Let P = (x, y); then [2]P = (x$_1$, y$_1$), where
$x_{1}={\frac {x-y^{3}\cdot x}{a\cdot y\cdot x^{3}-y}}$
$y_{1}={\frac {y^{3}-a\cdot x^{3}}{a\cdot y\cdot x^{3}-y}}$

## Algorithms and examples

Here some efficient algorithms of the addition and doubling law are given; they can be important in cryptographic computations, and the projective coordinates are used to this purpose.

### Addition

$A=X_{1}\cdot Z_{2}$
$B=Z_{1}\cdot Z_{2}$
$C=Y_{1}X_{2}$
$D=Y_{1}\cdot Y_{2}$
$E=Z_{1}\cdot Y_{2}$
$F=a\cdot X_{1}\cdot X_{2}$
$X_{3}=A\cdot B-C\cdot D$
$Y_{3}=D\cdot E-F\cdot A$
$Z_{3}=F\cdot C-B\cdot E$
The cost of this algorithm is 12 multiplications, one multiplication by a constant, and 3 additions.
Example:
Let P$_1$ = (1 : −1 : 1) and P$_2$ = (−2 : 1 : 1) be points over a twisted Hessian curve with (a,d) = (2, −2). Then R = P$_1$ + P$_2$ is given by:
$A=-1;B=-1;C=-1;D=-1;E=1;F=2;$
    $x_{3}=0$
    $y_{3}=-3$
    $z_{3}=-3$
That is, R = (0 : −3 : −3).

### Doubling

$D=X_{1}^{3}$
$E=Y_{1}^{3}$
$F=Z_{1}^{3}$
$G=a\cdot D$
$X_{3}=X_{1}\cdot (E-F)$
$Y_{3}=Z_{1}\cdot (G-E)$
$Z_{3}=Y_{1}\cdot (F-G)$
The cost of this algorithm is 3 multiplications, one multiplication by a constant, 3 additions, and 3 cubings. This is the best result obtained for this curve.
Example:
Let P = (1 : −1 : 1) be a point over the curve defined by (a,d) = (2, −2) as above; then, R = [2]P = (x$_3$, y$_3$, z$_3$) is given by:
$D=1;E=-1;F=1;G=-4;$
    $x_{3}=-2$
    $y_{3}=-3$
    $z_{3}=-5$
That is, R = (−2 : −3 : 5).