MCPcopy Create free account
hub / github.com/docknetwork/crypto / output_verify

Function output_verify

syra/src/vrf.rs:100–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99 #[test]
100 fn output_verify() {
101 let mut rng = StdRng::seed_from_u64(0u64);
102
103 let params = SetupParams::<Bls12_381>::new::<Blake2b512>(b"test");
104 let sk = IssuerSecretKey::new(&mut rng);
105 let pk = IssuerPublicKey::new(&mut rng, &sk, &params);
106
107 let message = Fr::rand(&mut rng);
108 let start = Instant::now();
109 let (out, proof) = Output::generate(message.clone(), sk.as_ref(), params.clone());
110 println!("Time to create VRF output {:?}", start.elapsed());
111
112 let start = Instant::now();
113 proof.verify(message, &out, pk.as_ref(), params).unwrap();
114 println!("Time to verify VRF output {:?}", start.elapsed());
115 }
116}

Callers

nothing calls this directly

Calls 4

randFunction · 0.85
cloneMethod · 0.80
as_refMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected