fields

package
v0.0.5-0...-4780061 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: GPL-3.0, GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIsOdd

func BigIsOdd(n *big.Int) bool

Types

type Fq

type Fq struct {
	Q *big.Int // Q
}

Fq is the Z field over modulus Q

func NewFq

func NewFq(q *big.Int) Fq

NewFq generates a new Fq

func (Fq) Add

func (fq Fq) Add(a, b *big.Int) *big.Int

Add performs an addition on the Fq

func (Fq) Affine

func (fq Fq) Affine(a *big.Int) *big.Int

func (Fq) Copy

func (fq Fq) Copy(a *big.Int) *big.Int

func (Fq) Div

func (fq Fq) Div(a, b *big.Int) *big.Int

Div performs the division over the finite field

func (Fq) Double

func (fq Fq) Double(a *big.Int) *big.Int

Double performs a doubling on the Fq

func (Fq) Equal

func (fq Fq) Equal(a, b *big.Int) bool

func (Fq) Exp

func (fq Fq) Exp(base *big.Int, e *big.Int) *big.Int

Exp performs the exponential over Fq

func (Fq) Inverse

func (fq Fq) Inverse(a *big.Int) *big.Int

Inverse returns the inverse on the Fq

func (Fq) IsZero

func (fq Fq) IsZero(a *big.Int) bool

func (Fq) Mul

func (fq Fq) Mul(a, b *big.Int) *big.Int

Mul performs a multiplication on the Fq

func (Fq) MulScalar

func (fq Fq) MulScalar(base, e *big.Int) *big.Int

func (Fq) Neg

func (fq Fq) Neg(a *big.Int) *big.Int

Neg performs a negation on the Fq

func (Fq) One

func (fq Fq) One() *big.Int

One returns a One value on the Fq

func (Fq) Rand

func (fq Fq) Rand() (*big.Int, error)

func (Fq) Square

func (fq Fq) Square(a *big.Int) *big.Int

Square performs a square operation on the Fq

func (Fq) Sub

func (fq Fq) Sub(a, b *big.Int) *big.Int

Sub performs a subtraction on the Fq

func (Fq) Zero

func (fq Fq) Zero() *big.Int

Zero returns a Zero value on the Fq

type Fq12

type Fq12 struct {
	F          Fq6
	Fq2        Fq2
	NonResidue [2]*big.Int
}

Fq12 is Field 12

func NewFq12

func NewFq12(f Fq6, fq2 Fq2, nonResidue [2]*big.Int) Fq12

NewFq12 generates a new Fq12

func (Fq12) Add

func (fq12 Fq12) Add(a, b [2][3][2]*big.Int) [2][3][2]*big.Int

Add performs an addition on the Fq12

func (Fq12) Affine

func (fq12 Fq12) Affine(a [2][3][2]*big.Int) [2][3][2]*big.Int

func (Fq12) Div

func (fq12 Fq12) Div(a, b [2][3][2]*big.Int) [2][3][2]*big.Int

Div performs a division on the Fq12

func (Fq12) Double

func (fq12 Fq12) Double(a [2][3][2]*big.Int) [2][3][2]*big.Int

Double performs a doubling on the Fq12

func (Fq12) Equal

func (fq12 Fq12) Equal(a, b [2][3][2]*big.Int) bool

func (Fq12) Exp

func (fq12 Fq12) Exp(base [2][3][2]*big.Int, e *big.Int) [2][3][2]*big.Int

func (Fq12) Inverse

func (fq12 Fq12) Inverse(a [2][3][2]*big.Int) [2][3][2]*big.Int

Inverse returns the inverse on the Fq12

func (Fq12) Mul

func (fq12 Fq12) Mul(a, b [2][3][2]*big.Int) [2][3][2]*big.Int

Mul performs a multiplication on the Fq12

func (Fq12) MulScalar

func (fq12 Fq12) MulScalar(base [2][3][2]*big.Int, e *big.Int) [2][3][2]*big.Int

func (Fq12) Neg

func (fq12 Fq12) Neg(a [2][3][2]*big.Int) [2][3][2]*big.Int

Neg performs a negation on the Fq12

func (Fq12) One

func (fq12 Fq12) One() [2][3][2]*big.Int

One returns a One value on the Fq12

func (Fq12) Square

func (fq12 Fq12) Square(a [2][3][2]*big.Int) [2][3][2]*big.Int

Square performs a square operation on the Fq12

func (Fq12) Sub

func (fq12 Fq12) Sub(a, b [2][3][2]*big.Int) [2][3][2]*big.Int

Sub performs a subtraction on the Fq12

func (Fq12) Zero

func (fq12 Fq12) Zero() [2][3][2]*big.Int

