Batch-Affine Addition
Problem
Given two sets of EC points {Pi} and {Qi}, i∈{1,..,n}, calculate {Ri=Pi+Qi}.
Affine Addition
If P=(xp,yp), Q=(xq,yq), and R=P+Q=(xr,yr), an addition operation on an elliptic curve in short Weierstrass form y2=x3+ax+b is defined as below:
We observe that each addition requires an inversion operation. In finite fields, computing an inverses is expensive and requires Extended Euclidean Theorem. Multiplicative inversions are on the order of 100x more expensive than a multiplication. As a result, no one uses (unbatched) affine point arithmetic in standard operation. Addition in projective coordinates are commonly used instead.
Batch-Affine Addition
Point addition becomes different when independently adding many points. In that case we may use only 1 inversion for all point additions.
Consider n pairs of points:
We want to calculate:
Let's denote:
The product of all λs left to λi yields:
Then, the product of all λs right to λi is:
Let's also denote:
With the results above, we can calculate inversion as the following:
Since λinvcan be precomputed, the same inversion result can be shared across all pairs of points.
Therefore, we reduced the number of inversions required to calculate n additions from n to 1. In total, computing the affine addition of n distinct pairs requires 1 division, 5*n multiplications, n squarings, and 6*n additions on finite fields.
Sage example:
Last updated