Standard elliptic curve arithmetic
Consider an elliptic curve defined by over the finite field , where is the prime, Set the coefficients and , so that reduces toPoint addition
Given two points, and , on the curve with , the point is computed as follows,Point doubling
Given a point on the curve such that , the point is computed as follows, where,Field arithmetic
Several 256-bit operations can be expressed in the following form: where and are 256-bit integers. For instance, if , then states that the result of multiplying and is with a carry of . That is, is the chunk that exceeds 256 bits. Or, if , states that the result of adding and is the same as before: with a carry of . Similarly, division and modular reductions can also be expressed as derivatives of . These operations are performed in the Arithmetic state machine, with registers satisfying the following PIL relation,Remark
Since the above elliptic curve operations are implemented in the PIL language, it is more convenient to express them in terms of the constraints they must satisfy. These constraints are: where , implying that these equations hold true over the integers. This approach is taken because of the need to compute divisions by . Note that only three possible computation scenarios can arise:- is activated while the rest are deactivated,
- , and are activated but and are deactivated,
- , and are activated and and are deactivated.
How operations are performed
Compute the previous operations at 2-byte level. For instance, if one is performing the multiplication of and , at the first clock is computed. Then, is computed in the second clock, followed by in the third, and so on. As depicted in the below figure, this process is completely analogous to the schoolbook multiplication. However, it is performed at 2-byte level, instead of decimal level.
- Compute
- Compute