bn254

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE_LIMBS int = 8
)
View Source
const (
	SCALAR_LIMBS int = 8
)

Variables

This section is empty.

Functions

func AffineFromMontgomery

func AffineFromMontgomery(points core.HostOrDeviceSlice) runtime.EIcicleError

func AffineToMontgomery

func AffineToMontgomery(points core.HostOrDeviceSlice) runtime.EIcicleError

func FromMontgomery

func FromMontgomery(scalars core.HostOrDeviceSlice) runtime.EIcicleError

func GenerateAffinePoints

func GenerateAffinePoints(size int) core.HostSlice[Affine]

func GenerateProjectivePoints

func GenerateProjectivePoints(size int) core.HostSlice[Projective]

func GenerateScalars

func GenerateScalars(size int) core.HostSlice[ScalarField]

func ProjectiveFromMontgomery

func ProjectiveFromMontgomery(points core.HostOrDeviceSlice) runtime.EIcicleError

func ProjectiveToMontgomery

func ProjectiveToMontgomery(points core.HostOrDeviceSlice) runtime.EIcicleError

func ToMontgomery

func ToMontgomery(scalars core.HostOrDeviceSlice) runtime.EIcicleError

Types

type Affine

type Affine struct {
	X, Y BaseField
}

func AffineFromProjective

func AffineFromProjective(p *Projective) Affine

func (Affine) AsPointer

func (a Affine) AsPointer() *uint32

func (*Affine) FromLimbs

func (a *Affine) FromLimbs(x, y []uint32) Affine

func (*Affine) IsZero added in v3.1.0

func (a *Affine) IsZero() bool

func (Affine) Size

func (a Affine) Size() int

func (Affine) ToProjective

func (a Affine) ToProjective() Projective

func (*Affine) Zero

func (a *Affine) Zero() Affine

type BaseField

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

func (BaseField) AsPointer

func (f BaseField) AsPointer() *uint32

func (*BaseField) FromBytesLittleEndian

func (f *BaseField) FromBytesLittleEndian(bytes []byte) BaseField

func (*BaseField) FromLimbs

func (f *BaseField) FromLimbs(limbs []uint32) BaseField

func (*BaseField) FromUint32

func (f *BaseField) FromUint32(v uint32) BaseField

func (BaseField) GetLimbs

func (f BaseField) GetLimbs() []uint32

func (*BaseField) IsZero added in v3.1.0

func (f *BaseField) IsZero() bool

func (BaseField) Len

func (f BaseField) Len() int

func (*BaseField) One

func (f *BaseField) One() BaseField

func (BaseField) Size

func (f BaseField) Size() int

func (BaseField) ToBytesLittleEndian

func (f BaseField) ToBytesLittleEndian() []byte

func (*BaseField) Zero

func (f *BaseField) Zero() BaseField

type Projective

type Projective struct {
	X, Y, Z BaseField
}

func (Projective) Add added in v3.3.0

func (p Projective) Add(p2 *Projective) Projective

func (Projective) AsPointer

func (p Projective) AsPointer() *uint32

func (*Projective) FromAffine

func (p *Projective) FromAffine(a Affine) Projective

func (*Projective) FromLimbs

func (p *Projective) FromLimbs(x, y, z []uint32) Projective

func (Projective) ProjectiveEq

func (p Projective) ProjectiveEq(p2 *Projective) bool

func (Projective) Size

func (p Projective) Size() int

func (Projective) Sub added in v3.3.0

func (p Projective) Sub(p2 *Projective) Projective

func (*Projective) ToAffine

func (p *Projective) ToAffine() Affine

func (*Projective) Zero

func (p *Projective) Zero() Projective

type ScalarField

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

func (ScalarField) Add added in v3.3.0

func (f ScalarField) Add(f2 *ScalarField) ScalarField

func (ScalarField) AsPointer

func (f ScalarField) AsPointer() *uint32

func (*ScalarField) FromBytesLittleEndian

func (f *ScalarField) FromBytesLittleEndian(bytes []byte) ScalarField

func (*ScalarField) FromLimbs

func (f *ScalarField) FromLimbs(limbs []uint32) ScalarField

func (*ScalarField) FromUint32

func (f *ScalarField) FromUint32(v uint32) ScalarField

func (ScalarField) GetLimbs

func (f ScalarField) GetLimbs() []uint32

func (ScalarField) Inv added in v3.3.0

func (f ScalarField) Inv() ScalarField

func (*ScalarField) IsZero added in v3.1.0

func (f *ScalarField) IsZero() bool

func (ScalarField) Len

func (f ScalarField) Len() int

func (ScalarField) Mul added in v3.3.0

func (f ScalarField) Mul(f2 *ScalarField) ScalarField

func (*ScalarField) One

func (f *ScalarField) One() ScalarField

func (ScalarField) Pow added in v3.3.0

func (f ScalarField) Pow(exp int) ScalarField

func (ScalarField) Size

func (f ScalarField) Size() int

func (ScalarField) Sqr added in v3.3.0

func (f ScalarField) Sqr() ScalarField

func (ScalarField) Sub added in v3.3.0

func (f ScalarField) Sub(f2 *ScalarField) ScalarField

func (ScalarField) ToBytesLittleEndian

func (f ScalarField) ToBytesLittleEndian() []byte

func (*ScalarField) Zero

func (f *ScalarField) Zero() ScalarField

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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