Documentation ¶
Overview ¶
Package p256 implements a verifiable random function using curve p256.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPointNotOnCurve occurs when a public key is not on the curve. ErrPointNotOnCurve = errors.New("point is not on the S256 curve") // ErrWrongKeyType occurs when a key is not an ECDSA key. ErrWrongKeyType = errors.New("not an ECDSA key") // ErrNoPEMFound occurs when attempting to parse a non PEM data structure. ErrNoPEMFound = errors.New("no PEM block found") // ErrInvalidVRF occurs when the VRF does not validate. ErrInvalidVRF = errors.New("invalid VRF proof") )
Functions ¶
func GenerateKey ¶
func GenerateKey() (*PrivateKey, *PublicKey)
GenerateKey generates a fresh keypair for this VRF
Types ¶
type PrivateKey ¶
type PrivateKey struct {
*ecdsa.PrivateKey
}
PrivateKey holds a private VRF key.
func (PrivateKey) Evaluate ¶
func (k PrivateKey) Evaluate(m []byte) (index [32]byte, proof []byte)
Evaluate returns the verifiable unpredictable function evaluated at m
func (PrivateKey) Public ¶
func (k PrivateKey) Public() crypto.PublicKey
Public returns the corresponding public key as bytes.
Click to show internal directories.
Click to hide internal directories.