BLS12G1Affine

Git Source

State Variables

G1_ADD

BLS12_377_G1ADD precompile address.

uint256 private constant G1_ADD = 0x0801;

INFINITY_FLAG

INFINITY_FLAG

bytes1 private constant INFINITY_FLAG = bytes1(0x40);

Y_IS_NEGATIVE

Y_IS_NEGATIVE

bytes1 private constant Y_IS_NEGATIVE = bytes1(0x80);

Functions

generator

G1 generator

function generator() internal pure returns (Bls12G1 memory);

Returns

NameTypeDescription
<none>Bls12G1G1 generator

neg_generator

Negative G1 generator

function neg_generator() internal pure returns (Bls12G1 memory);

Returns

NameTypeDescription
<none>Bls12G1Negative G1 generator

zero

Returns the additive identity element of Bls12G1.

function zero() internal pure returns (Bls12G1 memory);

Returns

NameTypeDescription
<none>Bls12G1Bls12G1(BLS12FP.zero(), BLS12FP.zero())

is_zero

Returns true if self is equal to the additive identity.

function is_zero(Bls12G1 memory self) internal pure returns (bool);

Parameters

NameTypeDescription
selfBls12G1Bls12G1.

Returns

NameTypeDescription
<none>boolResult of zero check.

is_infinity

Returns true if self is infinity point.

function is_infinity(Bls12G1 memory self) internal pure returns (bool);

Parameters

NameTypeDescription
selfBls12G1Bls12G1.

Returns

NameTypeDescription
<none>boolResult of infinity check.

complement

Returns complement in G1 for apk-proofs.

function complement() internal pure returns (Bls12G1 memory);

Returns

NameTypeDescription
<none>Bls12G1Complement in G1.

add

Returns the result of p + q.

function add(Bls12G1 memory p, Bls12G1 memory q) internal view returns (Bls12G1 memory);

Parameters

NameTypeDescription
pBls12G1Bls12G1.
qBls12G1Bls12G1.

Returns

NameTypeDescription
<none>Bls12G1z x + y.

from

Derive Bls12G1 from uint256[4].

function from(uint256[4] memory x) internal pure returns (Bls12G1 memory);

Parameters

NameTypeDescription
xuint256[4]uint256[4].

Returns

NameTypeDescription
<none>Bls12G1Bls12G1.

serialize

Serialize Bls12G1.

function serialize(Bls12G1 memory g1) internal pure returns (bytes memory r);

Parameters

NameTypeDescription
g1Bls12G1Bls12G1.

Returns

NameTypeDescription
rbytesCompressed serialized bytes of Bls12G1.