BLS12FP
State Variables
MOD_EXP
MOD_EXP precompile address.
uint256 private constant MOD_EXP = 0x05;
Functions
q
Returns base field: q = 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177
function q() internal pure returns (Bls12Fp memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12Fp | Base field. |
zero
Returns the additive identity element of Bls12Fp.
function zero() internal pure returns (Bls12Fp memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12Fp | Bls12Fp(0, 0) |
is_zero
Returns true
if self
is equal to the additive identity.
function is_zero(Bls12Fp memory self) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
self | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of zero check. |
eq
Returns true
if x
is equal to y
.
function eq(Bls12Fp memory x, Bls12Fp memory y) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
x | Bls12Fp | Bls12Fp. |
y | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of equal check. |
gt
Returns true
if x
is larger than y
.
function gt(Bls12Fp memory x, Bls12Fp memory y) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
x | Bls12Fp | Bls12Fp. |
y | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of gt check. |
neg
Returns the result negative of self
.
function neg(Bls12Fp memory self) internal pure returns (Bls12Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
self | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bls12Fp | - self . |
add_nomod
Returns the result of x + y
.
function add_nomod(Bls12Fp memory x, Bls12Fp memory y) internal pure returns (Bls12Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
x | Bls12Fp | Bls12Fp. |
y | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bls12Fp | x + y . |
sub
Returns the result of (x - y) % p
.
function sub(Bls12Fp memory x, Bls12Fp memory y) internal pure returns (Bls12Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
x | Bls12Fp | Bls12Fp. |
y | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bls12Fp | (x - y) % p . |
into
Convert Bls12Fp to Bw6Fr.
function into(Bls12Fp memory x) internal pure returns (Bw6Fr memory);
Parameters
Name | Type | Description |
---|---|---|
x | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | Bw6Fr | Result of conversion. |
serialize
Serialize Bls12Fp.
function serialize(Bls12Fp memory self) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
self | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | Compressed serialized bytes of Bls12Fp. |
debug
Debug Bls12Fp in bytes.
function debug(Bls12Fp memory self) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
self | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | Uncompressed serialized bytes of Bls12Fp. |
norm
Normalize Bls12Fp.
function norm(Bls12Fp memory fp) internal view returns (Bls12Fp memory);
Parameters
Name | Type | Description |
---|---|---|
fp | Bls12Fp | Bls12Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | Bls12Fp | fp % p . |