pub fn verify(&self, proof: &Proof, alpha: &[u8]) -> Result<(), VrfError> {
        let h_point = self.hash_to_curve(alpha);
        let pk_point = match CompressedEdwardsY::from_slice(self.as_bytes()).decompress() {
            Some(pt) => pt,
            None => {
                return Err(VrfError::Verification(
                    "Failed to decompress public key into Edwards point".to_string(),
                ))
            }
        };
        let cprime = hash_points(&[
            h_point,
            proof.gamma,
            ED25519_BASEPOINT_POINT * proof.s - pk_point * proof.c,
            h_point * proof.s - proof.gamma * proof.c,
        ]);

        if proof.c == cprime {
            Ok(())
        } else {
            Err(VrfError::Verification(
                "The proof failed to verify for this public key".to_string(),
            ))
        }
    }
/// Given a [`Proof`] and an input, returns whether or not the proof is valid for the input
/// and public key
Given a [`Proof`] and an input, returns whether or not the proof is valid for the input
and public key
Given a [ ` Proof ` ] and an input returns whether or not the proof is valid for the input and public key
pub fn verify(&self, proof: &Proof, alpha: &[u8]) -> Result<(), VrfError> {
        let h_point = self.hash_to_curve(alpha);
        let pk_point = match CompressedEdwardsY::from_slice(self.as_bytes()).decompress() {
            Some(pt) => pt,
            None => {
                return Err(VrfError::Verification(
                    "Failed to decompress public key into Edwards point".to_string(),
                ))
            }
        };
        let cprime = hash_points(&[
            h_point,
            proof.gamma,
            ED25519_BASEPOINT_POINT * proof.s - pk_point * proof.c,
            h_point * proof.s - proof.gamma * proof.c,
        ]);
        if proof.c == cprime {
            Ok(())
        } else {
            Err(VrfError::Verification(
                "The proof failed to verify for this public key".to_string(),
            ))
        }
    }
pub fn verify ( & self , proof : & Proof , alpha : & [ u8 ] ) -> Result < ( ) , VrfError > { let h_point = self . hash_to_curve ( alpha ) ; let pk_point = match CompressedEdwardsY :: from_slice ( self . as_bytes ( ) ) . decompress ( ) { Some ( pt ) => pt , None => { return Err ( VrfError :: Verification ( " " . to_string ( ) , ) ) } } ; let cprime = hash_points ( & [ h_point , proof . gamma , ED25519_BASEPOINT_POINT * proof . s - pk_point * proof . c , h_point * proof . s - proof . gamma * proof . c , ] ) ; if proof . c == cprime { Ok ( ( ) ) } else { Err ( VrfError :: Verification ( " " . to_string ( ) , ) ) } }
Given a [`Proof`] and an input, returns whether or not the proof is valid for the input
and public key
Given a [ ` Proof ` ] and an input returns whether or not the proof is valid for the input and public key
&self
proof
&Proof
alpha
&[u8]
&self
proof
&Proof
alpha
&[u8]