eddsa

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(public abstract.Point, msg, sig []byte) error

Verify takes a signature issued by EdDSA.Sign and return nil if it is a valid signature, or an error otherwise Takes:

  • public key used in signing
  • msg is the message to sign
  • sig is the signature return by EdDSA.Sign

Types

type EdDSA

type EdDSA struct {

	// Secret being already hashed + bit tweaked
	Secret abstract.Scalar
	// Public is the corresponding public key
	Public abstract.Point
	// contains filtered or unexported fields
}

EdDSA implements the EdDSA signature algorithm according to the RFC https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02

func NewEdDSA

func NewEdDSA(stream cipher.Stream) *EdDSA

NewEdDSA will return a freshly generated key pair to use for generating EdDSA signatures. If stream == nil, it will take the random.Stream.

func (*EdDSA) MarshalBinary

func (e *EdDSA) MarshalBinary() ([]byte, error)

MarshalBinary will return the representation used by the reference implementation of SUPERCOP ref10 Namely seed || Public

func (*EdDSA) Prefix

func (e *EdDSA) Prefix() []byte

Prefix returns the Prefix as being the right part of the hashed seed

func (*EdDSA) Sign

func (e *EdDSA) Sign(msg []byte) ([]byte, error)

Sign will return a EdDSA signature of the message msg using Ed25519. NOTE: Code taken from the Python implementation from the RFC https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02

func (*EdDSA) UnmarshalBinary

func (e *EdDSA) UnmarshalBinary(buff []byte) error

UnmarshalBinary transforms a slice of bytes into a EdDSA signature

Jump to

Keyboard shortcuts

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