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