BW6FP
Functions
q
Returns base field: q = 0x122e824fb83ce0ad187c94004faff3eb926186a81d14688528275ef8087be41707ba638e584e91903cebaff25b423048689c8ed12f9fd9071dcd3dc73ebff2e98a116c25667a8f8160cf8aeeaf0a437e6913e6870000082f49d00000000008b
function q() internal pure returns (Bw6Fp memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bw6Fp | Base field. |
zero
Returns the additive identity element of Bw6Fp.
function zero() internal pure returns (Bw6Fp memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bw6Fp | Bw6Fp(0, 0, 0) |
one
Returns the multiplicative identity element of Bw6Fp.
function one() internal pure returns (Bw6Fp memory);
Returns
Name | Type | Description |
---|---|---|
<none> | Bw6Fp | Bw6Fp(0, 0, 1) |
is_zero
Returns true
if self
is equal to the additive identity.
function is_zero(Bw6Fp memory self) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
self | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of zero check. |
is_geq_modulus
Returns true
if self
is equal or larger than q.
function is_geq_modulus(Bw6Fp memory self) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
self | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of check. |
eq
Returns true
if x
is equal to y
.
function eq(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
x | Bw6Fp | Bw6Fp. |
y | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of equal check. |
gt
Returns true
if x
is larger than y
.
function gt(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (bool);
Parameters
Name | Type | Description |
---|---|---|
x | Bw6Fp | Bw6Fp. |
y | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Result of gt check. |
neg
Returns the result negative of self
.
function neg(Bw6Fp memory self) internal pure returns (Bw6Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
self | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bw6Fp | - self . |
add_nomod
Returns the result of x + y
.
function add_nomod(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (Bw6Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
x | Bw6Fp | Bw6Fp. |
y | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bw6Fp | x + y . |
add
Returns the result of (x + y) % p
.
function add(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (Bw6Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
x | Bw6Fp | Bw6Fp. |
y | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bw6Fp | (x + y) % p . |
subtract_modulus_to_norm
function subtract_modulus_to_norm(Bw6Fp memory self) internal pure;
sub
Returns the result of (x - y) % p
.
function sub(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (Bw6Fp memory z);
Parameters
Name | Type | Description |
---|---|---|
x | Bw6Fp | Bw6Fp. |
y | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
z | Bw6Fp | (x - y) % p . |
serialize
Serialize Bw6Fp.
function serialize(Bw6Fp memory self) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
self | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | Compressed serialized bytes of Bw6Fp. |
debug
Debug Bw6Fp in bytes.
function debug(Bw6Fp memory self) internal pure returns (bytes memory);
Parameters
Name | Type | Description |
---|---|---|
self | Bw6Fp | Bw6Fp. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | Uncompressed serialized bytes of Bw6Fp. |