Skip to main content

Module error

Module error 

Source
Expand description

Unified error type for cryptographic operations.

All fallible operations in this crate return Result<T>, which is std::result::Result<T, CryptoError>.

§Error categories

VariantWhen it occurs
CryptoError::InvalidKeyLengthKey bytes are wrong size for the algorithm
CryptoError::InvalidKeyKey is malformed or fails validation
CryptoError::InvalidNonceLengthNonce bytes are wrong size
CryptoError::AuthenticationFailedSignature or AEAD tag verification failed
CryptoError::EncryptionEncryption failed (rare — usually a bug)
CryptoError::DecryptionDecryption failed (ciphertext tampered, wrong key, etc.)
CryptoError::KdfKey derivation failed (bad params, Argon2 failure, etc.)
CryptoError::PqcPost-quantum primitive failed
CryptoError::ReedSolomonError correction encode/decode failed
CryptoError::InvalidParameterInvalid input parameter (empty seed, expired handle, etc.)
CryptoError::IoUnderlying I/O error
CryptoError::SerializationSerialization or deserialization failed
CryptoError::CompressionCompression or decompression failed

Enums§

CryptoError
Unified error type for cryptographic operations.

Type Aliases§

Result
Result alias for all fallible operations in this crate.