kyber: go.dedis.ch/kyber/group/edwards25519 Index | Files

package edwards25519

import "go.dedis.ch/kyber/group/edwards25519"

Package edwards25519 provides an optimized Go implementation of a Twisted Edwards curve that is isomorphic to Curve25519. For details see: http://ed25519.cr.yp.to/.

This code is based on Adam Langley's Go port of the public domain, "ref10" implementation of the ed25519 signing scheme in C from SUPERCOP. It was generalized and extended to support full kyber.Group arithmetic by the DEDIS lab at Yale and EPFL.

Due to the field element and group arithmetic optimizations described in the Ed25519 paper, this implementation generally performs extremely well, typically comparable to native C implementations. The tradeoff is that this code is completely specialized to a single curve.

Index

Package Files

const.go curve.go fe.go ge.go ge_mult_vartime.go point.go point_vartime.go scalar.go suite.go

type Curve Uses

type Curve struct {
}

Curve represents the Ed25519 group. There are no parameters and no initialization is required because it supports only this one specific curve.

func (*Curve) NewKey Uses

func (c *Curve) NewKey(stream cipher.Stream) kyber.Scalar

NewKey returns a formatted Ed25519 key (avoiding subgroup attack by requiring it to be a multiple of 8). NewKey implements the kyber/util/key.Generator interface.

func (*Curve) NewKeyAndSeed Uses

func (c *Curve) NewKeyAndSeed(stream cipher.Stream) (kyber.Scalar, []byte, []byte)

NewKeyAndSeed returns a formatted Ed25519 key (avoid subgroup attack by requiring it to be a multiple of 8). It also returns the seed and the input used to generate the key.

func (*Curve) NewKeyAndSeedWithInput Uses

func (c *Curve) NewKeyAndSeedWithInput(buffer []byte) (kyber.Scalar, []byte, []byte)

NewKeyAndSeedWithInput returns a formatted Ed25519 key (avoid subgroup attack by requiring it to be a multiple of 8). It also returns the input and the digest used to generate the key.

func (*Curve) Point Uses

func (c *Curve) Point() kyber.Point

Point creates a new Point on the Ed25519 curve.

func (*Curve) PointLen Uses

func (c *Curve) PointLen() int

PointLen returns 32, the size in bytes of an encoded Point on the Ed25519 curve.

func (*Curve) Scalar Uses

func (c *Curve) Scalar() kyber.Scalar

Scalar creates a new Scalar for the prime-order subgroup of the Ed25519 curve. The scalars in this package implement kyber.Scalar's SetBytes method, interpreting the bytes as a little-endian integer, in order to remain compatible with other Ed25519 implementations, and with the standard implementation of the EdDSA signature.

func (*Curve) ScalarLen Uses

func (c *Curve) ScalarLen() int

ScalarLen returns 32, the size in bytes of an encoded Scalar for the Ed25519 curve.

func (*Curve) String Uses

func (c *Curve) String() string

Return the name of the curve, "Ed25519".

type SuiteEd25519 Uses

type SuiteEd25519 struct {
    Curve
    // contains filtered or unexported fields
}

SuiteEd25519 implements some basic functionalities such as Group, HashFactory, and XOFFactory.

func NewBlakeSHA256Ed25519 Uses

func NewBlakeSHA256Ed25519() *SuiteEd25519

NewBlakeSHA256Ed25519 returns a cipher suite based on package go.dedis.ch/kyber/v4/xof/blake2xb, SHA-256, and the Ed25519 curve. It produces cryptographically random numbers via package crypto/rand.

func NewBlakeSHA256Ed25519WithRand Uses

func NewBlakeSHA256Ed25519WithRand(r cipher.Stream) *SuiteEd25519

NewBlakeSHA256Ed25519WithRand returns a cipher suite based on package go.dedis.ch/kyber/v4/xof/blake2xb, SHA-256, and the Ed25519 curve. It produces cryptographically random numbers via the provided stream r.

func (*SuiteEd25519) Hash Uses

func (s *SuiteEd25519) Hash() hash.Hash

Hash returns a newly instanciated sha256 hash function.

func (*SuiteEd25519) New Uses

func (s *SuiteEd25519) New(t reflect.Type) interface{}

New implements the kyber.Encoding interface

func (*SuiteEd25519) RandomStream Uses

func (s *SuiteEd25519) RandomStream() cipher.Stream

RandomStream returns a cipher.Stream that returns a key stream from crypto/rand.

func (*SuiteEd25519) Read Uses

func (s *SuiteEd25519) Read(r io.Reader, objs ...interface{}) error

func (*SuiteEd25519) Write Uses

func (s *SuiteEd25519) Write(w io.Writer, objs ...interface{}) error

func (*SuiteEd25519) XOF Uses

func (s *SuiteEd25519) XOF(key []byte) kyber.XOF

XOF returns an XOF which is implemented via the Blake2b hash.

Package edwards25519 imports 17 packages (graph) and is imported by 1 packages. Updated 2019-10-29. Refresh now. Tools for package owners.