#[non_exhaustive]pub enum Error {
ParamsMismatch,
InvalidLength,
NonCanonicalField,
VerificationFailed,
}Expand description
The error type returned by crate::verify and the byte parsers.
Error is intentionally coarse-grained. Verification failure produces a
single Error::VerificationFailed variant regardless of which check
failed — this is by design, so that a verifier cannot reveal partial
information about why a forged signature was rejected. Parser-only errors
(length mismatch, non-canonical field element) carry their own variants so
honest callers can distinguish bad I/O from cryptographic failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ParamsMismatch
The Params supplied to crate::verify disagree with the public key
— typically because the verifier was given the wrong n_star.
InvalidLength
A serialised signature did not contain the leading K · 32 y-bytes,
or crate::verify was handed a crate::Signature whose
y_values.len() differs from Params::K. (The 36-byte public key
parser cannot fail with this — its input is a fixed-size array.)
NonCanonicalField
A 32-byte chunk of Signature::y_values did not decode to a canonical
Goldilocks-extension element (some 8-byte limb was ≥ the prime).
VerificationFailed
The signature failed verification. This is the catch-all cryptographic failure mode: it covers tampered y-values, malformed proofs, wrong messages, and any internal WHIR-level check that rejected.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more