forked from tornado-packages/noble-curves
edwards: use bitmask instead of exp
This commit is contained in:
parent
213796db4b
commit
16b31b9087
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user