Trait VRFProof

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§