BW6G1Affine

Git Source

State Variables

G1_ADD

BW6_G1_ADD precompile address.

uint256 private constant G1_ADD = 0x080a;

G1_MUL

BW6_G1_MUL precompile address.

uint256 private constant G1_MUL = 0x080b;

G1_MULTIEXP

BW6_G1_MULTIEXP precompile address.

uint256 private constant G1_MULTIEXP = 0x080c;

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

zero

Returns the additive identity element of Bw6G1.

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

Returns

NameTypeDescription
<none>Bw6G1Bw6G1(BW6FP.zero(), BW6FP.zero())

is_zero

Returns true if self is equal to the additive identity.

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

Parameters

NameTypeDescription
selfBw6G1Bw6G1.

Returns

NameTypeDescription
<none>boolResult of zero check.

is_infinity

Returns true if self is infinity point.

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

Parameters

NameTypeDescription
selfBw6G1Bw6G1.

Returns

NameTypeDescription
<none>boolResult of infinity check.

eq

Returns true if a is equal to a.

function eq(Bw6G1 memory a, Bw6G1 memory b) internal pure returns (bool);

Parameters

NameTypeDescription
aBw6G1Bw6G1.
bBw6G1Bw6G1.

Returns

NameTypeDescription
<none>boolResult of equal check.

neg

If self.is_zero(), returns self (== Self::zero()). Else, returns (x, -y), where self = (x, y).

function neg(Bw6G1 memory self) internal pure;

Parameters

NameTypeDescription
selfBw6G1Bw6Fr.

add

Returns the result of p + q.

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

Parameters

NameTypeDescription
pBw6G1Bw6G1.
qBw6G1Bw6G1.

sub

Returns the result of p - q.

function sub(Bw6G1 memory p, Bw6G1 memory q) internal view returns (Bw6G1 memory z);

Parameters

NameTypeDescription
pBw6G1Bw6G1.
qBw6G1Bw6G1.

Returns

NameTypeDescription
zBw6G1p - q.

mul

Returns the result of p * scalar.

function mul(Bw6G1 memory p, Bw6Fr memory scalar) internal view returns (Bw6G1 memory);

Parameters

NameTypeDescription
pBw6G1Bw6G1.
scalarBw6FrBw6Fr.

Returns

NameTypeDescription
<none>Bw6G1z p * scalar.

msm

Multi-scalar multiplication

function msm(Bw6G1[] memory bases, Bw6Fr[] memory scalars) internal view returns (Bw6G1 memory);

Parameters

NameTypeDescription
basesBw6G1[]Bw6G1[].
scalarsBw6Fr[]Bw6Fr[].

Returns

NameTypeDescription
<none>Bw6G1Result of msm.

from

Derive Bw6G1 from uint256[6].

function from(uint256[6] memory x) internal pure returns (Bw6G1 memory);

Parameters

NameTypeDescription
xuint256[6]uint256[6].

Returns

NameTypeDescription
<none>Bw6G1Bw6G1.

serialize

Serialize Bw6G1.

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

Parameters

NameTypeDescription
g1Bw6G1Bw6G1.

Returns

NameTypeDescription
rbytesCompressed serialized bytes of Bw6G1.

debug

Debug Bw6G1 in bytes.

function debug(Bw6G1 memory self) internal pure returns (bytes memory);

Parameters

NameTypeDescription
selfBw6G1Bw6G1.

Returns

NameTypeDescription
<none>bytesUncompressed serialized bytes of Bw6G1.