Elliptic Arithmetic 03: Projective and Jacobian Coordinates
Elliptic arithmetic notes / 03
Projective and Jacobian coordinates
Projective coordinates replace the inversions within point additions by multiplications and squarings, leaving one inversion for the final affine conversion.
The reference text treats coordinate choice as an implementation decision: affine formulas are simple, but projective formulas dominate when inversion is much more expensive than multiplication.
Homogeneous coordinates
A projective point is an equivalence class of nonzero triples. For every nonzero field element \(\lambda\), standard projective coordinates identify
\[(X:Y:Z)\sim(\lambda X:\lambda Y:\lambda Z).\]When \(Z\) is nonzero, it corresponds to \((X/Z,Y/Z)\). Triples with \(Z=0\) lie on the projective line at infinity; on the projective closure of a short-Weierstrass curve, the curve has a single such point.
Jacobian coordinates
For short Weierstrass curves, Jacobian coordinates use
\[(X:Y:Z)\longmapsto (X/Z^2,\;Y/Z^3).\]Jacobian equivalence is weighted: \((X:Y:Z)\sim(\lambda^2X:\lambda^3Y:\lambda Z)\) for nonzero \(\lambda\). Thus the same affine point has many Jacobian representatives, but the scaling rule is not the uniform projective rule from the previous subsection.
The curve equation becomes
\[Y^2=X^3+aXZ^4+bZ^6.\]The affine point \((x,y)\) is represented by \((x:y:1)\). In the weighted model, the identity has representative \((1:1:0)\), which satisfies \(Y^2=X^3\) at \(Z=0\). The P-256 test implementation instead uses the array triple \((0,1,0)\) as an infinity sentinel. That triple does not satisfy the weighted curve equation; point routines recognize it through \(Z=0\) and handle it explicitly.
typedef struct {
fe256_t X, Y, Z;
} p256_jac_t;
static uint32_t p256_jac_is_infinity(const p256_jac_t *p) {
return fe256_is_zero(&p->Z);
}
Conversion costs
To convert \((X:Y:Z)\) with \(Z\ne 0\) to affine, compute
\[Z^{-1},\qquad x=XZ^{-2},\qquad y=YZ^{-3}.\]The standard schedule computes \(u=Z^{-1}\), \(v=u^2\), \(x=Xv\), and \(y=Yvu\): one inversion, one squaring, and three multiplications. The scalar-multiplication loop performs this conversion once at the end. These coordinate conventions and costs agree with the Explicit-Formulas Database.
Example: same affine point, many representatives
Over \(\mathbb F_{17}\), \((5,1)\) is represented by \((5,1,1)\). With \(\lambda=3\), the equivalent Jacobian representative is \((\lambda^2 5,\lambda^3 1,\lambda)=(11,10,3)\) because \(11/3^2\equiv 5\) and \(10/3^3\equiv 1\).
Example: why inversion avoidance matters
Write \(I,M,S\) for the measured costs of field inversion, multiplication, and squaring. Counting these operations, affine addition with distinct noninverse inputs uses \(I+2M+S\), while a common mixed Jacobian formula uses \(7M+4S\). These counts omit additions, subtractions, and exceptional-case handling. A runtime comparison includes those costs and the final affine conversion as well as the relative cost of \(I\), \(M\), and \(S\).
Representation invariant
A Jacobian point is valid if either \(Z=0\) and the point is the internal infinity encoding, or \(Z\ne 0\) and the affine pair obtained by division satisfies the curve equation. Every point operation must preserve this representation invariant as well as the field layer’s range bounds. The sentinel is handled by the point API before a formula requiring \(Z\ne0\) is used.
SageMath representative check
p = 17
F = GF(p)
x, y, z = F(11), F(10), F(3)
print(x / z^2, y / z^3)
print((x / z^2, y / z^3) == (F(5), F(1)))
