grumpkin

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 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) 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) 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) 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) 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) 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) Len

func (f ScalarField) Len() int

func (*ScalarField) One

func (f *ScalarField) One() ScalarField

func (ScalarField) Size

func (f ScalarField) Size() int

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