Archived
909c1577f1
- crates/ → engrams/ (Rust engrams live here) - bindings/ → receptors/ (cross-language access points into the graph) - Cargo.toml workspace paths updated
31 lines
747 B
Rust
31 lines
747 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum CryptoError {
|
|
#[error("Encryption failed: {0}")]
|
|
EncryptionFailed(String),
|
|
|
|
#[error("Decryption failed: {0}")]
|
|
DecryptionFailed(String),
|
|
|
|
#[error("Signature verification failed")]
|
|
SignatureInvalid,
|
|
|
|
#[error("Unknown algorithm ID: {0}")]
|
|
UnknownAlgorithm(String),
|
|
|
|
#[error("Key derivation failed: {0}")]
|
|
KeyDerivation(String),
|
|
|
|
#[error("Invalid key length: expected {expected}, got {got}")]
|
|
InvalidKeyLength { expected: usize, got: usize },
|
|
|
|
#[error("Algorithm not available: {0}")]
|
|
AlgorithmUnavailable(String),
|
|
|
|
#[error("Serialization error: {0}")]
|
|
Serialization(String),
|
|
}
|
|
|
|
pub type CryptoResult<T> = Result<T, CryptoError>;
|