vrfs

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 8 Imported by: 0

README

VRF Functions

SetInterfaceAddress()
SetInterfaceAddress()
SetInterfaceAddress()
SetInterfaceAddress()
SetInterfaceAddress()

Documentation

Index

Constants

View Source
const (
	N2 = 32 // ceil(log2(q) / 8)
	N  = N2 / 2

	NOSIGN = 3
)
View Source
const (
	// PublicKeySize is the size, in bytes, of public keys as used in this package.
	PublicKeySize = 32
	// PrivateKeySize is the size, in bytes, of private keys as used in this package.
	PrivateKeySize = 64
	// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
	SignatureSize = 64
)

Variables

View Source
var (
	ErrMalformedInput = errors.New("ECVRF: malformed input")
	ErrDecodeError    = errors.New("ECVRF: decode error")
	ErrInternalError  = errors.New("ECVRF: internal error")
)

Functions

func Hash

func Hash(pi []byte) []byte

Hash converts proof(pi) into vrf output(hash) without verifying it

func Prove

func Prove(pk []byte, sk []byte, m []byte) (pi, hash []byte, err error)

assume <pk, sk> were generated by ed25519.GenerateKey() Prove generates vrf output and corresponding proof(pi) with secret key

func Verify

func Verify(pk []byte, pi []byte, m []byte) (bool, error)

[]byte(message) Verify checks if the proof is correct or not

Types

type CachedGroupElement

type CachedGroupElement struct {
	Z, T2d edwards25519.FieldElement
	// contains filtered or unexported fields
}

copied from edwards25519.go and const.go in golang.org/x/crypto/ed25519/internal/edwards25519

Jump to

Keyboard shortcuts

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