Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 730 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 730 Bytes

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))