Documentation ¶
Overview ¶
Package fields_bw6761 implements the fields arithmetic of the Fp6 tower used to compute the pairing over the BW6-761 curve.
𝔽p³[u] = 𝔽p/u³+4 𝔽p⁶[v] = 𝔽p²/v²-u
Index ¶
- func GetHints() []solver.Hint
- type E3
- type E6
- type Ext3
- func (e Ext3) Add(x, y *E3) *E3
- func (e Ext3) AssertIsEqual(a, b *E3)
- func (e Ext3) Conjugate(x *E3) *E3
- func (e Ext3) Copy(x *E3) *E3
- func (e Ext3) DivUnchecked(x, y *E3) *E3
- func (e Ext3) Double(x *E3) *E3
- func (e Ext3) Inverse(x *E3) *E3
- func (e Ext3) Mul(x, y *E3) *E3
- func (e Ext3) Mul01By01(c0, c1, d0, d1 *baseEl) *E3
- func (e Ext3) MulBy01(z *E3, c0, c1 *baseEl) *E3
- func (e Ext3) MulBy1(z *E3, c1 *baseEl) *E3
- func (e Ext3) MulBy12(x *E3, b1, b2 *baseEl) *E3
- func (e Ext3) MulByConstElement(x *E3, y *big.Int) *E3
- func (e Ext3) MulByElement(x *E3, y *baseEl) *E3
- func (e Ext3) MulByNonResidue(x *E3) *E3
- func (e Ext3) Neg(x *E3) *E3
- func (e Ext3) One() *E3
- func (e Ext3) Reduce(x *E3) *E3
- func (e Ext3) Select(selector frontend.Variable, z1, z0 *E3) *E3
- func (e Ext3) Square(x *E3) *E3
- func (e Ext3) Sub(x, y *E3) *E3
- func (e Ext3) Zero() *E3
- type Ext6
- func (e Ext6) Add(x, y *E6) *E6
- func (e Ext6) AssertIsEqual(a, b *E6)
- func (e Ext6) Conjugate(x *E6) *E6
- func (e Ext6) Copy(x *E6) *E6
- func (e Ext6) CyclotomicSquare(x *E6) *E6
- func (e Ext6) CyclotomicSquareKarabina12345(x *E6) *E6
- func (e Ext6) CyclotomicSquareKarabina2345(x *E6) *E6
- func (e Ext6) DecompressKarabina12345(x *E6) *E6
- func (e Ext6) DecompressKarabina2345(x *E6) *E6
- func (e Ext6) DivUnchecked(x, y *E6) *E6
- func (e Ext6) Double(x *E6) *E6
- func (e Ext6) ExpC1(z *E6) *E6
- func (e Ext6) ExpC2(z *E6) *E6
- func (e Ext6) ExpX0Minus1(z *E6) *E6
- func (e Ext6) ExpX0Minus1Square(z *E6) *E6
- func (e Ext6) ExpX0Plus1(z *E6) *E6
- func (e Ext6) ExptMinus1Div3(z *E6) *E6
- func (e Ext6) Frobenius(x *E6) *E6
- func (e Ext6) Inverse(x *E6) *E6
- func (e Ext6) Mul(x, y *E6) *E6
- func (e *Ext6) Mul01245By014(x [5]*baseEl, d0, d1 *baseEl) *E6
- func (e Ext6) Mul014By014(d0, d1, c0, c1 *baseEl) [5]*baseEl
- func (e *Ext6) MulBy014(z *E6, c0, c1 *baseEl) *E6
- func (e Ext6) One() *E6
- func (e Ext6) Reduce(x *E6) *E6
- func (e Ext6) Select(selector frontend.Variable, z1, z0 *E6) *E6
- func (e Ext6) Square(x *E6) *E6
- func (e Ext6) Sub(x, y *E6) *E6
- func (e Ext6) Zero() *E6
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ext3 ¶
type Ext3 struct {
// contains filtered or unexported fields
}
func (Ext3) AssertIsEqual ¶
func (Ext3) DivUnchecked ¶
func (Ext3) Mul01By01 ¶
Mul01By01 multiplies two E3 sparse element of the form:
E3{ A0: c0, A1: c1, A2: 0, }
and
E3{ A0: d0, A1: d1, A2: 0, }
func (Ext3) MulByElement ¶
func (Ext3) MulByNonResidue ¶
MulByNonResidue mul x by (0,1,0)
type Ext6 ¶
type Ext6 struct {
*Ext3
}
func (Ext6) AssertIsEqual ¶
func (Ext6) CyclotomicSquare ¶
Granger-Scott's cyclotomic square https://eprint.iacr.org/2009/565.pdf, 3.2
func (Ext6) CyclotomicSquareKarabina12345 ¶
Karabina's compressed cyclotomic square SQR12345 https://eprint.iacr.org/2010/542.pdf Sec. 5.6 with minor modifications to fit our tower
func (Ext6) CyclotomicSquareKarabina2345 ¶
Karabina's compressed cyclotomic square SQR2345 https://eprint.iacr.org/2010/542.pdf Th. 3.2 with minor modifications to fit our tower
func (Ext6) DecompressKarabina12345 ¶
DecompressKarabina12345 decompresses Karabina's cyclotomic square result SQR12345
func (Ext6) DecompressKarabina2345 ¶
DecompressKarabina2345 decompresses Karabina's cyclotomic square result SQR2345 if g3 != 0
g4 = (E * g5^2 + 3 * g1^2 - 2 * g2)/4g3
if g3 == 0
g4 = 2g1g5/g2
if g3=g2=0 then g4=g5=g1=0 and g0=1 (x=1) Theorem 3.1 is well-defined for all x in Gϕₙ\{1}
func (Ext6) DivUnchecked ¶
func (Ext6) ExpC2 ¶
ExpC2 set z to z^C2 in E6 and return z ht, hy = 13, 9 C2 = (ht**2+3*hy**2)/4 = 103
func (Ext6) ExpX0Minus1 ¶
ExpX0Minus1 set z to z^{x₀-1} in E6 and return z x₀-1 = 9586122913090633728
func (Ext6) ExpX0Minus1Square ¶
ExpX0Minus1Square set z to z^{(x₀-1)²} in E6 and return z (x₀-1)² = 91893752504881257682351033800651177984
func (Ext6) ExpX0Plus1 ¶
ExpX0Plus1 set z to z^(x₀+1) in E6 and return z x₀+1 = 9586122913090633730
func (Ext6) ExptMinus1Div3 ¶
ExpX0Minus1Div3 set z to z^(x₀-1)/3 in E6 and return z (x₀-1)/3 = 3195374304363544576
func (*Ext6) Mul01245By014 ¶
Mul01245By014 multiplies two E6 sparse element of the form
E6{ C0: E3{B0: x0, B1: x1, B2: x2}, C1: E3{B0: 0, B1: x4, B2: x5}, } and E6{ C0: E3{B0: d0, B1: d1, B2: 0}, C1: E3{B0: 0, B1: 1, B2: 0}, }
func (Ext6) Mul014By014 ¶
func (e Ext6) Mul014By014(d0, d1, c0, c1 *baseEl) [5]*baseEl
multiplies two E6 sparse element of the form: E6{ B0: E3{A0: c0, A1: c1, A2: 0}, B1: E3{A0: 0, A1: 1, A2: 0}, }
and
E6{ B0: E3{A0: d0, A1: d1, A2: 0}, B1: E3{A0: 0, A1: 1, A2: 0}, }