Coordinate Forms

Affine (x,y)(x,y)

Affine form refers to the regular (x,y)(x,y) form of coordinates on an xyxy-plane.

Problem

For elliptic curves, point addition is done very often as it is considered cheap. To calculate point addition in affine form, we must compute the slope m=yQyPxQxPm = \frac{y_Q-y_P}{x_Q-x_P}. However, calculating field inverses or the (xQxP)1(x_Q-x_P)^{-1} in this case is expensive, so we want to prevent the calculation of inverses as much as possible.

Solution

When calculating a series of point operations, we convert points to a different intermediate form that does not require field inverses for point operations and for the final result, we revert back to affine. Calculating through these intermediate forms does not cost any inverse operations; however, converting the forms back to affine will cost one inverse operation.

The reasoning for why our intermediate forms do not calculate inverses is quite simple: when calculating an operation, the resulting formulas of the final xx and yy are manipulated to use the same denominator (projective) or related denominators (Jacobian & XYZZ). This denominator will then be calculated and stored as a continuous separate value ZZ.

We will provide an explanation of projective coordinates to ease our way into understanding Jacobian coordinates, yet in reality for our elliptic curves, we use Jacobian coordinates as it yields much simpler results to work with.

Projective (XZ,YZ):(X,Y,Z)(\frac{X}{Z}, \frac{Y}{Z}) : (X,Y,Z)

In projective form, affine points of (x,y)(x,y) are redefined as (XZ,YZ)(\frac{X}{Z}, \frac{Y}{Z}). In practice, projective form is stored as (X,Y,Z)(X,Y,Z). With this conversion, the elliptic curve equation is changed to:

Y2Z=X3+aXZ2+bZ3Y^2Z =X^3 + aXZ^2 + bZ^3

Affine \Longrightarrow Projective

(x,y)(x1,y1):(x,y,1)(x,y) \Longrightarrow (\frac{x}{1},\frac{y}{1}) :(x, y, 1)

Projective \Longrightarrow Affine

(X,Y,Z)(XZ,YZ)(X, Y,Z) \Longrightarrow (\frac{X}{Z},\frac{Y}{Z})

Calculating Operations

Refer to Hyperelliptic for Projective points on the best practices on how to calculate addition and double operations on projective coordinates.

Jacobian (XZ2,YZ3):(X,Y,Z)(\frac{X}{Z^2},\frac{Y}{Z^3}) :(X, Y, Z)

In Jacobian form, affine points of (x,y)(x,y) are redefined as (XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3}). In practice, Jacobian form is stored as (X,Y,Z)(X,Y,Z). With this conversion, the elliptic curve equation is changed to:

Y2=X3+aXZ4+bZ6Y^2 =X^3 + aXZ^4 + bZ^6

Affine \Longrightarrow Jacobian

(x,y)(x12,y13):(x,y,1)(x,y) \Longrightarrow (\frac{x}{1^2},\frac{y}{1^3}) :(x, y, 1)

Jacobian \Longrightarrow Affine

(X,Y,Z)(XZ2,YZ3)(X, Y,Z) \Longrightarrow (\frac{X}{Z^2},\frac{Y}{Z^3})

Calculating Operations

Refer to Hyperelliptic for Jacobian points on the best practices on how to calculate addition and double operations on Jacobian coordinates.

XYZZ - Extended Jacobian(XZ2,YZ3):(X,Y,Z2,Z3)(\frac{X}{Z^2},\frac{Y}{Z^3}) : (X,Y,Z^2,Z^3)

XYZZ form also known as "Extended Jacobian form" follows the same calculation and reasoning as Jacobian, but with one minor difference: Extended Jacobian is instead stored as (x,y,z2,z3)(x, y, z^2, z^3) to provide better performance of computations with a slight tradeoff in memory.

Affine \Longrightarrow XYZZ

(x,y)(x12,y13):(x,y,12,13)(x,y) \Longrightarrow (\frac{x}{1^2},\frac{y}{1^3}) :(x, y, 1^2, 1^3)

Jacobian \Longrightarrow XYZZ

(X,Y,Z2,Z3)(XZ2,YZ3)(X, Y,Z^2, Z^3) \Longrightarrow (\frac{X}{Z^2},\frac{Y}{Z^3})

Calculating Operations

Refer to Hyperelliptic for XYZZ points on the best practices on how to calculate addition and double operations on XYZZ coordinates.

Summary of all forms:

Form
Point Form in Affine Form
Storage of values
Elliptic Curve Equation

Affine

(x,y)(x,y)

(x,y)(x,y)

y2=x3+ax+by^2 = x^3 + ax + b

Projective

(XZ,YZ)(\frac{X}{Z}, \frac{Y}{Z})

(X,Y,Z)(X,Y,Z)

Y2Z=X3+aXZ2+Z3Y^2Z = X^3 + aXZ^2 + Z^3

Jacobian

(XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3})

(X,Y,Z)(X,Y,Z)

Y2=X3+aXZ4+bZ6Y^2 =X^3+aXZ^4+bZ^6

Extended Jacobian (XYZZ)

(XZ2,YZ3)(\frac{X}{Z^2}, \frac{Y}{Z^3})

(X,Y,Z2,Z3)(X,Y,Z^2, Z^3)

Y2=X3+aXZ4+bZ6Y^2 =X^3+aXZ^4+bZ^6

References

Written by Ashley Jeong of A41

Last updated