Documentation ¶
Overview ¶
Package ethschnorr implements a version of the Schnorr signature which is //////////////////////////////////////////////////////////////////////////////
XXX: Do not use in production until this code has been audited.
////////////////////////////////////////////////////////////////////////////// cheap to verify on-chain.
See https://en.wikipedia.org/wiki/Schnorr_signature For vanilla Schnorr.
Since we are targeting ethereum specifically, there is no need to abstract away the group operations, as original kyber Schnorr code does. Thus, these functions only work with secp256k1 objects, even though they are expressed in terms of the abstract kyber Group interfaces.
This code is largely based on EPFL-DEDIS's go.dedis.ch/kyber/sign/schnorr
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChallengeHash ¶
ChallengeHash returns the value the signer must use to demonstrate knowledge of the secret key
NB: for parity with the on-chain hash, it's important that public and r marshall to the big-endian x ordinate, followed by a byte which is 0 if the y ordinate is even, 1 if it's odd. See evm/contracts/SchnorrSECP256K1.sol and evm/test/schnorr_test.js
func ValidSignature ¶
ValidSignature(s) is true iff s.Signature represents an element of secp256k1
Types ¶
type Signature ¶
type Signature = *signature
Signature is a representation of the Schnorr signature generated and verified by this library.
func NewSignature ¶
func NewSignature() Signature
NewSignature allocates space for a Signature, and returns it