double: () => Point
add: (other: Point) => Point
multiply: (n: bigint, safe?: boolean) => Point
- multiplyUnsafe: (scalar: bigint) => Point
toAffine: () => AffinePoint
assertValidity: () => Point
toBytes: (isCompressed?: boolean) => Bytes
}
return p
},
- multiplyUnsafe (scalar: bigint): Point {
- return this.multiply(scalar, false)
- },
/** Convert point to 2d xy affine point. (X, Y, Z) ∋ (x=X/Z, y=Y/Z) */
toAffine (): AffinePoint {
const { X: x, Y: y, Z: z } = this
/** Identity / zero point */
static I: Point = this.Point(0n, 1n, 0n)
- /** `Q = u1⋅G + u2⋅R`. Verifies Q is not ZERO. Unsafe: non-constant-time. */
- static doubleScalarMultiplyUnsafe (R: Point, u1: bigint, u2: bigint): Point {
- return this.G.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)).assertValidity()
- }
-
static bytesToBigint (b: Bytes): bigint {
let int = BigInt(b[0]), len = b.length
for (let i = 1; i < len; i++) {