#[non_exhaustive]pub enum CryptoError {
SrpBadParameters(&'static str),
SrpProofMismatch,
Encoding(&'static str),
Tlv(Tlv8Error),
Kdf(&'static str),
Aead,
Signature,
}Expand description
All failure modes of hap-crypto.
Only the variants needed by the current implementation chunk are present;
the enum is #[non_exhaustive] so further variants can be added later.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SrpBadParameters(&'static str)
An SRP-6a parameter was rejected: a public key was zero mod N (an
A == 0 / B == 0 abort per RFC 5054), or a field had an invalid
length for the active group.
SrpProofMismatch
An SRP proof failed to verify (the peer’s M2 did not match the value
computed locally), or the scrambling parameter u was zero — both are
SRP-6a abort conditions.
Encoding(&'static str)
A value could not be encoded to, or decoded from, its wire byte form (e.g. a big-endian field that did not fit its fixed length).
Tlv(Tlv8Error)
A response TLV8 body could not be decoded.
Kdf(&'static str)
HKDF key derivation failed (the requested output length exceeded the
HKDF-SHA512 maximum of 255 * 64 bytes).
Aead
ChaCha20-Poly1305 authenticated encryption or decryption failed: a tag mismatch on decrypt (wrong key or tampered ciphertext/AAD), or an encryption-time usage error.
Signature
An Ed25519 signature failed to verify, or a public key / signature was malformed (e.g. not a valid curve point).
Trait Implementations§
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
impl Display for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
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()