Documentation
ΒΆ
Overview ΒΆ
Package fields_bn254 implements the fields arithmetic of the direct π½pΒΉΒ² extension used to compute the pairing over the BN254 curve.
π½pΒΉΒ²[i] = π½p/iΒΉΒ²-18iβΆ+82
This direct tower is isomorphic to the 2-3-2 tower:
π½pΒ²[u] = π½p/uΒ²+1 π½pβΆ[v] = π½pΒ²/vΒ³-9-u π½pΒΉΒ²[w] = π½pβΆ/wΒ²-v
Index ΒΆ
- func GetHints() []solver.Hint
- type E12
- type E2
- type Ext12
- func (e Ext12) Add(x, y *E12) *E12
- func (e Ext12) AssertIsEqual(a, b *E12)
- func (e Ext12) Conjugate(x *E12) *E12
- func (e Ext12) Copy(x *E12) *E12
- func (e Ext12) CyclotomicSquareGS(x *E12) *E12
- func (e Ext12) DivUnchecked(x, y *E12) *E12
- func (e Ext12) Double(x *E12) *E12
- func (e Ext12) ExpByU(x *E12) *E12
- func (e Ext12) Expt(x *E12) *E12
- func (e Ext12) Frobenius(a *E12) *E12
- func (e Ext12) FrobeniusCube(a *E12) *E12
- func (e Ext12) FrobeniusSquare(a *E12) *E12
- func (e Ext12) FromTower(tower [12]*baseEl) *E12
- func (e Ext12) Inverse(x *E12) *E12
- func (e Ext12) IsEqual(x, y *E12) frontend.Variable
- func (e Ext12) Mul(x, y *E12) *E12
- func (e *Ext12) Mul01379By01379(e3, e4, c3, c4 *E2) [10]*baseEl
- func (e *Ext12) MulBy012346789(a *E12, b [10]*baseEl) *E12
- func (e *Ext12) MulBy01379(a *E12, c3, c4 *E2) *E12
- func (e Ext12) Neg(x *E12) *E12
- func (e Ext12) One() *E12
- func (e Ext12) Square(x *E12) *E12
- func (e Ext12) Sub(x, y *E12) *E12
- func (e Ext12) ToTower(a *E12) [12]*baseEl
- func (e Ext12) Zero() *E12
- type Ext2
- func (e Ext2) Add(x, y *E2) *E2
- func (e Ext2) AssertIsEqual(x, y *E2)
- func (e Ext2) Conjugate(x *E2) *E2
- func (e Ext2) Cube(x *E2) *E2
- func (e Ext2) DivUnchecked(x, y *E2) *E2
- func (e Ext2) Double(x *E2) *E2
- func (e Ext2) Inverse(x *E2) *E2
- func (e Ext2) IsEqual(x, y *E2) frontend.Variable
- func (e Ext2) IsZero(z *E2) frontend.Variable
- func (e Ext2) Lookup2(s1, s2 frontend.Variable, a, b, c, d *E2) *E2
- func (e Ext2) Mul(x, y *E2) *E2
- func (e Ext2) MulByConstElement(x *E2, y *big.Int) *E2
- func (e Ext2) MulByElement(x *E2, y *baseEl) *E2
- func (e Ext2) MulByNonResidue(x *E2) *E2
- func (e Ext2) MulByNonResidue1Power1(x *E2) *E2
- func (e Ext2) MulByNonResidue1Power2(x *E2) *E2
- func (e Ext2) MulByNonResidue1Power3(x *E2) *E2
- func (e Ext2) MulByNonResidue1Power4(x *E2) *E2
- func (e Ext2) MulByNonResidue1Power5(x *E2) *E2
- func (e Ext2) MulByNonResidue2Power1(x *E2) *E2
- func (e Ext2) MulByNonResidue2Power2(x *E2) *E2
- func (e Ext2) MulByNonResidue2Power3(x *E2) *E2
- func (e Ext2) MulByNonResidue2Power4(x *E2) *E2
- func (e Ext2) MulByNonResidue2Power5(x *E2) *E2
- func (e Ext2) MulByNonResidue3Power1(x *E2) *E2
- func (e Ext2) MulByNonResidue3Power2(x *E2) *E2
- func (e Ext2) MulByNonResidue3Power3(x *E2) *E2
- func (e Ext2) MulByNonResidue3Power4(x *E2) *E2
- func (e Ext2) MulByNonResidue3Power5(x *E2) *E2
- func (e Ext2) MulByNonResidueGeneric(x *E2, power, coef int) *E2
- func (e Ext2) Neg(x *E2) *E2
- func (e Ext2) One() *E2
- func (e Ext2) Select(selector frontend.Variable, z1, z0 *E2) *E2
- func (e Ext2) Square(x *E2) *E2
- func (e Ext2) Sub(x, y *E2) *E2
- func (e Ext2) Zero() *E2
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
Types ΒΆ
type Ext12 ΒΆ
type Ext12 struct { *Ext2 // contains filtered or unexported fields }
func (Ext12) AssertIsEqual ΒΆ
func (Ext12) CyclotomicSquareGS ΒΆ added in v0.12.0
Granger-Scott's cyclotomic square https://eprint.iacr.org/2009/565.pdf, 3.2
func (Ext12) DivUnchecked ΒΆ
func (Ext12) ExpByU ΒΆ added in v0.11.0
Exponentiation by U=6u+2 where t is the seed u=4965661367192848881
func (Ext12) FrobeniusCube ΒΆ added in v0.11.0
func (Ext12) FrobeniusSquare ΒΆ added in v0.11.0
func (*Ext12) Mul01379By01379 ΒΆ added in v0.12.0
Mul01379By01379 multiplies two E12 sparse element of the form:
A0 = 1 A1 = c3.A0 - 9 * c3.A1 A2 = 0 A3 = c4.A0 - 9 * c4.A1 A4 = 0 A5 = 0 A6 = 0 A7 = c3.A1 A8 = 0 A9 = c4.A1 A10 = 0 A11 = 0
func (*Ext12) MulBy012346789 ΒΆ added in v0.12.0
MulBy012346789 multiplies a by an E12 sparse element b of the form
b.A0 = b[0] b.A1 = b[1] b.A2 = b[2] b.A3 = b[3] b.A4 = b[4] b.A5 = 0 b.A6 = b[5] b.A7 = b[6] b.A8 = b[7] b.A9 = b[8] b.A10 = b[9] b.A11 = 0
func (*Ext12) MulBy01379 ΒΆ added in v0.12.0
MulBy01379 multiplies a by an E12 sparse element b of the form
b.A0 = 1 b.A1 = c3.A0 - 9 * c3.A1 b.A2 = 0 b.A3 = c4.A0 - 9 * c4.A1 b.A4 = 0 b.A5 = 0 b.A6 = 0 b.A7 = c3.A1 b.A8 = 0 b.A9 = c4.A1 b.A10 = 0 b.A11 = 0
type Ext2 ΒΆ
type Ext2 struct {
// contains filtered or unexported fields
}
func (Ext2) AssertIsEqual ΒΆ
func (Ext2) DivUnchecked ΒΆ
func (Ext2) MulByElement ΒΆ
func (Ext2) MulByNonResidue ΒΆ
MulByNonResidue return x*(9+u)
func (Ext2) MulByNonResidue1Power1 ΒΆ
MulByNonResidue1Power1 returns x*(9+u)^(1*(p^1-1)/6)
func (Ext2) MulByNonResidue1Power2 ΒΆ
MulByNonResidue1Power2 returns x*(9+u)^(2*(p^1-1)/6)
func (Ext2) MulByNonResidue1Power3 ΒΆ
MulByNonResidue1Power3 returns x*(9+u)^(3*(p^1-1)/6)
func (Ext2) MulByNonResidue1Power4 ΒΆ
MulByNonResidue1Power4 returns x*(9+u)^(4*(p^1-1)/6)
func (Ext2) MulByNonResidue1Power5 ΒΆ
MulByNonResidue1Power5 returns x*(9+u)^(5*(p^1-1)/6)
func (Ext2) MulByNonResidue2Power1 ΒΆ
MulByNonResidue2Power1 returns x*(9+u)^(1*(p^2-1)/6)
func (Ext2) MulByNonResidue2Power2 ΒΆ
MulByNonResidue2Power2 returns x*(9+u)^(2*(p^2-1)/6)
func (Ext2) MulByNonResidue2Power3 ΒΆ
MulByNonResidue2Power3 returns x*(9+u)^(3*(p^2-1)/6)
func (Ext2) MulByNonResidue2Power4 ΒΆ
MulByNonResidue2Power4 returns x*(9+u)^(4*(p^2-1)/6)
func (Ext2) MulByNonResidue2Power5 ΒΆ
MulByNonResidue2Power5 returns x*(9+u)^(5*(p^2-1)/6)
func (Ext2) MulByNonResidue3Power1 ΒΆ
MulByNonResidue3Power1 returns x*(9+u)^(1*(p^3-1)/6)
func (Ext2) MulByNonResidue3Power2 ΒΆ
MulByNonResidue3Power2 returns x*(9+u)^(2*(p^3-1)/6)
func (Ext2) MulByNonResidue3Power3 ΒΆ
MulByNonResidue3Power3 returns x*(9+u)^(3*(p^3-1)/6)
func (Ext2) MulByNonResidue3Power4 ΒΆ
MulByNonResidue3Power4 returns x*(9+u)^(4*(p^3-1)/6)
func (Ext2) MulByNonResidue3Power5 ΒΆ
MulByNonResidue3Power5 returns x*(9+u)^(5*(p^3-1)/6)