snarkvm_algorithms/
errors.rsuse crate::{r1cs::SynthesisError, snark::varuna::ahp::AHPError};
use snarkvm_fields::ConstraintFieldError;
#[derive(Debug, Error)]
pub enum SNARKError {
#[error("{}", _0)]
AnyhowError(#[from] anyhow::Error),
#[error("{}", _0)]
ConstraintFieldError(#[from] ConstraintFieldError),
#[error("{}: {}", _0, _1)]
Crate(&'static str, String),
#[error("Expected a circuit-specific SRS in SNARK")]
ExpectedCircuitSpecificSRS,
#[error("{}", _0)]
Message(String),
#[error("{}", _0)]
SynthesisError(#[from] SynthesisError),
#[error("Batch size was zero; must be at least 1")]
EmptyBatch,
#[error("Batch size was different between public input and proof")]
BatchSizeMismatch,
#[error("Public input size was different from the circuit")]
PublicInputSizeMismatch,
#[error("Circuit not found")]
CircuitNotFound,
}
impl From<AHPError> for SNARKError {
fn from(err: AHPError) -> Self {
SNARKError::Crate("AHPError", format!("{err:?}"))
}
}