pub enum PolynomialError {
InvalidModulus(u64),
DegreeOverflow {
requested: usize,
max_degree: usize,
},
IncompatiblePolynomials,
ProductDegreeOverflow {
degree: usize,
max_degree: usize,
},
NttLengthMustBePowerOfTwo(usize),
NttLengthUnsupported {
length: usize,
modulus: u64,
},
InvalidPrimitiveRoot {
primitive_root: u64,
length: usize,
modulus: u64,
},
DivisionByZeroPolynomial,
NonInvertibleCoefficient {
coefficient: u64,
modulus: u64,
},
}Expand description
Errors returned by polynomial operations.
Variants§
InvalidModulus(u64)
The modulus must be at least 2.
DegreeOverflow
Input coefficients requested a degree that exceeds max_degree.
IncompatiblePolynomials
Polynomials are incompatible (different degree bounds or moduli).
ProductDegreeOverflow
Multiplication produced a degree higher than max_degree.
NttLengthMustBePowerOfTwo(usize)
NTT requires a non-zero power-of-two transform length.
NttLengthUnsupported
NTT length is not supported by the chosen modulus.
InvalidPrimitiveRoot
Provided primitive root cannot generate a valid root of unity for the transform length.
DivisionByZeroPolynomial
Division by the zero polynomial is undefined.
NonInvertibleCoefficient
A required multiplicative inverse does not exist under the modulus.
Trait Implementations§
Source§impl Clone for PolynomialError
impl Clone for PolynomialError
Source§fn clone(&self) -> PolynomialError
fn clone(&self) -> PolynomialError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolynomialError
impl Debug for PolynomialError
Source§impl Display for PolynomialError
impl Display for PolynomialError
Source§impl Error for PolynomialError
impl Error for PolynomialError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for PolynomialError
impl PartialEq for PolynomialError
impl Eq for PolynomialError
impl StructuralPartialEq for PolynomialError
Auto Trait Implementations§
impl Freeze for PolynomialError
impl RefUnwindSafe for PolynomialError
impl Send for PolynomialError
impl Sync for PolynomialError
impl Unpin for PolynomialError
impl UnwindSafe for PolynomialError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more