From: Chris Duncan Date: Mon, 26 Oct 2026 00:05:47 +0000 (-0700) Subject: Remove commented code and use merged arithmetic in regular p file. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=307ec0b90738ccf62057f91b098e4473ce0553e8;p=nano25519.git Remove commented code and use merged arithmetic in regular p file. --- diff --git a/src/assembly/ed25519/p.ts b/src/assembly/ed25519/p.ts index dcab67f..9086794 100644 --- a/src/assembly/ed25519/p.ts +++ b/src/assembly/ed25519/p.ts @@ -228,8 +228,7 @@ export function ge_sub_p3 (r: ge_p3, p: ge_p3, q: ge_p3, t_fe: FieldElement, t_g * 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) @@ -250,8 +249,7 @@ export function ge_sub_cached (r: ge_p1p1, p: ge_p3, q: ge_cached): void { * 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) diff --git a/src/assembly/ed25519/p2.ts b/src/assembly/ed25519/p2.ts index d0e76a1..3aeb14a 100644 --- a/src/assembly/ed25519/p2.ts +++ b/src/assembly/ed25519/p2.ts @@ -309,11 +309,6 @@ export function gepair_sub_precomp (r: ge_p1p1, p: ge_p3, q: ge_precomp): void { 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, h: gepair_p3,