1#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum EyvaraError {
6 MalformedProof,
8 MalformedPublicKey,
10 HintWeightExceeded,
12 NormBoundExceeded,
14 ChallengeMismatch,
16 OutputMismatch,
18 RejectionSamplingFailed,
20}
21
22impl std::fmt::Display for EyvaraError {
23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24 match self {
25 Self::MalformedProof => write!(f, "malformed proof"),
26 Self::MalformedPublicKey => write!(f, "malformed public key"),
27 Self::HintWeightExceeded => write!(f, "hint weight exceeded omega"),
28 Self::NormBoundExceeded => write!(f, "response norm exceeded bound"),
29 Self::ChallengeMismatch => write!(f, "Fiat-Shamir challenge mismatch"),
30 Self::OutputMismatch => write!(f, "VRF output does not match proof"),
31 Self::RejectionSamplingFailed => {
32 write!(f, "rejection sampling failed after max attempts")
33 }
34 }
35 }
36}
37
38impl std::error::Error for EyvaraError {}