eddsa

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurveParams

func GetCurveParams() twistededwards.CurveParams

GetCurveParams get the parameters of the Edwards curve used

func New

func New(seed [32]byte, hFunc hash.Hash) (PublicKey, PrivateKey)

New creates an instance of eddsa

func Verify

func Verify(sig Signature, message fr.Element, pub PublicKey) (bool, error)

Verify verifies an eddsa signature cf https://en.wikipedia.org/wiki/EdDSA

Types

type PrivateKey

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

PrivateKey private key of an eddsa instance

type PublicKey

type PublicKey struct {
	A     twistededwards.Point
	HFunc hash.Hash
}

PublicKey eddsa signature object cf https://en.wikipedia.org/wiki/EdDSA for notation

type Signature

type Signature struct {
	R twistededwards.Point
	S fr.Element // not in Montgomery form
}

Signature represents an eddsa signature cf https://en.wikipedia.org/wiki/EdDSA for notation

func Sign

func Sign(message fr.Element, pub PublicKey, priv PrivateKey) (Signature, error)

Sign sign a message (in Montgomery form) cf https://en.wikipedia.org/wiki/EdDSA for the notations Eddsa is supposed to be built upon Edwards (or twisted Edwards) curves having 256 bits group size and cofactor=4 or 8

Jump to

Keyboard shortcuts

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