BLS12G1Affine
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
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | G1 generator |
neg_generator
Negative G1 generator
function neg_generator() internal pure returns (Bls12G1 memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | Negative G1 generator |
zero
Returns the additive identity element of Bls12G1.
function zero() internal pure returns (Bls12G1 memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | Bls12G1(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
Name | Type | Description |
---|---|---|
self | Bls12G1 | Bls12G1. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of zero check. |
is_infinity
Returns true
if self
is infinity point.
function is_infinity(Bls12G1 memory self) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
self | Bls12G1 | Bls12G1. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of infinity check. |
complement
Returns complement in G1 for apk-proofs
.
function complement() internal pure returns (Bls12G1 memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | Complement in G1. |
add
Returns the result of p + q
.
function add(Bls12G1 memory p, Bls12G1 memory q) internal view returns (Bls12G1 memory);
Parameters
Name | Type | Description |
---|---|---|
p | Bls12G1 | Bls12G1. |
q | Bls12G1 | Bls12G1. |
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | z x + y . |
from
Derive Bls12G1 from uint256[4].
function from(uint256[4] memory x) internal pure returns (Bls12G1 memory);
Parameters
Name | Type | Description |
---|---|---|
x | uint256[4] | uint256[4]. |
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12G1 | Bls12G1. |
serialize
Serialize Bls12G1.
function serialize(Bls12G1 memory g1) internal pure returns (bytes memory r);
Parameters
Name | Type | Description |
---|---|---|
g1 | Bls12G1 | Bls12G1. |
Returns
Name | Type | Description |
---|---|---|
r | bytes | Compressed serialized bytes of Bls12G1. |