Projective Coordinates in Elliptic Curves
By: Cailyn Yong and Bryan Wee
Previously, we were introduced to elliptic curves and point operations. So far, the elliptic curves we have seen are represented in the affine space, where points can be represented as coordinates. Affine group operations, as we will soon see, are costly as they require field divisions. In this article, we will see how projective coordinates can be used to sidestep these costs and achieve greater efficiency.
Since we are concerned with computational efficiency, we will only be studying curves that are restricted to prime fields. Hence, for all equations below, all field arithmetic is modulo arithmetic.
Cost of Affine Coordinates
Let us consider 2 affine coordinates, , where , and recall how point addition is computed.
If either point is , then is given by the other point.
Else if , then .
Else:
• Let
• Then, and
Notice that in its worst case, point addition requires 2 multiplications, 6 additions/subtractions, and 1 division.
Let us recall how point doubling can be performed as well. To compute , where :
If or , then
Else:
• Let
• Then, and
Point doubling involves 7 multiplications, 4 additions/subtractions, and 1 division.
Both point addition and doubling require 1 field division, which for prime fields, means modular division. This form of division requires the non-trivial act of finding a modular inverse, making it very expensive.
Projective Coordinates
Costs can be reduced by adopting a new coordinate system that avoids field division entirely. Given an affine coordinate , we can transform it into a projective coordinate by taking an arbitrary non-zero value and assigning .
For instance, can be mapped to or , with or respectively. Usually, is chosen to be for convenience; affine coordinates would be transformed to .
Projecting an entire elliptic curve yields the following curve equation.
The diagram below visualizes how a projected curve might look like.
To convert projective coordinates back to affine coordinates , all we have to do is divide the projective coordinate by .
With projective coordinates, the formulae for point addition and point doubling require no field division. Take , , and . Let us see how we can compute .
If either point is , then is given by the other point.
Else, let:
•
•
•To perform point addition,
•
•
•
Next, given , how can compute ?
Let:
•
•
•
•To perform point doubling:
•
•
•
Both operations require more addition and multiplication than before, but demand zero divisions! Knowing this, we can much more efficiently manipulate elliptic curve points by:
Converting affine coordinates to projective coordinates.
Perform the required computation.
Converting the results back to affine coordinates. (Only this step requires division)
Now, only two field divisions are required for any amount of consecutive point addition and doubling. This, in turn, saves a drastic amount of computation for elliptic curves over finite fields.
Jacobian Coordinates
A modified form of projective coordinates is Jacobian coordinates. For Jacobian coordinates, instead of multiplying and with like we did in the standard form of projective coordinates, we map affine coordinates to .
Using Jacobian coordinates, elliptic curves adopt the following equation.
Here is the formula for point addition, assuming :
If either point is , then is given by the other point.
Else, let:
• and
• and
•
•To perform point addition
•
•
•
...and the formula for point doubling.
If then .
Else, let:
•
•
•To perform point doubling:
•
•
•
Like before, these operations do not require field division. Jacobian coordinates offer a slight edge compared to standard projective coordinates because they trade multiplication for more addition/subtraction which tends to be cheaper.
Jacobian Coordinates ⇌ Affine Coordinates
Each instance of affine point addition/doubling requires one field division. This becomes extremely expensive once we consider consecutive curve operations (e.g., scalar multiplication). On the other hand, Jacobian coordinates demand no field divisions. We can exploit this fact to support affine point manipulation by:
1. Converting affine points to Jacobian points, with .
2. Performing all necessary operations in Jacobian space.
3. Converting Jacobian points back to affine space. Let be the modular inverse of .
This way, we only require one modular inversion for an arbitrary number of elliptic curve operations, saving a significant amount of computation!
Conclusion
In the previous article, we learned about the elliptic curve and the discrete logarithm problem. We then restricted the curve such that it can be computed by a computer with finite memory.
In this article, we transformed the curve onto a projective space and saw how it optimizes point arithmetic. After much math, we have arrived at a version of elliptic curves that is optimal for computers, and now have the necessary impetus to learn about elliptic curve cryptography.
Theoretical Quest
Part : Projective Coordinates in Elliptic Curves
If only I could read these glyphs a little faster...