@tevm/voltaire / crypto/Bls12381 / G2
G2
Functions
add()
add(Defined in: src/crypto/Bls12381/G2/add.js:14 Add two G2 points using Jacobian coordinates Algorithm: https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-2007-blp1,p2):Bls12381G2PointType
Parameters
p1
Bls12381G2PointType
First point
p2
Bls12381G2PointType
Second point
Returns
Bls12381G2PointType
double()
double(Defined in: src/crypto/Bls12381/G2/double.js:12 Double a G2 point using Jacobian coordinates Algorithm: https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-2007-blpoint):Bls12381G2PointType
Parameters
point
Bls12381G2PointType
Point to double
Returns
Bls12381G2PointType
equal()
equal(Defined in: src/crypto/Bls12381/G2/equal.js:12 Check if two G2 points are equal In Jacobian coordinates: P1 = P2 iff X1Z2^2 = X2Z1^2 and Y1Z2^3 = Y2Z1^3p1,p2):boolean
Parameters
p1
Bls12381G2PointType
First point
p2
Bls12381G2PointType
Second point
Returns
boolean
fromAffine()
fromAffine(Defined in: src/crypto/Bls12381/G2/fromAffine.js:10 Create G2 point from affine coordinatesx,y):Bls12381G2PointType
Parameters
x
Bls12381Fp2Type
x-coordinate (Fp2)
y
Bls12381Fp2Type
y-coordinate (Fp2)
Returns
Bls12381G2PointType
generator()
generator(): Bls12381G2PointType
Defined in: src/crypto/Bls12381/G2/generator.js:8
Return the generator point for G2
Returns
Bls12381G2PointType
infinity()
infinity(): Bls12381G2PointType
Defined in: src/crypto/Bls12381/G2/infinity.js:6
Return the point at infinity (identity element) for G2
Returns
Bls12381G2PointType
isOnCurve()
isOnCurve(Defined in: src/crypto/Bls12381/G2/isOnCurve.js:13 Check if a G2 point is on the curve y^2 = x^3 + 4(1+i) In Jacobian projective coordinates where (X, Y, Z) represents (X/Z^2, Y/Z^3): Y^2 = X^3 + b*Z^6point):boolean
Parameters
point
Bls12381G2PointType
Point to check
Returns
boolean
isZero()
isZero(Defined in: src/crypto/Bls12381/G2/isZero.js:9 Check if a G2 point is the point at infinitypoint):boolean
Parameters
point
Bls12381G2PointType
Point to check
Returns
boolean
mul()
mul(Defined in: src/crypto/Bls12381/G2/mul.js:14 Scalar multiplication of G2 point using double-and-addpoint,scalar):Bls12381G2PointType
Parameters
point
Bls12381G2PointType
Point to multiply
scalar
bigint
Scalar multiplier
Returns
Bls12381G2PointType
negate()
negate(Defined in: src/crypto/Bls12381/G2/negate.js:10 Negate a G2 point (reflect over x-axis)point):Bls12381G2PointType
Parameters
point
Bls12381G2PointType
Point to negate
Returns
Bls12381G2PointType
toAffine()
toAffine(Defined in: src/crypto/Bls12381/G2/toAffine.js:12 Convert G2 point from projective to affine coordinates Affine: (x/z^2, y/z^3, 1)point):Bls12381G2PointType
Parameters
point
Bls12381G2PointType
Point to convert
Returns
Bls12381G2PointType
