pub enum SlhDsaError {
RngFailure,
InvalidKey,
InvalidSignature,
VerificationFailed,
FaultDetected,
}Expand description
Errors that can occur in SLH-DSA operations.
These errors cover failures in random number generation, malformed keys or signatures, and verification mismatches. All variants are non-recoverable in the sense that retrying with the same inputs will produce the same error.
Variants§
RngFailure
The cryptographic random number generator failed to produce bytes.
This typically indicates an OS-level failure (e.g., /dev/urandom unavailable).
InvalidKey
The provided key has an invalid format or unexpected length.
Public keys must be 2*n bytes and secret keys 4*n bytes, where n is the
security parameter (Params::N).
InvalidSignature
The provided signature has an invalid format or unexpected length.
Signatures must be exactly SlhDsa::signature_size bytes for the chosen parameter set.
VerificationFailed
The signature did not verify against the given message and public key.
FaultDetected
Signing-side fault redundancy detected a mismatch between the two
independent signing runs (item T1-C of the SLH-DSA SCA roadmap).
Gated by the sca-fors-redundancy cargo feature, the signer
produces the FORS signature twice and aborts before emission if
the two results disagree — single-fault grafting-tree forgeries
(Castelnovi 2018, Adiletta 2025) cannot then propagate out of
the device. The error is non-recoverable; a retry on the same
inputs will either succeed (the fault was transient) or surface
the same error again.
Trait Implementations§
Source§impl Clone for SlhDsaError
impl Clone for SlhDsaError
Source§fn clone(&self) -> SlhDsaError
fn clone(&self) -> SlhDsaError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SlhDsaError
impl Debug for SlhDsaError
Source§impl Display for SlhDsaError
impl Display for SlhDsaError
Source§impl Error for SlhDsaError
Available on crate feature std only.
impl Error for SlhDsaError
std only.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()