edwards

package
v0.0.0-...-0b3308b Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2017 License: MPL-2.0 Imports: 16 Imported by: 2

Documentation

Overview

This package contains several implementations of Twisted Edwards Curves, from general and unoptimized to highly specialized and optimized.

Twisted Edwards curves (TEC's) are elliptic curves satisfying the equation:

ax^2 + y^2 = c^2(1 + dx^2y^2)

for some scalars c, d over some field K. We assume K is a (finite) prime field for a large prime p. We also assume c == 1 because all curves in the generalized form are isomorphic to curves having c == 1. For details see Bernstein et al, "Twisted Edwards Curves", http://eprint.iacr.org/2008/013.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAES128SHA256Ed25519

func NewAES128SHA256Ed25519(fullGroup bool) abstract.Suite

Ciphersuite based on AES-128, SHA-256, and the Ed25519 curve.

Types

type ExtendedCurve

type ExtendedCurve struct {
	// contains filtered or unexported fields
}

ExtendedCurve implements Twisted Edwards curves using the Extended Coordinate representation specified in: Hisil et al, "Twisted Edwards Curves Revisited", http://eprint.iacr.org/2008/522

This implementation is designed to work with all Twisted Edwards curves, foregoing the further optimizations that are available for the special case with curve parameter a=-1. We leave the task of hyperoptimization to curve-specific implementations such as the ed25519 package.

func (*ExtendedCurve) Init

func (c *ExtendedCurve) Init(p *Param, fullGroup bool) *ExtendedCurve

Initialize the curve with given parameters.

func (*ExtendedCurve) Point

func (c *ExtendedCurve) Point() abstract.Point

Create a new Point on this curve.

func (*ExtendedCurve) PointLen

func (c *ExtendedCurve) PointLen() int

Returns the size in bytes of an encoded Point on this curve. Uses compressed representation consisting of the y-coordinate and only the sign bit of the x-coordinate.

func (*ExtendedCurve) PrimeOrder

func (c *ExtendedCurve) PrimeOrder() bool

func (*ExtendedCurve) Scalar

func (c *ExtendedCurve) Scalar() abstract.Scalar

Create a new Scalar for this curve.

func (*ExtendedCurve) ScalarLen

func (c *ExtendedCurve) ScalarLen() int

Returns the size in bytes of an encoded Scalar for this curve.

type Param

type Param struct {
	Name string // Name of curve

	P big.Int // Prime defining the underlying field
	Q big.Int // Order of the prime-order base point
	R int     // Cofactor: Q*R is the total size of the curve

	A, D big.Int // Edwards curve equation parameters

	FBX, FBY big.Int // Standard base point for full group
	PBX, PBY big.Int // Standard base point for prime-order subgroup

	Elligator1s big.Int // Optional s parameter for Elligator 1
	Elligator2u big.Int // Optional u parameter for Elligator 2
}

Parameters defining a Twisted Edwards curve (TEC).

func Param1174

func Param1174() *Param

Parameters defining Curve1174, as specified in: Bernstein et al, "Elligator: Elliptic-curve points indistinguishable from uniform random strings" http://elligator.cr.yp.to/elligator-20130828.pdf

func Param25519

func Param25519() *Param

Parameters defining the Edwards version of Curve25519, as specified in: Bernstein et al, "High-speed high-security signatures", http://ed25519.cr.yp.to/ed25519-20110926.pdf

func Param41417

func Param41417() *Param

Parameters for Curve41417, as specified in: Bernstein et al, "Curve41417: Karatsuba revisited", http://eprint.iacr.org/2014/526.pdf

func ParamE382

func ParamE382() *Param

Parameters for the E-382 curve specified in: Aranha et al, "A note on high-security general-purpose elliptic curves", http://eprint.iacr.org/2013/647.pdf

and more recently in: "Additional Elliptic Curves for IETF protocols" http://tools.ietf.org/html/draft-ladd-safecurves-02

func ParamE521

func ParamE521() *Param

Parameters for the E-521 curve specified in: Aranha et al, "A note on high-security general-purpose elliptic curves", http://eprint.iacr.org/2013/647.pdf

and more recently included in: "Additional Elliptic Curves for IETF protocols" http://tools.ietf.org/html/draft-ladd-safecurves-02

func (*Param) String

func (p *Param) String() string

Return the name of this curve.

type ProjectiveCurve

type ProjectiveCurve struct {
	// contains filtered or unexported fields
}

ProjectiveCurve implements Twisted Edwards curves using projective coordinate representation (X:Y:Z), satisfying the identities x = X/Z, y = Y/Z. This representation still supports all Twisted Edwards curves and avoids expensive modular inversions on the critical paths. Uses the projective arithmetic formulas in: http://cr.yp.to/newelliptic/newelliptic-20070906.pdf

func (*ProjectiveCurve) Init

func (c *ProjectiveCurve) Init(p *Param, fullGroup bool) *ProjectiveCurve

Initialize the curve with given parameters.

func (*ProjectiveCurve) Point

func (c *ProjectiveCurve) Point() abstract.Point

Create a new Point on this curve.

func (*ProjectiveCurve) PointLen

func (c *ProjectiveCurve) PointLen() int

Returns the size in bytes of an encoded Point on this curve. Uses compressed representation consisting of the y-coordinate and only the sign bit of the x-coordinate.

func (*ProjectiveCurve) PrimeOrder

func (c *ProjectiveCurve) PrimeOrder() bool

func (*ProjectiveCurve) Scalar

func (c *ProjectiveCurve) Scalar() abstract.Scalar

Create a new Scalar for this curve.

func (*ProjectiveCurve) ScalarLen

func (c *ProjectiveCurve) ScalarLen() int

Returns the size in bytes of an encoded Scalar for this curve.

Jump to

Keyboard shortcuts

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