Skip to main content

qudag_crypto/encryption/
mod.rs

1use std::error::Error;
2use std::fmt;
3
4/// Error type for encryption operations
5#[derive(Debug)]
6pub enum EncryptionError {
7    /// Error during key generation
8    KeyGenError(String),
9    /// Error during encryption
10    EncryptError(String),
11    /// Error during decryption
12    DecryptError(String),
13}
14
15impl fmt::Display for EncryptionError {
16    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17        match self {
18            EncryptionError::KeyGenError(msg) => write!(f, "Key generation error: {}", msg),
19            EncryptionError::EncryptError(msg) => write!(f, "Encryption error: {}", msg),
20            EncryptionError::DecryptError(msg) => write!(f, "Decryption error: {}", msg),
21        }
22    }
23}
24
25impl Error for EncryptionError {}
26
27// HQC module removed - use the main hqc module in crypto instead