fields_bw6761

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHints

func GetHints() []solver.Hint

GetHints returns all hint functions used in the package.

Types

type E3

type E3 struct {
	A0, A1, A2 baseEl
}

func FromE3

func FromE3(a *bw6761.E3) E3

type E6

type E6 struct {
	B0, B1 E3
}

func FromE6

func FromE6(a *bw6761.E6) E6

type Ext3

type Ext3 struct {
	// contains filtered or unexported fields
}

func NewExt3

func NewExt3(api frontend.API) *Ext3

func (Ext3) Add

func (e Ext3) Add(x, y *E3) *E3

func (Ext3) AssertIsEqual

func (e Ext3) AssertIsEqual(a, b *E3)

func (Ext3) Conjugate

func (e Ext3) Conjugate(x *E3) *E3

func (Ext3) Copy

func (e Ext3) Copy(x *E3) *E3

func (Ext3) DivUnchecked

func (e Ext3) DivUnchecked(x, y *E3) *E3

func (Ext3) Double

func (e Ext3) Double(x *E3) *E3

func (Ext3) Inverse

func (e Ext3) Inverse(x *E3) *E3

func (Ext3) Mul

func (e Ext3) Mul(x, y *E3) *E3

func (Ext3) Mul01By01

func (e Ext3) Mul01By01(c0, c1, d0, d1 *baseEl) *E3

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) MulBy01

func (e Ext3) MulBy01(z *E3, c0, c1 *baseEl) *E3

MulBy01 multiplication by sparse element (c0,c1,0)

func (Ext3) MulBy1

func (e Ext3) MulBy1(z *E3, c1 *baseEl) *E3

MulBy1 multiplication of E6 by sparse element (0, c1, 0)

func (Ext3) MulBy12

func (e Ext3) MulBy12(x *E3, b1, b2 *baseEl) *E3

MulBy12 multiplication by sparse element (0,b1,b2)

func (Ext3) MulByConstElement

func (e Ext3) MulByConstElement(x *E3, y *big.Int) *E3

func (Ext3) MulByElement

func (e Ext3) MulByElement(x *E3, y *baseEl) *E3

func (Ext3) MulByNonResidue

func (e Ext3) MulByNonResidue(x *E3) *E3

MulByNonResidue mul x by (0,1,0)

func (Ext3) Neg

func (e Ext3) Neg(x *E3) *E3

func (Ext3) One

func (e Ext3) One() *E3

func (Ext3) Reduce

func (e Ext3) Reduce(x *E3) *E3

func (Ext3) Select

func (e Ext3) Select(selector frontend.Variable, z1, z0 *E3) *E3

func (Ext3) Square

func (e Ext3) Square(x *E3) *E3

func (Ext3) Sub

func (e Ext3) Sub(x, y *E3) *E3

func (Ext3) Zero

func (e Ext3) Zero() *E3

type Ext6

type Ext6 struct {
	*Ext3
}

func NewExt6

func NewExt6(api frontend.API) *Ext6

func (Ext6) Add

func (e Ext6) Add(x, y *E6) *E6

func (Ext6) AssertIsEqual

func (e Ext6) AssertIsEqual(a, b *E6)

func (Ext6) Conjugate

func (e Ext6) Conjugate(x *E6) *E6

func (Ext6) Copy

func (e Ext6) Copy(x *E6) *E6

func (Ext6) CyclotomicSquare

func (e Ext6) CyclotomicSquare(x *E6) *E6

Granger-Scott's cyclotomic square https://eprint.iacr.org/2009/565.pdf, 3.2

func (Ext6) CyclotomicSquareKarabina12345

func (e Ext6) CyclotomicSquareKarabina12345(x *E6) *E6

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

func (e Ext6) CyclotomicSquareKarabina2345(x *E6) *E6

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

func (e Ext6) DecompressKarabina12345(x *E6) *E6

DecompressKarabina12345 decompresses Karabina's cyclotomic square result SQR12345

func (Ext6) DecompressKarabina2345

func (e Ext6) DecompressKarabina2345(x *E6) *E6

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 (e Ext6) DivUnchecked(x, y *E6) *E6

func (Ext6) Double

func (e Ext6) Double(x *E6) *E6

func (Ext6) ExpC1

func (e Ext6) ExpC1(z *E6) *E6

ExpC1 set z to z^C1 in E6 and return z ht, hy = 13, 9 C1 = (ht+hy)/2 = 11

func (Ext6) ExpC2

func (e Ext6) ExpC2(z *E6) *E6

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

func (e Ext6) ExpX0Minus1(z *E6) *E6

ExpX0Minus1 set z to z^{x₀-1} in E6 and return z x₀-1 = 9586122913090633728

func (Ext6) ExpX0Minus1Square

func (e Ext6) ExpX0Minus1Square(z *E6) *E6

ExpX0Minus1Square set z to z^{(x₀-1)²} in E6 and return z (x₀-1)² = 91893752504881257682351033800651177984

func (Ext6) ExpX0Plus1

func (e Ext6) ExpX0Plus1(z *E6) *E6

ExpX0Plus1 set z to z^(x₀+1) in E6 and return z x₀+1 = 9586122913090633730

func (Ext6) ExptMinus1Div3

func (e Ext6) ExptMinus1Div3(z *E6) *E6

ExpX0Minus1Div3 set z to z^(x₀-1)/3 in E6 and return z (x₀-1)/3 = 3195374304363544576

func (Ext6) Frobenius

func (e Ext6) Frobenius(x *E6) *E6

Frobenius set z in E6 to Frobenius(x), return z

func (Ext6) Inverse

func (e Ext6) Inverse(x *E6) *E6

func (Ext6) Mul

func (e Ext6) Mul(x, y *E6) *E6

func (*Ext6) Mul01245By014

func (e *Ext6) Mul01245By014(x [5]*baseEl, d0, d1 *baseEl) *E6

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},
}

func (*Ext6) MulBy014

func (e *Ext6) MulBy014(z *E6, c0, c1 *baseEl) *E6

MulBy014 multiplies z by an E6 sparse element of the form

E6{
	B0: E3{A0: c0, A1: c1, A2: 0},
	B1: E3{A0: 0,  A1: 1,  A2: 0},
}

func (Ext6) One

func (e Ext6) One() *E6

func (Ext6) Reduce

func (e Ext6) Reduce(x *E6) *E6

func (Ext6) Select

func (e Ext6) Select(selector frontend.Variable, z1, z0 *E6) *E6

func (Ext6) Square

func (e Ext6) Square(x *E6) *E6

func (Ext6) Sub

func (e Ext6) Sub(x, y *E6) *E6

func (Ext6) Zero

func (e Ext6) Zero() *E6

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL