Documentation
¶
Overview ¶
Package curve provides definitions of several models of elliptic curves defined over finite fields of large prime characteristic.
Index ¶
- type CurveID
- type EllCurve
- type Isogeny
- type M
- type MTCurve
- func (e *MTCurve) Add(p, q Point) Point
- func (e *MTCurve) ClearCofactor(p Point) Point
- func (e MTCurve) Cofactor() *big.Int
- func (e *MTCurve) Double(p Point) Point
- func (e MTCurve) Field() GF.Field
- func (e *MTCurve) Identity() Point
- func (e *MTCurve) IsEqual(ec EllCurve) bool
- func (e *MTCurve) IsOnCurve(p Point) bool
- func (e *MTCurve) IsValid() bool
- func (e *MTCurve) Neg(p Point) Point
- func (e *MTCurve) NewPoint(x, y GF.Elt) (P Point)
- func (e MTCurve) Order() *big.Int
- func (e *MTCurve) ScalarMult(p Point, k *big.Int) Point
- func (e *MTCurve) String() string
- func (e *MTCurve) ToWeierstrassC() RationalMap
- type Point
- type RationalMap
- type T
- type TECurve
- func (e *TECurve) Add(p, q Point) Point
- func (e *TECurve) ClearCofactor(p Point) Point
- func (e TECurve) Cofactor() *big.Int
- func (e *TECurve) Double(p Point) Point
- func (e TECurve) Field() GF.Field
- func (e *TECurve) Identity() Point
- func (e *TECurve) IsComplete() bool
- func (e *TECurve) IsEqual(ec EllCurve) bool
- func (e *TECurve) IsOnCurve(p Point) bool
- func (e *TECurve) IsValid() bool
- func (e *TECurve) Neg(p Point) Point
- func (e *TECurve) NewPoint(x, y GF.Elt) (P Point)
- func (e TECurve) Order() *big.Int
- func (e *TECurve) ScalarMult(p Point, k *big.Int) Point
- func (e *TECurve) String() string
- func (e *TECurve) ToWeierstrassC() RationalMap
- type W
- type WC
- type WCCurve
- func (e *WCCurve) Add(p, q Point) Point
- func (e *WCCurve) ClearCofactor(p Point) Point
- func (e WCCurve) Cofactor() *big.Int
- func (e *WCCurve) Double(p Point) Point
- func (e WCCurve) Field() GF.Field
- func (e *WCCurve) Identity() Point
- func (e *WCCurve) IsEqual(ec EllCurve) bool
- func (e *WCCurve) IsOnCurve(p Point) bool
- func (e *WCCurve) IsValid() bool
- func (e *WCCurve) Neg(p Point) Point
- func (e *WCCurve) NewPoint(x, y GF.Elt) (P Point)
- func (e WCCurve) Order() *big.Int
- func (e *WCCurve) String() string
- func (e *WCCurve) ToWeierstrass() RationalMap
- type WECurve
- func (e *WECurve) Add(p, q Point) Point
- func (e *WECurve) ClearCofactor(p Point) Point
- func (e WECurve) Cofactor() *big.Int
- func (e *WECurve) Double(p Point) Point
- func (e *WECurve) EvalRHS(x GF.Elt) GF.Elt
- func (e WECurve) Field() GF.Field
- func (e *WECurve) Identity() Point
- func (e *WECurve) IsEqual(ec EllCurve) bool
- func (e *WECurve) IsOnCurve(p Point) bool
- func (e *WECurve) IsValid() bool
- func (e *WECurve) Neg(p Point) Point
- func (e *WECurve) NewPoint(x, y GF.Elt) (P Point)
- func (e WECurve) Order() *big.Int
- func (e *WECurve) ScalarMult(p Point, k *big.Int) Point
- func (e *WECurve) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EllCurve ¶
type EllCurve interface { Field() GF.Field Order() *big.Int Cofactor() *big.Int NewPoint(x, y GF.Elt) Point // Predicates IsOnCurve(Point) bool IsEqual(EllCurve) bool // Arithmetic operations Identity() Point Neg(Point) Point Add(Point, Point) Point Double(Point) Point ClearCofactor(Point) Point }
EllCurve represents an elliptic curve group.
type Isogeny ¶
Isogeny represents an isogeny between two elliptic curves.
func GetBLS12381G1Isogeny ¶
func GetBLS12381G1Isogeny() Isogeny
GetSECP256K1Isogeny returns an 11-degree isogeny from BLS12381G1_11ISO to the BLS12381G1 elliptic curve.
func GetSECP256K1Isogeny ¶
func GetSECP256K1Isogeny() Isogeny
GetSECP256K1Isogeny returns a 3-degree isogeny from SECP256K1_3ISO to the SECP256K1 elliptic curve.
type MTCurve ¶
type MTCurve struct {
// contains filtered or unexported fields
}
MTCurve is a Montgomery curve
func NewMontgomery ¶
NewMontgomery returns a Montgomery curve
func (*MTCurve) ClearCofactor ¶
func (*MTCurve) ToWeierstrassC ¶
func (e *MTCurve) ToWeierstrassC() RationalMap
type Point ¶
type Point interface { Copy() Point IsIdentity() bool IsEqual(Point) bool IsTwoTorsion() bool X() GF.Elt Y() GF.Elt }
Point represents an elliptic curve point.
type RationalMap ¶
type RationalMap interface { Domain() EllCurve Codomain() EllCurve Push(Point) Point Pull(Point) Point }
RationalMap represents a birational map between two elliptic curves.
func FromTe2Mt25519 ¶
func FromTe2Mt25519() RationalMap
FromTe2Mt25519 returns the birational map between Edwards25519 and Curve25519 curves.
func FromTe2Mt4ISO448 ¶
func FromTe2Mt4ISO448() RationalMap
FromTe2Mt4ISO448 returns the four-degree isogeny between Edwards448 and Curve448 curves.
type TECurve ¶
type TECurve struct {
// contains filtered or unexported fields
}
TECurve is a twisted Edwards curve
func NewEdwards ¶
NewEdwards returns a twisted Edwards curve
func (*TECurve) ClearCofactor ¶
func (*TECurve) IsComplete ¶
func (*TECurve) ToWeierstrassC ¶
func (e *TECurve) ToWeierstrassC() RationalMap
type WCCurve ¶
type WCCurve struct { RationalMap // contains filtered or unexported fields }
WCCurve is a Weierstrass curve
func NewWeierstrassC ¶
NewWeierstrassC returns a Weierstrass curve
func (*WCCurve) ClearCofactor ¶
func (*WCCurve) ToWeierstrass ¶
func (e *WCCurve) ToWeierstrass() RationalMap
type WECurve ¶
type WECurve struct {
// contains filtered or unexported fields
}
WECurve is a Weierstrass curve
func NewWeierstrass ¶
NewWeierstrass returns a Weierstrass curve