ark_marlin/
error.rs

1use crate::ahp::Error as AHPError;
2
3/// A `enum` specifying the possible failure modes of the `SNARK`.
4#[derive(Debug)]
5pub enum Error<E> {
6    /// The index is too large for the universal public parameters.
7    IndexTooLarge,
8    /// There was an error in the underlying holographic IOP.
9    AHPError(AHPError),
10    /// There was an error in the underlying polynomial commitment.
11    PolynomialCommitmentError(E),
12}
13
14impl<E> From<AHPError> for Error<E> {
15    fn from(err: AHPError) -> Self {
16        Error::AHPError(err)
17    }
18}
19
20impl<E> Error<E> {
21    /// Convert an error in the underlying polynomial commitment scheme
22    /// to a `Error`.
23    pub fn from_pc_err(err: E) -> Self {
24        Error::PolynomialCommitmentError(err)
25    }
26}