Documentation
¶
Overview ¶
Package twistededwards implements the arithmetic of twisted Edwards curves in native fields. This uses associated twisted Edwards curves defined over the scalar field of the SNARK curves.
Examples: Jubjub, Bandersnatch (a twisted Edwards) is defined over BLS12-381's scalar field Baby-Jubjub (a twisted Edwards) is defined over BN254's salar fields
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSnarkField ¶
func GetSnarkField(id twistededwards.ID) (*big.Int, error)
GetSnarkField returns the matching snark curve for a twisted edwards curve
Types ¶
type Curve ¶
type Curve interface {
Params() *CurveParams
Endo() *EndoParams
Add(p1, p2 Point) Point
Double(p1 Point) Point
Neg(p1 Point) Point
AssertIsOnCurve(p1 Point)
ScalarMul(p1 Point, scalar frontend.Variable) Point
DoubleBaseScalarMul(p1, p2 Point, s1, s2 frontend.Variable) Point
API() frontend.API
}
Curve methods implemented by a twisted edwards curve inside a circuit
func NewEdCurve ¶
NewEdCurve returns a new Edwards curve
type CurveParams ¶
type CurveParams struct {
A, D, Cofactor, Order *big.Int
Base [2]*big.Int // base point coordinates
}
CurveParams twisted edwards curve parameters ax^2 + y^2 = 1 + d*x^2*y^2 Matches gnark-crypto curve specific params
func GetCurveParams ¶
func GetCurveParams(id twistededwards.ID) (*CurveParams, error)
type EndoParams ¶
EndoParams endomorphism parameters for the curve, if they exist