use curve25519_dalek::scalar::Scalar; use pea_vrf::{compress_to_bytes, ristretto_point, Proof}; use rand_core::OsRng; use sha3::Sha3_224; use sha3::Sha3_256; use sha3::Sha3_512; fn main() { let secret: Scalar = Scalar::random(&mut OsRng); let public = compress_to_bytes(ristretto_point(&secret)); let alpha = []; let proof = Proof::new::(&secret, &alpha); let beta = proof.hash::(); println!("public {}", hex::encode(public)); println!("beta {}", hex::encode(beta)); println!("pi {}", hex::encode(proof.to_bytes())); println!( "verify {}", pea_vrf::validate_key(&public) && proof.verify::(&public, &alpha, &beta) ); }