Documentation ¶
Overview ¶
Package goldilocks provides elliptic curve operations over the goldilocks curve.
Index ¶
- Constants
- type Curve
- func (Curve) Add(P, Q *Point) *Point
- func (e Curve) CombinedMult(m, n *Scalar, P *Point) *Point
- func (Curve) Double(P *Point) *Point
- func (Curve) Generator() *Point
- func (Curve) Identity() *Point
- func (Curve) IsOnCurve(P *Point) bool
- func (Curve) Order() Scalar
- func (e Curve) ScalarBaseMult(k *Scalar) *Point
- func (e Curve) ScalarMult(k *Scalar, P *Point) *Point
- type Point
- func (P *Point) Add(Q *Point)
- func (P *Point) Double()
- func (P *Point) IsEqual(Q *Point) bool
- func (P *Point) IsIdentity() bool
- func (P *Point) MarshalBinary() (data []byte, err error)
- func (P *Point) Neg()
- func (P Point) String() string
- func (P *Point) ToAffine() (x, y fp.Elt)
- func (P *Point) ToBytes(out []byte) error
- func (P *Point) UnmarshalBinary(data []byte) error
- type Scalar
Constants ¶
const ScalarSize = 56 // 448 / 8
ScalarSize is the size (in bytes) of scalars.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Curve ¶
type Curve struct{}
Curve is the Goldilocks curve x^2+y^2=z^2-39081x^2y^2.
func (Curve) CombinedMult ¶
CombinedMult returns mG+nP, where G is the generator point. This function is non-constant time.
func (Curve) ScalarBaseMult ¶
ScalarBaseMult returns kG where G is the generator point. This function runs in constant time.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point is a point on the Goldilocks Curve.
func FromAffine ¶
FromAffine creates a point from affine coordinates.
func (*Point) IsIdentity ¶
IsIdentity returns true is P is the identity Point.
func (*Point) MarshalBinary ¶
MarshalBinary encodes the receiver into a binary form and returns the result.
func (*Point) UnmarshalBinary ¶
UnmarshalBinary must be able to decode the form generated by MarshalBinary.