Documentation ¶
Overview ¶
Package ecvrf implements the "Verifiable Random Functions (VRFs)" IETF draft, providing the ECVRF-EDWARDS25519-SHA512-ELL2 suite.
Index ¶
- Constants
- func ProofToHash(piString []byte) ([]byte, error)
- func Prove(sk ed25519.PrivateKey, alphaString []byte) []byte
- func ProveWithAddedRandomness(rand io.Reader, sk ed25519.PrivateKey, alphaString []byte) ([]byte, error)
- func ProveWithAddedRandomness_v10(rand io.Reader, sk ed25519.PrivateKey, alphaString []byte) ([]byte, error)
- func Prove_v10(sk ed25519.PrivateKey, alphaString []byte) []byte
- func Verify(pk ed25519.PublicKey, piString, alphaString []byte) (bool, []byte)
- func Verify_v10(pk ed25519.PublicKey, piString, alphaString []byte) (bool, []byte)
Constants ¶
const ( // ProofSize is the size, in bytes, of proofs as used in this package. ProofSize = 80 // OutputSize is the size, in bytes, of outputs as used in this package. OutputSize = 64 )
Variables ¶
This section is empty.
Functions ¶
func ProofToHash ¶
ProofToHash implements ECVRF_proof_to_hash for the suite ECVRF-EDWARDS25519-SHA512-ELL2, in variable-time.
ECVRF_proof_to_hash should be run only on pi_string that is known to have been produced by ECVRF_prove, or from within ECVRF_verify.
func Prove ¶
func Prove(sk ed25519.PrivateKey, alphaString []byte) []byte
Prove implements ECVRF_prove for the suite ECVRF-EDWARDS25519-SHA512-ELL2.
func ProveWithAddedRandomness ¶
func ProveWithAddedRandomness(rand io.Reader, sk ed25519.PrivateKey, alphaString []byte) ([]byte, error)
ProveWithAddedRandomness implements ECVRF_prove for the suite ECVRF-EDWARDS25519-SHA512-ELL2, while including additional randomness to mitigate certain fault injection and side-channel attacks. If rand is nil, crypto/rand.Reader will be used.
Warning: If this is set, proofs (`pi_string`) will be non-deterministic. The VRF output (`beta_string`) is identical to that produced by Prove.
func ProveWithAddedRandomness_v10 ¶
func ProveWithAddedRandomness_v10(rand io.Reader, sk ed25519.PrivateKey, alphaString []byte) ([]byte, error)
ProveWithAddedRandomness_v10 is ProveWithAddedRandomness but using the v10 (and earlier) semantics.
func Prove_v10 ¶
func Prove_v10(sk ed25519.PrivateKey, alphaString []byte) []byte
Prove_v10 is Prove but using the v10 (and earlier) semantics.
Types ¶
This section is empty.