* before being reassigned at the only call site of this function.
*/
export function ge_sub_cached (r: ge_p1p1, p: ge_p3, q: ge_cached): void {
- fe_add(r.X, p.Y, p.X)
- fe_sub(r.Y, p.Y, p.X)
+ fe_subadd(r.Y, r.X)
fe_mul_dual(r.X, r.X, q.YminusX, r.Y, r.Y, q.YplusX)
fe_mul2_dual(r.T, q.T2d, p.T, r.Z, p.Z, q.Z)
fe_subadd(r.X, r.Y)
* again before being reassigned at the only call site of this function.
*/
export function ge_sub_precomp (r: ge_p1p1, p: ge_p3, q: ge_precomp): void {
- fe_add(r.X, p.Y, p.X)
- fe_sub(r.Y, p.Y, p.X)
+ fe_subadd(r.Y, r.X)
fe_mul_dual(r.X, r.X, q.yminusx, r.Y, r.Y, q.yplusx)
fe_dbl(r.Z, p.Z)
fe_mul(r.T, q.xy2d, p.T)
fep_unpack(r.X, r.Y, gepair_sub_precomp_rA) // X' = (Y₁+X₁)(Y₂-X₂) - (Y₁-X₁)(Y₂+X₂), Y' = (Y₁-X₁)(Y₂+X₂) + (Y₁+X₁)(Y₂-X₂)
fep_unpack(r.Z, r.T, gepair_sub_precomp_rB) // Z' = 2Z₁ - 2T₁X₂Y₂d, T' = 2T₁X₂Y₂d + 2Z₁
-
- // fe_mul_dual(r.X, r.X, q.yminusx, r.Y, r.Y, q.yplusx)
- // fe_mul(r.T, q.xy2d, p.T)
- // fe_subadd(r.X, r.Y)
- // fe_subadd(r.Z, r.T)
}
function ge_p3_tobytes (s: StaticArray<u8>, h: gepair_p3,