vrf

package
v0.0.0-...-2149dca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package vrf implements "Verifiable Random Functions (VRFs)" as specified in RFC 9381, providing the ECVRF-EDWARDS25519-SHA512-ELL2 suite.

Index

Constants

View Source
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

func ProofToHash(piString []byte) ([]byte, error)

ProofToHash implements ECVRF_proof_to_hash for the suite ECVRF-EDWARDS25519-SHA512-ELL2.

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 Prove_v10

func Prove_v10(sk ed25519.PrivateKey, alphaString []byte) []byte

Prove_v10 is Prove but using the draft v7 to v10 semantics.

func Verify

func Verify(pk ed25519.PublicKey, piString, alphaString []byte) (bool, []byte)

Verify implements ECVRF_verify for the suite ECVRF-EDWARDS25519-SHA512-ELL2.

The public key is validated such that the "full uniqueness" and "full collision" properties are satisfied.

func Verify_v10

func Verify_v10(pk ed25519.PublicKey, piString, alphaString []byte) (bool, []byte)

Verify_v10 is Verify but using the draft v7 to v10 semantics.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL