vrf

package
v0.11.1-0...-daaff9c Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

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

Functions

func ECP2OS

func ECP2OS(Bx, By *big.Int) []byte

func ECVRF_decode_proof

func ECVRF_decode_proof(pi []byte) (x *big.Int, y *big.Int, c *big.Int, s *big.Int, err error)

func ECVRF_hash_points

func ECVRF_hash_points(ps ...[]byte) *big.Int

func ECVRF_hash_to_curve

func ECVRF_hash_to_curve(m []byte, pk []byte) (x, y *big.Int)

func G

func G() (x, y *big.Int)

func I2OSP

func I2OSP(b *big.Int, n int) []byte

func OS2ECP

func OS2ECP(os []byte) (Bx, By *big.Int)

func OS2IP

func OS2IP(os []byte) *big.Int

func ProofToHash

func ProofToHash(pi []byte) []byte

func Prove

func Prove(key *ecdsa.PrivateKey, data []byte) ([]byte, error)

func Verify

func Verify(key *ecdsa.PublicKey, pi []byte, data []byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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