snarkvm_algorithms/polycommit/
error.rs#[derive(Debug, Error)]
pub enum PCError {
#[error("{0}")]
AnyhowError(#[from] anyhow::Error),
#[error("QuerySet` refers to polynomial \"{label}\", but it was not provided.")]
MissingPolynomial {
label: String,
},
#[error("`QuerySet` refers to polynomial \"{label}\", but `Evaluations` does not contain an evaluation for it.")]
MissingEvaluation {
label: String,
},
#[error("The provided polynomial was meant to be hiding, but `rng` was `None`.")]
MissingRng,
#[error("The degree provided in setup was too small; degree 0 polynomials are not supported.")]
DegreeIsZero,
#[error(
"the number of coefficients in the polynomial ({num_coefficients:?}) is greater than \
the maximum number of powers in `Powers` ({num_powers:?})"
)]
TooManyCoefficients {
num_coefficients: usize,
num_powers: usize,
},
#[error("The hiding bound was not `None`, but the hiding bound was zero.")]
HidingBoundIsZero,
#[error(
"the degree of the hiding poly ({hiding_poly_degree:?}) is not less than the maximum number of powers in `Powers` ({num_powers:?})"
)]
HidingBoundToolarge {
hiding_poly_degree: usize,
num_powers: usize,
},
#[error("The lagrange basis is not a power of two.")]
LagrangeBasisSizeIsNotPowerOfTwo,
#[error("The lagrange basis is larger than the supported degree.")]
LagrangeBasisSizeIsTooLarge,
#[error("The degree provided to `trim` was too large.")]
TrimmingDegreeTooLarge,
#[error("the equation \"{0}\" contained degree-bounded polynomials")]
EquationHasDegreeBounds(String),
#[error("the degree bound ({0}) is not supported by the parameters")]
UnsupportedDegreeBound(usize),
#[error("the Lagrange basis size ({0}) is not supported by the parameters")]
UnsupportedLagrangeBasisSize(usize),
#[error(
"the degree bound ({degree_bound}) for the polynomial {label} \
(having degree {poly_degree}) is greater than the maximum degree ({max_degree})"
)]
IncorrectDegreeBound {
poly_degree: usize,
degree_bound: usize,
max_degree: usize,
label: String,
},
}