pub trait VerifiableRandomFunction: AsymmetricPublicKey + AsymmetricKey {
    type VerifiedRandomOutput;
    type RandomOutput;
    type Input: ?Sized;

    const VERIFIED_RANDOM_SIZE: usize;

    // Required methods
    fn evaluate_and_prove<T: RngCore + CryptoRng>(
        secret: &Self::Secret,
        input: &Self::Input,
        rng: T
    ) -> Self::VerifiedRandomOutput;
    fn verify(
        public: &Self::Public,
        input: &Self::Input,
        vrand: &Self::VerifiedRandomOutput
    ) -> VrfVerification;
    fn strip_verification_output(
        vr: &Self::VerifiedRandomOutput
    ) -> Self::RandomOutput;
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn evaluate_and_prove<T: RngCore + CryptoRng>( secret: &Self::Secret, input: &Self::Input, rng: T ) -> Self::VerifiedRandomOutput

source

fn verify( public: &Self::Public, input: &Self::Input, vrand: &Self::VerifiedRandomOutput ) -> VrfVerification

source

fn strip_verification_output( vr: &Self::VerifiedRandomOutput ) -> Self::RandomOutput

Implementors§