BW6FP

Git Source

Functions

q

Returns base field: q = 0x122e824fb83ce0ad187c94004faff3eb926186a81d14688528275ef8087be41707ba638e584e91903cebaff25b423048689c8ed12f9fd9071dcd3dc73ebff2e98a116c25667a8f8160cf8aeeaf0a437e6913e6870000082f49d00000000008b

function q() internal pure returns (Bw6Fp memory);

Returns

NameTypeDescription
<none>Bw6FpBase field.

zero

Returns the additive identity element of Bw6Fp.

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

Returns

NameTypeDescription
<none>Bw6FpBw6Fp(0, 0, 0)

one

Returns the multiplicative identity element of Bw6Fp.

function one() internal pure returns (Bw6Fp memory);

Returns

NameTypeDescription
<none>Bw6FpBw6Fp(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

NameTypeDescription
selfBw6FpBw6Fp.

Returns

NameTypeDescription
<none>boolResult 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

NameTypeDescription
selfBw6FpBw6Fp.

Returns

NameTypeDescription
<none>boolResult of check.

eq

Returns true if x is equal to y.

function eq(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (bool);

Parameters

NameTypeDescription
xBw6FpBw6Fp.
yBw6FpBw6Fp.

Returns

NameTypeDescription
<none>boolResult 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

NameTypeDescription
xBw6FpBw6Fp.
yBw6FpBw6Fp.

Returns

NameTypeDescription
<none>boolResult of gt check.

neg

Returns the result negative of self.

function neg(Bw6Fp memory self) internal pure returns (Bw6Fp memory z);

Parameters

NameTypeDescription
selfBw6FpBw6Fp.

Returns

NameTypeDescription
zBw6Fp- 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

NameTypeDescription
xBw6FpBw6Fp.
yBw6FpBw6Fp.

Returns

NameTypeDescription
zBw6Fpx + y.

add

Returns the result of (x + y) % p.

function add(Bw6Fp memory x, Bw6Fp memory y) internal pure returns (Bw6Fp memory z);

Parameters

NameTypeDescription
xBw6FpBw6Fp.
yBw6FpBw6Fp.

Returns

NameTypeDescription
zBw6Fp(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

NameTypeDescription
xBw6FpBw6Fp.
yBw6FpBw6Fp.

Returns

NameTypeDescription
zBw6Fp(x - y) % p.

serialize

Serialize Bw6Fp.

function serialize(Bw6Fp memory self) internal pure returns (bytes memory);

Parameters

NameTypeDescription
selfBw6FpBw6Fp.

Returns

NameTypeDescription
<none>bytesCompressed serialized bytes of Bw6Fp.

debug

Debug Bw6Fp in bytes.

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

Parameters

NameTypeDescription
selfBw6FpBw6Fp.

Returns

NameTypeDescription
<none>bytesUncompressed serialized bytes of Bw6Fp.