fields_bls24315

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type E2

type E2 struct {
	A0, A1 frontend.Variable
}

E2 element in a quadratic extension

func (*E2) Add

func (e *E2) Add(api frontend.API, e1, e2 E2) *E2

Add e2 elmts

func (*E2) Assign

func (e *E2) Assign(a *bls24315.E2)

Assign a value to self (witness assignment)

func (*E2) Conjugate

func (e *E2) Conjugate(api frontend.API, e1 E2) *E2

Conjugate conjugation of an e2 elmt

func (*E2) Double

func (e *E2) Double(api frontend.API, e1 E2) *E2

Double e2 elmt

func (*E2) Inverse

func (e *E2) Inverse(api frontend.API, e1 E2, ext Extension) *E2

Inverse inverses an fp2elmt

func (*E2) Mul

func (e *E2) Mul(api frontend.API, e1, e2 E2, ext Extension) *E2

Mul e2 elmts: 5C

func (*E2) MulByFp

func (e *E2) MulByFp(api frontend.API, e1 E2, c interface{}) *E2

MulByFp multiplies an fp2 elmt by an fp elmt

func (*E2) MulByNonResidue

func (e *E2) MulByNonResidue(api frontend.API, e1 E2, ext Extension) *E2

MulByNonResidue multiplies an fp2 elmt by the imaginary elmt ext.uSquare is the square of the imaginary root

func (*E2) MustBeEqual

func (e *E2) MustBeEqual(api frontend.API, other E2)

MustBeEqual constraint self to be equal to other into the given constraint system

func (*E2) Neg

func (e *E2) Neg(api frontend.API, e1 E2) *E2

Neg negates a e2 elmt

func (*E2) SetOne

func (e *E2) SetOne(api frontend.API) *E2

SetOne returns a newly allocated element equal to 1

func (*E2) Square

func (e *E2) Square(api frontend.API, x E2, ext Extension) *E2

Square e2 elt

func (*E2) Sub

func (e *E2) Sub(api frontend.API, e1, e2 E2) *E2

Sub e2 elmts

type E4

type E4 struct {
	B0, B1 E2
}

E4 element in a quadratic extension

func NewFp4Zero

func NewFp4Zero(api frontend.API) *E4

NewFp4Zero creates a new

func (*E4) Add

func (e *E4) Add(api frontend.API, e1, e2 E4) *E4

Add e4 elmts

func (*E4) Assign

func (e *E4) Assign(a *bls24315.E4)

Assign a value to self (witness assignment)

func (*E4) Conjugate

func (e *E4) Conjugate(api frontend.API, e1 E4) *E4

Conjugate conjugation of an e4 elmt

func (*E4) Double

func (e *E4) Double(api frontend.API, e1 E4) *E4

Double e4 elmt

func (*E4) Inverse

func (e *E4) Inverse(api frontend.API, e1 E4, ext Extension) *E4

Inverse inverses an e4 elmt

func (*E4) Mul

func (e *E4) Mul(api frontend.API, e1, e2 E4, ext Extension) *E4

Mul e4 elmts: 5C

func (*E4) MulByFp

func (e *E4) MulByFp(api frontend.API, e1 E4, c interface{}) *E4

MulByFp multiplies an e4 elmt by an fp elmt

func (*E4) MulByNonResidue

func (e *E4) MulByNonResidue(api frontend.API, e1 E4, ext Extension) *E4

MulByNonResidue multiplies an e4 elmt by the imaginary elmt ext.uSquare is the square of the imaginary root

func (*E4) MustBeEqual

func (e *E4) MustBeEqual(api frontend.API, other E4)

MustBeEqual constraint self to be equal to other into the given constraint system

func (*E4) Neg

func (e *E4) Neg(api frontend.API, e1 E4) *E4

Neg negates a e4 elmt

func (*E4) SetOne

func (e *E4) SetOne(api frontend.API) *E4

SetOne returns a newly allocated element equal to 1

func (*E4) Square

func (e *E4) Square(api frontend.API, x E4, ext Extension) *E4

Square e4 elt

func (*E4) Sub

func (e *E4) Sub(api frontend.API, e1, e2 E4) *E4

Sub e4 elmts

type E12

type E12 struct {
	C0, C1, C2 E4
}

E12 element in a quadratic extension

func NewFp12Zero

func NewFp12Zero(api frontend.API) *E12

NewFp12Zero creates a new

func (*E12) Add

func (e *E12) Add(api frontend.API, e1, e2 E12) *E12

Add creates a fp12elmt from fp elmts

func (*E12) Assign

func (e *E12) Assign(a *bls24315.E12)

Assign a value to self (witness assignment)

func (*E12) Inverse

func (e *E12) Inverse(api frontend.API, e1 E12, ext Extension) *E12

Inverse inverses an Fp12 elmt

func (*E12) Mul

func (e *E12) Mul(api frontend.API, e1, e2 E12, ext Extension) *E12

Mul creates a fp12elmt from fp elmts icube is the imaginary elmt to the cube

func (*E12) MulBy01

func (e *E12) MulBy01(api frontend.API, c0, c1 E4, ext Extension) *E12

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

func (*E12) MulByE4

func (e *E12) MulByE4(api frontend.API, e1 E12, e2 E4, ext Extension) *E12

