@@ -254,18 +254,23 @@ pub mod vrf_cert {
254254 ///
255255 /// ## Security
256256 ///
257- /// This is secure because from the view of the honest party the
258- /// certpedpop acts as a secure coin tossing protocol, where if no
259- /// parties controlled my the adversary **do not** abort the output will
260- /// be uniformly distributed . Observe that:
257+ /// If no parties controlled by the adversary abort, the output will
258+ /// be uniformly distributed. The VRF outputs effectively act as a "randomness beacon" -
259+ /// a source of verifiable randomness that all parties can compute deterministically
260+ /// from the certificates . Observe that:
261261 ///
262262 /// 1. The malicious party must commit to all the VRF public keys up front.
263- /// 2. The honest party verifies its contribution to the keygen is included (which are always rampled randomly)
264- /// 3. The VRF is over the transcript and every transcript with the honest party can never happen twice (because of #2).
263+ /// 2. The honest party verifies its contribution to the keygen is included (which are always sampled randomly)
264+ /// 3. The VRF is over the transcript and every transcript with an honest party will always be unique (because of #2).
265265 /// 4. The honest party's VRF output will be both hidden and uniformly distributed.
266- pub fn compute_randomness_beacon ( & self , hasher : impl Hash32 ) -> [ u8 ; 32 ] {
267- // BTreeMap already maintains sorted order by key
268- let mut hasher = hasher;
266+ /// 5. All honest parties with the same `AggKeygenInput::cert_bytes` will output the same check
267+ /// 6. All honest parties with a different `AggKeygenInput::cert_bytes` are statistically likely to output different bytes.
268+ ///
269+ /// This check is *statistically* secure -- per keygen the attacker only
270+ /// has 1/2ⁿ chance of succeeding to collide the checks where `n` is the
271+ /// number of bits the honest parties check among each other. **It is up
272+ /// to the application to limit the number of attempts the adversary can make.**
273+ pub fn vrf_security_check ( & self , mut hasher : impl Hash32 ) -> [ u8 ; 32 ] {
269274 for vrf_proof in self . certificate . values ( ) {
270275 let gamma = vrf_proof. dangerously_access_gamma_without_verifying ( ) ;
271276 hasher. update ( gamma. to_bytes ( ) . as_ref ( ) ) ;
0 commit comments