schnorr

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MPL-2.0 Imports: 7 Imported by: 5

Documentation

Overview

Package schnorr implements the vanilla Schnorr signature scheme. See https://en.wikipedia.org/wiki/Schnorr_signature.

The only difference regarding the vanilla reference is the computation of the response. This implementation adds the random component with the challenge times private key while the Wikipedia article substracts them.

The resulting signature is compatible with EdDSA verification algorithm when using the edwards25519 group, and by extension the CoSi verification algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScheme

func NewScheme(s Suite) sign.Scheme

func Sign

func Sign(s Suite, private kyber.Scalar, msg []byte) ([]byte, error)

Sign creates a Sign signature from a msg and a private key. This signature can be verified with VerifySchnorr. It's also a valid EdDSA signature when using the edwards25519 Group.

func Verify

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

Verify verifies a given Schnorr signature. It returns nil iff the given signature is valid.

Types

type SchnorrScheme

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

func (*SchnorrScheme) NewKeyPair

func (s *SchnorrScheme) NewKeyPair(random cipher.Stream) (kyber.Scalar, kyber.Point)

func (*SchnorrScheme) Sign

func (s *SchnorrScheme) Sign(private kyber.Scalar, msg []byte) ([]byte, error)

func (*SchnorrScheme) Verify

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

type Suite

type Suite interface {
	kyber.Group
	kyber.Random
}

Suite represents the set of functionalities needed by the package schnorr.

Jump to

Keyboard shortcuts

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