Expand description
This crate provides an RFC 9381 Verifiable Random Function (VRF), which is the public key version of a keyed cryptographic hash. Only the holder of the secret key can compute the hash, but anyone with the public key can verify the correctness of the hash.
vrf-r255
is built on the ristretto255 group specified in RFC 9496. More
specifically, it is an implementation of the ECVRF-RISTRETTO255-SHA512 ciphersuite
of the RFC 9381 ECVRF construction.
§Examples
use rand_core::OsRng;
use vrf_r255::{PublicKey, SecretKey};
let sk = SecretKey::generate(OsRng);
let pk = PublicKey::from(sk);
let msg = "Real World Cryptography".as_bytes();
let proof = sk.prove(msg);
let hash_output = pk.verify(msg, &proof);
assert!(bool::from(hash_output.is_some()));