firecloud-crypto 0.1.0

Encryption and key management for FireCloud distributed storage
Documentation
//! Crypto error types

use thiserror::Error;

#[derive(Error, Debug)]
pub enum CryptoError {
    #[error("Encryption failed: {0}")]
    Encryption(String),

    #[error("Decryption failed: {0}")]
    Decryption(String),

    #[error("Key derivation failed: {0}")]
    KeyDerivation(String),

    #[error("Invalid key size: expected {expected}, got {actual}")]
    InvalidKeySize { expected: usize, actual: usize },

    #[error("Invalid nonce size")]
    InvalidNonceSize,

    #[error("Signature verification failed")]
    SignatureVerification,

    #[error("Random number generation failed")]
    RandomGeneration,

    // Legacy aliases for backwards compatibility
    #[error("Encryption failed: {0}")]
    EncryptionFailed(String),

    #[error("Decryption failed: {0}")]
    DecryptionFailed(String),

    #[error("Invalid key length: expected {expected}, got {actual}")]
    InvalidKeyLength { expected: usize, actual: usize },

    #[error("Invalid nonce length")]
    InvalidNonceLength,
}

pub type CryptoResult<T> = Result<T, CryptoError>;