edwards: use bitmask instead of exp

This commit is contained in:
Paul Miller 2023-04-23 18:28:47 +00:00
parent 213796db4b
commit 16b31b9087
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -102,7 +102,7 @@ export function twistedEdwards(curveDef: CurveType): CurveFn {
nByteLength, nByteLength,
h: cofactor, h: cofactor,
} = CURVE; } = CURVE;
const MASK = _2n ** BigInt(nByteLength * 8); const MASK = _2n << (BigInt(nByteLength * 8) - _1n);
const modP = Fp.create; // Function overrides const modP = Fp.create; // Function overrides
// sqrt(u/v) // sqrt(u/v)