Documentation
¶
Index ¶
- type CurveParams
- type Point
- func (p *Point) Add(p1, p2 *Point) *Point
- func (p *Point) Double(p1 *Point) *Point
- func (p *Point) Equal(p1 *Point) bool
- func (p *Point) FromProj(p1 *PointProj) *Point
- func (p *Point) IsOnCurve() bool
- func (p *Point) Neg(p1 *Point) *Point
- func (p *Point) ScalarMul(p1 *Point, scalar *big.Int) *Point
- func (p *Point) Set(p1 *Point) *Point
- type PointProj
- func (p *PointProj) Add(p1, p2 *PointProj) *PointProj
- func (p *PointProj) Double(p1 *PointProj) *PointProj
- func (p *PointProj) Equal(p1 *PointProj) bool
- func (p *PointProj) FromAffine(p1 *Point) *PointProj
- func (p *PointProj) Neg(p1 *PointProj) *PointProj
- func (p *PointProj) Set(p1 *PointProj) *PointProj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurveParams ¶
type CurveParams struct {
A, D fr.Element // in Montgomery form
Cofactor fr.Element // not in Montgomery form
Order big.Int
Base Point
}
CurveParams curve parameters: ax^2 + y^2 = 1 + d*x^2*y^2
func GetEdwardsCurve ¶
func GetEdwardsCurve() CurveParams
GetEdwardsCurve returns the twisted Edwards curve on BN256's Fr
type Point ¶
Point point on a twisted Edwards curve
func (*Point) Add ¶
Add adds two points (x,y), (u,v) on a twisted Edwards curve with parameters a, d modifies p
func (*Point) Double ¶
Double doubles point (x,y) on a twisted Edwards curve with parameters a, d modifies p
func (*Point) Neg ¶ added in v0.3.6
Neg negates point (x,y) on a twisted Edwards curve with parameters a, d modifies p
type PointProj ¶ added in v0.2.0
PointProj point in projective coordinates
func (*PointProj) Add ¶ added in v0.2.0
Add adds points in projective coordinates cf https://hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
func (*PointProj) Double ¶ added in v0.2.0
Double adds points in projective coordinates cf https://hyperelliptic.org/EFD/g1p/auto-twisted-projective.html
func (*PointProj) Equal ¶ added in v0.3.6
Equal returns true if p=p1 false otherwise If one point is on the affine chart Z=0 it returns false
func (*PointProj) FromAffine ¶ added in v0.2.0
FromAffine sets p in projective from p in affine