binius_ntt/
error.rs

1// Copyright 2024-2025 Irreducible Inc.
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5	#[error("codeword buffer must be at least 2**{log_code_len} elements")]
6	BufferTooSmall { log_code_len: usize },
7	#[error("field order must be at least 2**{log_domain_size}")]
8	FieldTooSmall { log_domain_size: usize },
9	#[error("domain size is less than 2**{log_required_domain_size}")]
10	DomainTooSmall { log_required_domain_size: usize },
11	#[error("evaluation subspace must include the 1 element")]
12	DomainMustIncludeOne,
13	#[error("the input length must be a power of two")]
14	PowerOfTwoLengthRequired,
15	#[error("the field extension degree must be a power of two")]
16	PowerOfTwoExtensionDegreeRequired,
17	#[error("the stride cannot be greater than the packed width")]
18	StrideGreaterThanPackedWidth,
19	#[error("the batch size is greater than the number of elements")]
20	BatchTooLarge,
21	#[error("the skip_rounds parameter exceeds the total number of NTT rounds")]
22	SkipRoundsTooLarge,
23	#[error("odd interpolation length mismatch, expected to be exactly {expected_len}")]
24	OddInterpolateIncorrectLength { expected_len: usize },
25	#[error("math error: {0}")]
26	MathError(#[from] binius_math::Error),
27}