field

package
v0.0.0-...-6ce53f3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Value   *big.Int
	Modulus *big.Int
}

func CryptoRandomField

func CryptoRandomField(rand io.Reader, modulus *big.Int) (*Field, error)

func NewZero

func NewZero(modulus *big.Int) *Field

func RandomField

func RandomField(rand *rand.Rand, modulus *big.Int) *Field

func (*Field) Add

func (fp *Field) Add(addendA *Field, addendB *Field) *Field

Add sets fp as "addendA + addendB".

func (*Field) Clone

func (fp *Field) Clone() *Field

func (*Field) DivideBy

func (fp *Field) DivideBy(dividend *Field, divisor *Field) *Field

DivideBy sets fp as "dividend / divisor".

func (*Field) Equals

func (fp *Field) Equals(other *Field) bool

func (*Field) Inverse

func (fp *Field) Inverse(element *Field) *Field

Inverse sets fp the multiplicative inverse of field element fp, i.e., "fp^{-1}".

func (*Field) IsZero

func (fp *Field) IsZero() bool

func (*Field) Multiply

func (fp *Field) Multiply(factorA *Field, factorB *Field) *Field

Multiply sets fp as "factorA * factorB".

func (*Field) Negative

func (fp *Field) Negative(element *Field) *Field

Negative sets fp the additive inverse of a field element fp, i.e., "-fp".

func (*Field) String

func (fp *Field) String() string

func (*Field) Subtract

func (fp *Field) Subtract(minuend *Field, subtrahend *Field) *Field

Subtract sets fp as "minuend - subtrahend".

Jump to

Keyboard shortcuts

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