Skip to content

stsch9/pyvrf-r255

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyvrf-r255

This is a simple python implementation of
c2sp.org/vrf-r255.

It uses pysodium for all Ristretto255 functions. Therefore it requires a pre-installed libsodium from:
https://github.com/jedisct1/libsodium

Usage:

# Use your own private Key
vrf = ECVRF(bytes.fromhex('3431c2b03533e280b23232e280b34e2c3132c2b03238e280b23131e280b34500'))

# or create a random private Key
vrf = ECVRF.random_key()

# Get the secret Key
sk = vrf.secret_key

# Get the public Key
pk = vrf.public_key

# Get proof and hash for a message
pi, beta = vrf.hash(b'bla')

# Verify
print(vrf.verify(pk, b'bla', pi, beta))

Releases

No releases published

Packages

No packages published

Languages