Documentation
¶
Overview ¶
Package vrf implements the ECVRF-RISTRETTO255-SHA512 ciphersuite for RFC 9381 Verifiable Random Functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFailedVerification = errors.New("proof verification failed")
ErrFailedVerification indicates that proof verification failed.
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey can be used to compute a VRF hash of an input and a Proof that it is correct.
func NewPrivateKey ¶
func NewPrivateKey(sk []byte) (*PrivateKey, error)
NewPrivateKey returns a PrivateKey from its byte encoding.
func (*PrivateKey) Bytes ¶
func (x *PrivateKey) Bytes() []byte
Bytes returns the byte encoding of x.
func (*PrivateKey) Prove ¶
func (x *PrivateKey) Prove(alpha []byte) (pi *Proof)
Prove computes a VRF hash of the input alpha, and returns a proof that it was computed correctly.
The actual hash can be retrieved with Proof.Hash.
func (*PrivateKey) PublicKey ¶
func (x *PrivateKey) PublicKey() *PublicKey
PublicKey returns the PublicKey for x.
type Proof ¶
type Proof struct {
// contains filtered or unexported fields
}
Proof is a proof that a VRF hash was computed correctly.
The actual hash can be computed from the proof with Proof.Hash.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey can be used to verify a Proof that the corresponding Proof.Hash is the correct VRF hash of an input.