Skip to main content

sigma_proof_compiler/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum SigmaProofError {
5    #[error("SymScalar is not instantiated (contains Var(None))")]
6    UninstantiatedScalar,
7
8    #[error("SymPoint is not instantiated (contains Var(None))")]
9    UninstantiatedPoint,
10
11    #[error("Failed to deserialize SymWitness: insufficient scalars provided")]
12    InsufficientScalars,
13
14    #[error("Failed to deserialize SymInstance: insufficient points provided")]
15    InsufficientPoints,
16
17    #[error("Failed to deserialize SymWitness: too many scalars provided (expected {expected}, got {actual})")]
18    TooManyScalars { expected: usize, actual: usize },
19
20    #[error("Field '{field}' failed to deserialize")]
21    FieldDeserializationFailed { field: String },
22
23    #[error("Proof verification failed: equation check failed")]
24    EquationCheckFailed,
25
26    #[error("Issue with proof parameters: psi output length != f output length")]
27    PsiOutputLengthMismatch,
28
29    #[error("There are leftover bytes in the proof")]
30    TranscriptFinalizationFailed,
31
32    #[error("Transcript error")]
33    TranscriptError,
34
35    #[error("Invalid scalar values")]
36    InvalidScalarValues,
37}
38
39pub type SigmaProofResult<T> = Result<T, SigmaProofError>;