#[derive(Debug, Clone, PartialEq, Eq)]
pub enum EyvaraError {
MalformedProof,
MalformedPublicKey,
HintWeightExceeded,
NormBoundExceeded,
ChallengeMismatch,
OutputMismatch,
RejectionSamplingFailed,
}
impl std::fmt::Display for EyvaraError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::MalformedProof => write!(f, "malformed proof"),
Self::MalformedPublicKey => write!(f, "malformed public key"),
Self::HintWeightExceeded => write!(f, "hint weight exceeded omega"),
Self::NormBoundExceeded => write!(f, "response norm exceeded bound"),
Self::ChallengeMismatch => write!(f, "Fiat-Shamir challenge mismatch"),
Self::OutputMismatch => write!(f, "VRF output does not match proof"),
Self::RejectionSamplingFailed => {
write!(f, "rejection sampling failed after max attempts")
}
}
}
}
impl std::error::Error for EyvaraError {}