pub enum SigError {
Show 15 variants
KeyGeneration(String),
Signing(String),
VerificationFailed,
InvalidPublicKey(String),
InvalidSecretKey(String),
InvalidSignature(String),
Base64Decode(String),
Serialization(String),
AlgorithmNotAvailable {
name: String,
feature: String,
},
HybridClassicalFailed,
HybridPqcFailed,
Internal(String),
ContextTooLong {
len: usize,
},
InvalidDigestLength {
hash: &'static str,
expected: usize,
got: usize,
},
PreHashTooWeak {
hash: &'static str,
strength: u32,
algorithm: &'static str,
required: u32,
},
}Expand description
Canonical algorithm-labelled signature transport types supplied by
pqc-sig. They are representations and encoders only; this SDK continues
to perform signing and verification through its embedded aethel-core
component.
Errors that can occur during signature operations.
Variants§
KeyGeneration(String)
Key generation failed (e.g., RNG failure).
Signing(String)
Signing operation failed.
VerificationFailed
Signature verification failed (signature is invalid for the given message/key).
InvalidPublicKey(String)
Invalid public key (wrong size, wrong algorithm tag, or malformed).
InvalidSecretKey(String)
Invalid secret key (wrong size, wrong algorithm tag, or malformed).
InvalidSignature(String)
Invalid signature (wrong size, wrong algorithm tag, or malformed).
Base64Decode(String)
Base64 decoding error.
Serialization(String)
JSON serialization/deserialization error.
AlgorithmNotAvailable
The requested algorithm is not available (feature not enabled).
HybridClassicalFailed
Hybrid signature verification failed on the classical (Ed25519) side.
HybridPqcFailed
Hybrid signature verification failed on the post-quantum (ML-DSA) side.
Internal(String)
Generic internal error.
ContextTooLong
Domain-separation context string exceeds the FIPS 204/205/206 255-byte maximum.
FIPS 204 §5.2, FIPS 205 §10.2, and the FIPS 206 (draft) DomainContext construction
all encode the context length in a single byte, capping it at 255 bytes. Returned by
every sign_ctx/sign_ctx_deterministic/verify_ctx method before it would
otherwise hit an opaque error from the underlying ml-dsa/slh-dsa/fn-dsa crate.
InvalidDigestLength
Pre-hash digest length does not match the expected output size of the named hash function (FIPS 204 §5.4.1 / FIPS 205 §10.2.2).
Returned by every sign_prehash/sign_prehash_deterministic/verify_prehash
method before it would otherwise sign/verify a malformed digest.
PreHashTooWeak
Pre-hash collision strength is weaker than the signature algorithm’s required security strength (FIPS 204 §5.4 / FIPS 205 §10.2.2).
For example, PreHash::Sha256 (128-bit collision strength) is rejected for
MlDsa65Keypair/MlDsa87Keypair (192/256-bit security strength).
Implementations§
Trait Implementations§
Source§impl Error for SigError
impl Error for SigError
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 StructuralPartialEq for SigError
Auto Trait Implementations§
impl Freeze for SigError
impl RefUnwindSafe for SigError
impl Send for SigError
impl Sync for SigError
impl Unpin for SigError
impl UnsafeUnpin for SigError
impl UnwindSafe for SigError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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