pub trait Verifier<S: ThinVrfSuite> {
// Required method
fn verify(
&self,
ios: impl AsRef<[VrfIo<S>]>,
ad: impl AsRef<[u8]>,
proof: &Proof<S>,
) -> Result<(), Error>;
}Expand description
Trait for entities that can verify Thin VRF proofs.
All curve points involved in verification (public key, I/O pairs, and proof
points) 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.
Proof points are guaranteed valid when deserialized via CanonicalDeserialize
(which includes subgroup checks) or produced by Prover::prove.
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. It stays a legal value for the nonce
commitment R, which commits to nothing.
Required Methods§
Sourcefn verify(
&self,
ios: impl AsRef<[VrfIo<S>]>,
ad: impl AsRef<[u8]>,
proof: &Proof<S>,
) -> Result<(), Error>
fn verify( &self, ios: impl AsRef<[VrfIo<S>]>, ad: 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".