From e57aec63d8fbbc32eea966c85bca9cc66df321e9 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 30 Jan 2023 07:04:36 +0000 Subject: [PATCH] Fix edwards assertValidity --- src/abstract/edwards.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abstract/edwards.ts b/src/abstract/edwards.ts index fc7ddec..30c2a0c 100644 --- a/src/abstract/edwards.ts +++ b/src/abstract/edwards.ts @@ -184,7 +184,7 @@ export function twistedEdwards(curveDef: CurveType): CurveFn { const Z4 = modP(Z2 * Z2); // Z⁴ const aX2 = modP(X2 * a); // aX² const left = modP(Z2 * modP(aX2 + Y2)); // (aX² + Y²)Z² - const right = modP(Z4 * modP(d * X2 * Y2)); // Z⁴ + dX²Y² + const right = modP(Z4 + modP(d * modP(X2 * Y2))); // Z⁴ + dX²Y² if (left !== right) throw new Error('bad point: equation left != right (1)'); // In Extended coordinates we also have T, which is x*y=T/Z: check X*Y == Z*T const XY = modP(X * Y);