binius_core/protocols/gkr_gpa/
error.rs

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