klefki.curves.bls12_381

ref: https://github.com/ethereum/research/blob/711bd9532b4534ef5ae6277bd7afe625195506d5/zksnark/bn128_field_elements.py

Module Contents

Classes

BLS12_381FP

A FIELD is a set F which is closed under two operations + and × s.t.

BLS12_381FP2

$U subseteq F$, where F is subfield, P is its module cof

BLS12_381FP12

$U subseteq F$, where F is subfield, P is its module cof

BLS12_381ScalarFP

A FIELD is a set F which is closed under two operations + and × s.t.

ECGBLS12_381

y**2 = x**3 + 4

class klefki.curves.bls12_381.BLS12_381FP(*args)

Bases: klefki.algebra.fields.FiniteField

A FIELD is a set F which is closed under two operations + and × s.t. (1) Fis an abelian group under + and (2) F-{0} (the set F without the additive identity 0) is an abelian group under ×.

P
class klefki.curves.bls12_381.BLS12_381FP2(*args)

Bases: klefki.algebra.fields.PolyExtField

$U subseteq F$, where F is subfield, P is its module cof

DEG = 2
F
P
classmethod from_BLS12_381FP(cls, v)
class klefki.curves.bls12_381.BLS12_381FP12(*args)

Bases: klefki.algebra.fields.PolyExtField

$U subseteq F$, where F is subfield, P is its module cof

DEG = 12
F
P
classmethod from_BLS12_381FP(cls, v)
classmethod from_BLS12_381FP2(cls, v)
class klefki.curves.bls12_381.BLS12_381ScalarFP(*args)

Bases: klefki.algebra.fields.FiniteField

A FIELD is a set F which is closed under two operations + and × s.t. (1) Fis an abelian group under + and (2) F-{0} (the set F without the additive identity 0) is an abelian group under ×.

P
class klefki.curves.bls12_381.ECGBLS12_381(*args)

Bases: klefki.algebra.groups.ecg.PairFriendlyEllipticCurveGroup

y**2 = x**3 + 4

A
N
F
op(self, g)

The Operator for obeying axiom associativity (2)

twist(self)
classmethod twist_FP_to_FP12(cls, x, y)
classmethod twist_FP2_to_FP12(cls, x, y)
static linefunc(P1, P2, T)
classmethod miller_loop(cls, Q, P)
classmethod pairing(cls, P, Q)

e(P, Q + R) = e(P, Qj * e(P, R) e(P + Q, R) = e(P, R) * e(Q, R)

is_on_curve(self)
static B(F=BLS12_381FP)
classmethod lift_x(cls, x)
klefki.curves.bls12_381.G1
klefki.curves.bls12_381.G2
klefki.curves.bls12_381.G