BLS12FP

Git Source

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

NameTypeDescription
<none>Bls12FpBase field.

zero

Returns the additive identity element of Bls12Fp.

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

Returns

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

NameTypeDescription
selfBls12FpBls12Fp.

Returns

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

NameTypeDescription
xBls12FpBls12Fp.
yBls12FpBls12Fp.

Returns

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

NameTypeDescription
xBls12FpBls12Fp.
yBls12FpBls12Fp.

Returns

NameTypeDescription
<none>boolResult of gt check.

neg

Returns the result negative of self.

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

Parameters

NameTypeDescription
selfBls12FpBls12Fp.

Returns

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

NameTypeDescription
xBls12FpBls12Fp.
yBls12FpBls12Fp.

Returns

NameTypeDescription
zBls12Fpx + y.

sub

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

function sub(Bls12Fp memory x, Bls12Fp memory y) internal pure returns (Bls12Fp memory z);

Parameters

NameTypeDescription
xBls12FpBls12Fp.
yBls12FpBls12Fp.

Returns

NameTypeDescription
zBls12Fp(x - y) % p.

into

Convert Bls12Fp to Bw6Fr.

function into(Bls12Fp memory x) internal pure returns (Bw6Fr memory);

Parameters

NameTypeDescription
xBls12FpBls12Fp.

Returns

NameTypeDescription
<none>Bw6FrResult of conversion.

serialize

Serialize Bls12Fp.

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

Parameters

NameTypeDescription
selfBls12FpBls12Fp.

Returns

NameTypeDescription
<none>bytesCompressed serialized bytes of Bls12Fp.

debug

Debug Bls12Fp in bytes.

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

Parameters

NameTypeDescription
selfBls12FpBls12Fp.

Returns

NameTypeDescription
<none>bytesUncompressed serialized bytes of Bls12Fp.

norm

Normalize Bls12Fp.

function norm(Bls12Fp memory fp) internal view returns (Bls12Fp memory);

Parameters

NameTypeDescription
fpBls12FpBls12Fp.

Returns

NameTypeDescription
<none>Bls12Fpfp % p.