Skip to main content

Verifier

Trait Verifier 

Source
pub trait Verifier<S: TinySuite> {
    // Required method
    fn verify(
        &self,
        ios: impl AsRef<[VrfIo<S>]>,
        aux: impl AsRef<[u8]>,
        proof: &Proof<S>,
    ) -> Result<(), Error>;
}
Expand description

Trait for entities that can verify Tiny VRF proofs.

All curve points involved in verification (public key and I/O pairs) are assumed to be in the prime-order subgroup. This is guaranteed when points are constructed through checked constructors (Public::from_affine, Input::from_affine, Output::from_affine) or through trusted operations like Input::new (hash-to-curve) and Secret::vrf_io.

Using unchecked constructors (e.g. Input::from_affine_unchecked) places the burden of subgroup validation on the caller. Passing points with cofactor components leads to undefined verification behavior.

Required Methods§

Source

fn verify( &self, ios: impl AsRef<[VrfIo<S>]>, aux: impl AsRef<[u8]>, proof: &Proof<S>, ) -> Result<(), Error>

Verify a proof for the given VRF I/O pairs and additional data.

Multiple I/O pairs are delinearized into a single merged pair before verifying.

Returns Ok(()) if verification succeeds, Err(Error::VerificationFailure) otherwise.

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§

Source§

impl<S: TinySuite> Verifier<S> for Public<S>