Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CurveParams = gnarkbandersnatch.GetEdwardsCurve()
var IdentityExt = PointExtendedFromProj(&Identity)
Functions ¶
func ExtendedAddNormalized ¶
func ExtendedAddNormalized(p, p1 *PointExtended, p2 *PointExtendedNormalized) *gnarkbandersnatch.PointExtended
ExtendedAddNormalized computes p = p1 + p2. https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd
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 ¶
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 ¶
func (p *PointExtendedNormalized) Neg(p1 *PointExtendedNormalized) *PointExtendedNormalized
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