use core::fmt;
use utils::string::String;
#[derive(Debug, PartialEq, Eq)]
pub enum VerifierError {
InconsistentBaseField,
UnsupportedFieldExtension(usize),
ProofDeserializationError(String),
RandomCoinError,
InconsistentOodConstraintEvaluations,
TraceQueryDoesNotMatchCommitment,
ConstraintQueryDoesNotMatchCommitment,
QuerySeedProofOfWorkVerificationFailed,
FriVerificationFailed(fri::VerifierError),
}
impl fmt::Display for VerifierError {
#[rustfmt::skip]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::InconsistentBaseField => {
write!(f, "base field of the proof does not match base field of the specified AIR")
}
Self::UnsupportedFieldExtension(degree) => {
write!(f, "field extension of degree {} is not supported for the proof base field", degree)
}
Self::ProofDeserializationError(msg) => {
write!(f, "proof deserialization failed: {}", msg)
}
Self::RandomCoinError => {
write!(f, "failed to draw a random value from a random coin")
}
Self::InconsistentOodConstraintEvaluations => {
write!(f, "constraint evaluations over the out-of-domain frame are inconsistent")
}
Self::TraceQueryDoesNotMatchCommitment => {
write!(f, "trace query did not match the commitment")
}
Self::ConstraintQueryDoesNotMatchCommitment => {
write!(f, "constraint query did not match the commitment")
}
Self::QuerySeedProofOfWorkVerificationFailed => {
write!(f, "query seed proof-of-work verification failed")
}
Self::FriVerificationFailed(err) => {
write!(f, "verification of low-degree proof failed: {}", err)
}
}
}
}