eddsa

package
v5.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package eddsa implements the EdDSA signature algorithm according to RFC8032.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

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

Verify uses a public key, a message and a signature. It will return nil if sig is a valid signature for msg created by key public, or an error otherwise.

func VerifyWithChecks

func VerifyWithChecks(pub, msg, sig []byte) error

VerifyWithChecks uses a public key buffer, a message and a signature. It will return nil if sig is a valid signature for msg created by key public, or an error otherwise. Compared to `Verify`, it performs additional checks around the canonicality and ensures the public key does not have a small order.

Types

type EdDSA

type EdDSA struct {
	// Secret being already hashed + bit tweaked
	Secret kyber.Scalar
	// Public is the corresponding public key
	Public kyber.Point
	// contains filtered or unexported fields
}

EdDSA is a structure holding the data necessary to make a series of EdDSA signatures.

func NewEdDSA

func NewEdDSA(stream cipher.Stream) *EdDSA

NewEdDSA will return a freshly generated key pair to use for generating EdDSA signatures.

func (*EdDSA) MarshalBinary

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

MarshalBinary will return the representation used by the reference implementation of SUPERCOP ref10, which is "seed || Public".

func (*EdDSA) Sign

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

Sign will return a EdDSA signature of the message msg using Ed25519.

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