ever-crypto 0.1.0

A simple Rust library providing easy-to-use APIs for XChaCha20Poly1305 and Kyber1024 post-quantum cryptography at the same time. Based on chacha20poly1305 and pqcrypto-kyber.
Documentation
//! Ever Crypto - Simple cryptographic APIs for XChaCha20Poly1305 and Kyber1024
//! 
//! This library provides easy-to-use wrappers around:
//! - XChaCha20Poly1305: Authenticated encryption with extended nonce
//! - Kyber1024: Post-quantum key encapsulation mechanism

pub mod xchacha;
pub mod kyber;

// Re-export main types for convenience
pub use xchacha::{XChaChaCrypto, XChaChaKey, XChaChaNonce};
pub use kyber::{KyberCrypto, KyberKeyPair, KyberPublicKey, KyberSecretKey, KyberSharedSecret};

use thiserror::Error;

/// Common error types for the library
#[derive(Error, Debug)]
pub enum CryptoError {
    #[error("Encryption failed: {0}")]
    EncryptionError(String),
    
    #[error("Decryption failed: {0}")]
    DecryptionError(String),
    
    #[error("Invalid key length: expected {expected}, got {actual}")]
    InvalidKeyLength { expected: usize, actual: usize },
    
    #[error("Invalid nonce length: expected {expected}, got {actual}")]
    InvalidNonceLength { expected: usize, actual: usize },
    
    #[error("Random number generation failed")]
    RngError,
}

pub type Result<T> = std::result::Result<T, CryptoError>;