use thiserror::Error;
#[derive(Error, Debug)]
pub enum CryptoError {
#[error("encryption key not found: {0:016x}")]
KeyNotFound(u64),
#[error("invalid key format: {0}")]
InvalidKeyFormat(String),
#[error("invalid key size: expected {expected}, got {actual}")]
InvalidKeySize { expected: usize, actual: usize },
#[error("invalid IV size: expected {expected}, got {actual}")]
InvalidIvSize { expected: usize, actual: usize },
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("invalid key file format: {0}")]
InvalidKeyFile(String),
#[error("decryption failed: {0}")]
DecryptionFailed(String),
#[error("invalid block index: {0}")]
InvalidBlockIndex(usize),
#[error("invalid parameter: {0}")]
InvalidParameter(String),
#[error("initialization failed: {0}")]
InitializationFailed(String),
}