Documentation ¶
Index ¶
Constants ¶
const ( PublicKeySize = pointSize PrivateKeySize = scalarSize + pointSize ProofSize = pointSize + intermediateSize + scalarSize )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey contains the VRF private key, a standard ed25519 key and the precomputed secret scalar.
func GenerateKey ¶
func GenerateKey(rnd io.Reader) (sk *PrivateKey, err error)
GenerateKey creates a public/private key pair using rnd for randomness. If rnd is nil, crypto/rand is used.
func NewPrivateKey ¶
func NewPrivateKey(skBytes []byte) (sk *PrivateKey, err error)
NewPrivateKey generates a PrivateKey object from a standard RFC8032 Ed25519 64-byte private key.
func (*PrivateKey) Bytes ¶
func (sk *PrivateKey) Bytes() []byte
Bytes serialises the private VRF key in a bytearray.
func (*PrivateKey) Prove ¶
func (sk *PrivateKey) Prove(message []byte) (vrf, proof []byte, err error)
Prove returns a proof such that Verify(pk, message, vrf, proof) == true for a given message and public key pair sk/pk. This function is defined in section 5.1 of draft-irtf-cfrg-vrf-10.
func (*PrivateKey) Public ¶
func (sk *PrivateKey) Public() (*PublicKey, error)
Public extracts the public VRF key from the underlying private-key.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey contains the VRF public key, the canonical representation of a point on the ed25519 curve.
func NewPublicKey ¶
NewPublicKey generates a PublicKey object from a standard RFC8032 Ed25519 32-byte public key.