fn verify()

in akd_client/src/ecvrf.rs [103:129]


    fn verify(&self, proof: &Proof, alpha: &[u8]) -> Result<(), VerificationError> {
        let h_point = self.hash_to_curve(alpha);
        let pk_point = match CompressedEdwardsY::from_slice(self.0.as_bytes()).decompress() {
            Some(pt) => pt,
            None => {
                return Err(VerificationError::build(
                    Some(VerificationErrorType::Vrf),
                    Some("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(VerificationError::build(
                Some(VerificationErrorType::Vrf),
                Some("The proof failed to verify for this public key".to_string()),
            ))
        }
    }