Skip to content

zemyblue/govrf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goVRF

This is VRF library of golang version I forked algorand's libsodium and extract only vrf module from go-algorand.

How to compile libsodium of algorand

cd ./crypto/libsodium
./autogen.sh
./configure
make && make check
sudo make install

And then, libsodium installed under /usr/local/lib/ if MacOS.

Build and Test

go build
go test -v

VRF Types

type VrfPrivkey [64]uint8
type VrfPubkey [32]uint8

VRF functions

make private key and public key

func VrfKeygenFromSeed(seed [32]byte) (pub VrfPubkey, priv VrfPrivkey)
func VrfKeygen() (pub VrfPubkey, priv VrfPrivKey)

VrfPrivKey

func (sk VrfPrivkey) Pubkey() (pk VrfPubkey)
func (sk VrfPrivkey) Prove(message []byte) (proof VrfProof, ok bool)
func (proof VrfProof) Hash() (hash VrfOutput, ok bool)

VrfPubKey

func (pk VrfPubkey) Verify(p VrfProof, message []byte) (bool, VrfOutput

About

Golang wrapper of VRF included libsodium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published