MulByE4 multiplies an element in E12 by an element in E4

func (*E12) MulByFp2

func (e *E12) MulByFp2(api frontend.API, e1 E12, e2 E4, ext Extension) *E12

MulByFp2 creates a fp12elmt from fp elmts icube is the imaginary elmt to the cube

func (*E12) MulByNonResidue

func (e *E12) MulByNonResidue(api frontend.API, e1 E12, ext Extension) *E12

MulByNonResidue multiplies e by the imaginary elmt of Fp12 (noted a+bV+cV where V**3 in F^2)

func (*E12) MustBeEqual

func (e *E12) MustBeEqual(api frontend.API, other E12)

MustBeEqual constraint self to be equal to other into the given constraint system

func (*E12) Neg

func (e *E12) Neg(api frontend.API, e1 E12) *E12

Neg negates an Fp12 elmt

func (*E12) Square

func (e *E12) Square(api frontend.API, x E12, ext Extension) *E12

Square sets z to the E12 product of x,x, returns e

func (*E12) Sub

func (e *E12) Sub(api frontend.API, e1, e2 E12) *E12

Sub creates a fp12elmt from fp elmts

type E24

type E24 struct {
	D0, D1 E12
}

E24 element in a quadratic extension

func (*E24) Add

func (e *E24) Add(api frontend.API, e1, e2 E24) *E24

Add adds 2 elmts in Fp24

func (*E24) Assign

func (e *E24) Assign(a *bls24315.E24)

Assign a value to self (witness assignment)

func (*E24) Conjugate

func (e *E24) Conjugate(api frontend.API, e1 E24) *E24

Conjugate applies Frob**6 (conjugation over Fp6)

func (*E24) CyclotomicSquare

func (e *E24) CyclotomicSquare(api frontend.API, x E24, ext Extension) *E24

Granger-Scott's cyclotomic square squares a Fp24 elt in the cyclotomic group https://eprint.iacr.org/2009/565.pdf, 3.2

func (*E24) CyclotomicSquareCompressed

func (e *E24) CyclotomicSquareCompressed(api frontend.API, x E24, ext Extension) *E24

Karabina's compressed cyclotomic square https://eprint.iacr.org/2010/542.pdf

func (*E24) Decompress

func (e *E24) Decompress(api frontend.API, x E24, ext Extension) *E24

Decompress Karabina's cyclotomic square result

func (*E24) Expt

func (e *E24) Expt(api frontend.API, x E24, exponent uint64, ext Extension) *E24

Expt compute e1**exponent, where the exponent is hardcoded This function is only used for the final expo of the pairing for bls24315, so the exponent is supposed to be hardcoded and on 32 bits.

func (*E24) FinalExponentiation

func (e *E24) FinalExponentiation(api frontend.API, e1 E24, genT uint64, ext Extension) *E24

FinalExponentiation computes the final expo x**(p**12-1)(p**4+1)(p**8 - p**4 +1)/r

func (*E24) Frobenius

func (e *E24) Frobenius(api frontend.API, x E24, ext Extension) *E24

Frobenius applies frob to an fp24 elmt

func (*E24) FrobeniusQuad

func (e *E24) FrobeniusQuad(api frontend.API, x E24, ext Extension) *E24

FrobeniusQuad applies frob**4 to an fp24 elmt

func (*E24) FrobeniusSquare

func (e *E24) FrobeniusSquare(api frontend.API, x E24, ext Extension) *E24

FrobeniusSquare applies frob**2 to an fp24 elmt

func (*E24) Inverse

func (e *E24) Inverse(api frontend.API, e1 E24, ext Extension) *E24

Inverse inverse an elmt in Fp24

func (*E24) Mul

func (e *E24) Mul(api frontend.API, e1, e2 E24, ext Extension) *E24

Mul multiplies 2 elmts in Fp24

func (*E24) MulBy034

func (e *E24) MulBy034(api frontend.API, c3, c4 E4, ext Extension) *E24

MulBy034 multiplication by sparse element

func (*E24) MustBeEqual

func (e *E24) MustBeEqual(api frontend.API, other E24)

MustBeEqual constraint self to be equal to other into the given constraint system

func (*E24) Neg

func (e *E24) Neg(api frontend.API, e1 E24) *E24

Neg negates an Fp6elmt

func (*E24) SetOne

func (e *E24) SetOne(api frontend.API) *E24

SetOne returns a newly allocated element equal to 1

func (*E24) Square

func (e *E24) Square(api frontend.API, x E24, ext Extension) *E24

Square squares an element in Fp24

func (*E24) Sub

func (e *E24) Sub(api frontend.API, e1, e2 E24) *E24

Sub substracts 2 elmts in Fp24

type Extension

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

Extension stores the non residue elmt for an extension of type Fp->Fp2->Fp4->Fp12->Fp24 (Fp2 = Fp(u), Fp4 = Fp2(v), Fp12 = Fp4(w), Fp24 = Fp6(i))

func GetBLS24315ExtensionFp24

func GetBLS24315ExtensionFp24(api frontend.API) Extension

GetBLS24315ExtensionFp24 get extension field parameters for bls24315

Jump to

Keyboard shortcuts

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