Zero returns a Zero value on the Fq12

type Fq2

type Fq2 struct {
	F          Fq
	NonResidue *big.Int
}

Fq2 is Field 2

func NewFq2

func NewFq2(f Fq, nonResidue *big.Int) Fq2

NewFq2 generates a new Fq2

func (Fq2) Add

func (fq2 Fq2) Add(a, b [2]*big.Int) [2]*big.Int

Add performs an addition on the Fq2

func (Fq2) Affine

func (fq2 Fq2) Affine(a [2]*big.Int) [2]*big.Int

func (Fq2) Copy

func (fq2 Fq2) Copy(a [2]*big.Int) [2]*big.Int

func (Fq2) Div

func (fq2 Fq2) Div(a, b [2]*big.Int) [2]*big.Int

Div performs a division on the Fq2

func (Fq2) Double

func (fq2 Fq2) Double(a [2]*big.Int) [2]*big.Int

Double performs a doubling on the Fq2

func (Fq2) Equal

func (fq2 Fq2) Equal(a, b [2]*big.Int) bool

func (Fq2) Inverse

func (fq2 Fq2) Inverse(a [2]*big.Int) [2]*big.Int

Inverse returns the inverse on the Fq2

func (Fq2) IsZero

func (fq2 Fq2) IsZero(a [2]*big.Int) bool

func (Fq2) Mul

func (fq2 Fq2) Mul(a, b [2]*big.Int) [2]*big.Int

Mul performs a multiplication on the Fq2

func (Fq2) MulScalar

func (fq2 Fq2) MulScalar(p [2]*big.Int, e *big.Int) [2]*big.Int

func (Fq2) Neg

func (fq2 Fq2) Neg(a [2]*big.Int) [2]*big.Int

Neg performs a negation on the Fq2

func (Fq2) One

func (fq2 Fq2) One() [2]*big.Int

One returns a One value on the Fq2

func (Fq2) Square

func (fq2 Fq2) Square(a [2]*big.Int) [2]*big.Int

Square performs a square operation on the Fq2

func (Fq2) Sub

func (fq2 Fq2) Sub(a, b [2]*big.Int) [2]*big.Int

Sub performs a subtraction on the Fq2

func (Fq2) Zero

func (fq2 Fq2) Zero() [2]*big.Int

Zero returns a Zero value on the Fq2

type Fq6

type Fq6 struct {
	F          Fq2
	NonResidue [2]*big.Int
}

Fq6 is Field 6

func NewFq6

func NewFq6(f Fq2, nonResidue [2]*big.Int) Fq6

NewFq6 generates a new Fq6

func (Fq6) Add

func (fq6 Fq6) Add(a, b [3][2]*big.Int) [3][2]*big.Int

Add performs an addition on the Fq6

func (Fq6) Affine

func (fq6 Fq6) Affine(a [3][2]*big.Int) [3][2]*big.Int

func (Fq6) Copy

func (fq6 Fq6) Copy(a [3][2]*big.Int) [3][2]*big.Int

func (Fq6) Div

func (fq6 Fq6) Div(a, b [3][2]*big.Int) [3][2]*big.Int

Div performs a division on the Fq6

func (Fq6) Double

func (fq6 Fq6) Double(a [3][2]*big.Int) [3][2]*big.Int

func (Fq6) Equal

func (fq6 Fq6) Equal(a, b [3][2]*big.Int) bool

func (Fq6) Inverse

func (fq6 Fq6) Inverse(a [3][2]*big.Int) [3][2]*big.Int

Inverse returns the inverse on the Fq6

func (Fq6) Mul

func (fq6 Fq6) Mul(a, b [3][2]*big.Int) [3][2]*big.Int

Mul performs a multiplication on the Fq6

func (Fq6) MulScalar

func (fq6 Fq6) MulScalar(base [3][2]*big.Int, e *big.Int) [3][2]*big.Int

func (Fq6) Neg

func (fq6 Fq6) Neg(a [3][2]*big.Int) [3][2]*big.Int

Neg performs a negation on the Fq6

func (Fq6) One

func (fq6 Fq6) One() [3][2]*big.Int

One returns a One value on the Fq6

func (Fq6) Square

func (fq6 Fq6) Square(a [3][2]*big.Int) [3][2]*big.Int

Square performs a square operation on the Fq6

func (Fq6) Sub

func (fq6 Fq6) Sub(a, b [3][2]*big.Int) [3][2]*big.Int

Sub performs a subtraction on the Fq6

func (Fq6) Zero

func (fq6 Fq6) Zero() [3][2]*big.Int

Zero returns a Zero value on the Fq6

Jump to

Keyboard shortcuts

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