binius_core/protocols/gkr_gpa/
error.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3use super::gpa_sumcheck::error::Error as GPASumcheckError;
4use crate::{
5	polynomial::Error as PolynomialError, protocols::sumcheck::Error as SumcheckError,
6	witness::Error as WitnessErrror,
7};
8
9#[derive(Debug, thiserror::Error)]
10pub enum Error {
11	#[error("prover has mismatch between claim and witness")]
12	ProverClaimWitnessMismatch,
13	#[error("circuit evals and claim disagree on final product")]
14	MismatchBetweenCircuitEvalsAndClaim,
15	#[error("advice circuit evals has incorrect structure")]
16	InvalidCircuitEvals,
17	#[error("number of batch layer proofs does not match maximum claim n_vars")]
18	MismatchedClaimsAndProofs,
19	#[error("witneses and claims have mismatched lengths")]
20	MismatchedWitnessClaimLength,
21	#[error("empty claims array")]
22	EmptyClaimsArray,
23	#[error("too many rounds")]
24	TooManyRounds,
25	#[error("finalize called prematurely")]
26	PrematureFinalize,
27	#[error("all layer claims in a batch should be for the same layer")]
28	MismatchedEvalPointLength,
29	#[error("the output layer cannot be split into halves")]
30	CannotSplitOutputLayerIntoHalves,
31	#[error("the inputted layer index was too high")]
32	InvalidLayerIndex,
33	#[error("metas length does not conform to the provided indexed claims")]
34	MetasClaimMismatch,
35	#[error("metas length does not conform to the provided indexed claims")]
36	MetasProductsMismatch,
37	#[error("polynomial error: {0}")]
38	Polynomial(#[from] PolynomialError),
39	#[error("gpa sumcheck failure: {0}")]
40	GPASumcheckError(#[from] GPASumcheckError),
41	#[error("sumcheck failure: {0}")]
42	SumcheckError(#[from] SumcheckError),
43	#[error("witness failure: {0}")]
44	WitnessErrror(#[from] WitnessErrror),
45	#[error("HAL error: {0}")]
46	HalError(#[from] binius_hal::Error),
47	#[error("Math error: {0}")]
48	MathError(#[from] binius_math::Error),
49}