pub enum CryptoError {
InvalidKey,
InvalidNonce,
InvalidTag,
BufferTooSmall,
BadInput,
Internal(&'static str),
Kex,
Sign,
Rng,
Encoding,
UnsupportedAlgorithm,
}Expand description
Unified error type for all OxiCrypto operations.
Variants§
InvalidKey
Supplied key has wrong length or is otherwise invalid.
InvalidNonce
Supplied nonce/IV has wrong length or is otherwise invalid.
InvalidTag
Authentication tag verification failed (AEAD open / MAC verify).
BufferTooSmall
Output buffer is too small for the requested operation.
BadInput
General bad-input condition (e.g. zero-length KDF output requested).
Internal(&'static str)
An internal or backend error with a static message.
Serde note: When deserializing, the &'static str payload cannot
be reconstructed from arbitrary data in a no_std + alloc crate.
The variant is deserialized as Internal("") — the serialized form
preserves the string for observability/logging; round-trip lossiness
is intentional.
Kex
Key-exchange or encapsulation/decapsulation failure (e.g. ML-KEM).
Sign
Signature generation or verification failure (e.g. ML-DSA).
Rng
RNG-specific failure (e.g. getrandom unavailable).
Encoding
Encoding / decoding failure (DER, PEM, SEC1, etc.).
UnsupportedAlgorithm
Requested algorithm is not compiled-in or not supported at runtime.
Trait Implementations§
Source§impl Clone for CryptoError
impl Clone for CryptoError
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
impl Display for CryptoError
impl Eq for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
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()