twistededwards

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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 BLS381's Fr

type Point

type Point struct {
	X, Y fr.Element
}

Point point on a twisted Edwards curve

func NewPoint

func NewPoint(x, y fr.Element) Point

NewPoint creates a new instance of Point

func (*Point) Add

func (p *Point) Add(p1, p2 *Point, ecurve CurveParams) *Point

Add adds two points (x,y), (u,v) on a twisted Edwards curve with parameters a, d modifies p

func (*Point) Double

func (p *Point) Double(p1 *Point, ecurve CurveParams) *Point

Double doubles point (x,y) on a twisted Edwards curve with parameters a, d modifies p

func (*Point) IsOnCurve

func (p *Point) IsOnCurve(ecurve CurveParams) bool

IsOnCurve checks if a point is on the twisted Edwards curve

func (*Point) ScalarMul

func (p *Point) ScalarMul(p1 *Point, ecurve CurveParams, scalar fr.Element) *Point

ScalarMul scalar multiplication of a point p1 points on the twisted Edwards curve c parameters of the twisted Edwards curve scal scalar NOT in Montgomery form modifies p

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL