pub enum Error {
SigningFailed,
InvalidFormat,
VerificationFailed,
}Available on crate feature
sign only.Expand description
Errors that can occur during SWing signing or verification.
All variants implement core::fmt::Display for ergonomic error propagation.
§Example
use b_wing::{SWing, SignError};
let bad_vk = vec![0u8; 10]; // wrong size
assert_eq!(
SWing::verify(&bad_vk, b"msg", b"ctx", &vec![0u8; SWing::SIGNATURE_SIZE]),
Err(SignError::InvalidFormat),
);Variants§
SigningFailed
One of the three underlying signing primitives returned an error.
This is unexpected under normal operation; it may indicate an issue
with the caller-supplied random_seed or an upstream library fault.
InvalidFormat
A key, signature, or seed was the wrong length or could not be parsed.
Expected sizes: SWing::VERIFICATION_KEY_SIZE and SWing::SIGNATURE_SIZE.
VerificationFailed
The composite signature failed cryptographic verification.
This is returned as soon as any sub-signature fails; the remaining layers are not evaluated (fail-fast behaviour).
Trait Implementations§
impl Copy for Error
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
Mutably borrows from an owned value. Read more