pub trait VRFProof: for<'a> TryFrom<&'a [u8], Error = CryptoMaterialError> + Sized + Debug + Clone + Eq + Hash + Sealed {
    type PublicKeyMaterial: VRFPublicKey<ProofMaterial = Self>;
    type PrivateKeyMaterial: VRFPrivateKey<ProofMaterial = Self>;

    // Required methods
    fn to_hash(&self) -> Result<HashValue>;
    fn verify(
        &self,
        seed: &[u8],
        public_key: &Self::PublicKeyMaterial
    ) -> Result<HashValue>;
}
Expand description

The proof of VRF

Required Associated Types§

source

type PublicKeyMaterial: VRFPublicKey<ProofMaterial = Self>

The associated public key type for this proof.

source

type PrivateKeyMaterial: VRFPrivateKey<ProofMaterial = Self>

The associated private key type for this proof.

Required Methods§

source

fn to_hash(&self) -> Result<HashValue>

Convert the proof to a verifiable random number (hash).

source

fn verify( &self, seed: &[u8], public_key: &Self::PublicKeyMaterial ) -> Result<HashValue>

Verify if the proof is generated from seed by the private key of public_key.

If successful, return the VRF hash output.

Object Safety§

This trait is not object safe.

Implementors§