1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use core::{
fmt::Display,
fmt::{self, Debug},
};
#[derive(Debug, Default)]
pub enum ProofVerifyError {
#[default]
InternalError,
DecompressionError([u8; 32]),
}
impl Display for ProofVerifyError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &self {
ProofVerifyError::DecompressionError(bytes) => write!(
f,
"Compressed group element failed to decompress: {bytes:?}",
),
ProofVerifyError::InternalError => {
write!(f, "Proof verification failed",)
}
}
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum R1CSError {
NonPowerOfTwoCons,
NonPowerOfTwoVars,
InvalidNumberOfInputs,
InvalidNumberOfVars,
InvalidScalar,
InvalidIndex,
}