bandersnatch

package
v0.0.0-...-514ddfb Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Identity = PointProj{
	X: fp.Zero(),
	Y: fp.One(),
	Z: fp.One(),
}

Functions

func WriteUncompressedPoint

func WriteUncompressedPoint(w io.Writer, p *PointAffine) (int, error)

Writes an uncompressed affine point to an io.Writer

Types

type MultiExpConfig

type MultiExpConfig struct {
	NbTasks     int  // go routines to be used in the multiexp. can be larger than num cpus.
	ScalarsMont bool // indicates if the scalars are in montgomery form. Default to false.
}

MultiExpConfig enables to set optional configuration attribute to a call to MultiExp

type PointAffine

type PointAffine = gnarkbandersnatch.PointAffine

func GetPointFromX

func GetPointFromX(x *fp.Element, choose_largest bool) *PointAffine

func MultiExpAffine

func MultiExpAffine(points []PointAffine, scalars []fr.Element, config MultiExpConfig) (PointAffine, error)

MultiExp implements section 4 of https://eprint.iacr.org/2012/549.pdf

func ReadUncompressedPoint

func ReadUncompressedPoint(r io.Reader) (PointAffine, error)

Reads an uncompressed affine point Point is not guaranteed to be in the prime subgroup

type PointExtended

type PointExtended = gnarkbandersnatch.PointExtended

func PointExtendedFromProj

func PointExtendedFromProj(p *PointProj) PointExtended

PointExtendedFromProj converts a point in projective coordinates to extended coordinates.

type PointExtendedNormalized

type PointExtendedNormalized struct {
	X, Y, T gnarkfr.Element
}

PointExtendedNormalized is an extended point which is normalized. i.e: Z=1. We store it this way to save 32 bytes per point in memory.

func (*PointExtendedNormalized) Neg

Neg computes p = -p1

type PointProj

type PointProj = gnarkbandersnatch.PointProj

func MultiExp

func MultiExp(p *PointProj, points []PointAffine, scalars []fr.Element, config MultiExpConfig) (*PointProj, error)

MultiExp implements section 4 of https://eprint.iacr.org/2012/549.pdf Note: We rely on this algortithm not use Equal functionality, since it is called by a banderwagon element

Directories

Path Synopsis
Package fr contains field arithmetic operations for modulus = 0x1cfb69...76e7e1.
Package fr contains field arithmetic operations for modulus = 0x1cfb69...76e7e1.

Jump to

Keyboard shortcuts

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