vrf

package
v0.0.0-...-dfba71b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package vrf defines the interface to a verifiable random function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueID

func UniqueID(userID, appID string) []byte

UniqueID computes a unique string for a domain, userID and appID combo.

Types

type PrivateKey

type PrivateKey interface {
	// Evaluate returns the output of H(f_k(m)) and its proof.
	Evaluate(m []byte) (index [32]byte, proof []byte)
	// Public returns the corresponding public key.
	Public() crypto.PublicKey
}

PrivateKey supports evaluating the VRF function.

type PublicKey

type PublicKey interface {
	// ProofToHash verifies the NP-proof supplied by Proof and outputs Index.
	ProofToHash(m, proof []byte) (index [32]byte, err error)
}

PublicKey supports verifying output from the VRF function.

Directories

Path Synopsis
Package p256 implements a verifiable random function using curve p256.
Package p256 implements a verifiable random function using curve p256.

Jump to

Keyboard shortcuts

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