/// Run our Schnorr VRF on one single input, producing the output
/// and correspodning Schnorr proof, but only if the result first
/// passes some check, which itself returns either a `bool` or else
/// an `Option` of an extra message transcript.
Run our Schnorr VRF on one single input, producing the output
and correspodning Schnorr proof, but only if the result first
passes some check, which itself returns either a `bool` or else
an `Option` of an extra message transcript.
Run our Schnorr VRF on one single input producing the output and correspodning Schnorr proof but only if the result first passes some check which itself returns either a ` bool ` or else an ` Option ` of an extra message transcript .
pub fn ring_vrf_sign_after_check<F, O, P, A>(
        &self, 
        input: VRFInput,
        check: F,
        copath: RingSecretCopath<A>,
        proving_key: RingSRS<P>,
    ) -> SynthesisResult<Option<(VRFPreOut, RingVRFProof<Bls12>)>>
    where
        F: FnOnce(&VRFInOut) -> O,
        O: VRFExtraMessage,
        P: groth16::ParameterSource<Bls12>,
        P::G1Builder: SourceBuilder<<Bls12 as Engine>::G1Affine>,
        P::G2Builder: SourceBuilder<<Bls12 as Engine>::G2Affine>,
        A: 'static + PoseidonArity,
    {
        let inout = input.to_inout(self);
        let extra = if let Some(e) = check(&inout).extra() { e } else { return Ok(None) };
        Ok(Some(self.ring_vrf_sign_checked(inout, extra, copath, proving_key) ?))
    }
pub fn ring_vrf_sign_after_check < F , O , P , A > ( & self , input : VRFInput , check : F , copath : RingSecretCopath < A > , proving_key : RingSRS < P > , ) -> SynthesisResult < Option < ( VRFPreOut , RingVRFProof < Bls12 > ) > > where F : FnOnce ( & VRFInOut ) -> O , O : VRFExtraMessage , P : groth16 :: ParameterSource < Bls12 > , P :: G1Builder : SourceBuilder < < Bls12 as Engine > :: G1Affine > , P :: G2Builder : SourceBuilder < < Bls12 as Engine > :: G2Affine > , A : ' static + PoseidonArity , { let inout = input . to_inout ( self ) ; let extra = if let Some ( e ) = check ( & inout ) . extra ( ) { e } else { return Ok ( None ) } ; Ok ( Some ( self . ring_vrf_sign_checked ( inout , extra , copath , proving_key ) ? ) ) }
Run our Schnorr VRF on one single input, producing the output
and correspodning Schnorr proof, but only if the result first
passes some check, which itself returns either a `bool` or else
an `Option` of an extra message transcript.
Run our Schnorr VRF on one single input producing the output and correspodning Schnorr proof but only if the result first passes some check which itself returns either a ` bool ` or else an ` Option ` of an extra message transcript .
&self
input
VRFInput
check
F
copath
RingSecretCopath<A>
proving_key
RingSRS<P>