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.

The group identity is checked unconditionally, for the public key and for every I/O pair. Neither binds the proof to a signer: the secret scalar of the identity key is publicly known, and a pair holding the identity is satisfied by every secret key.

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::InvalidData) if the public key or any I/O pair point is the group identity, Err(Error::VerificationFailure) otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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