dcrypt_symmetric/
lib.rs

1//! Symmetric encryption algorithms for the dcrypt library
2//!
3//! This crate provides high-level symmetric encryption algorithms built on top of
4//! the primitives in dcrypt-primitives and uses the unified API error system.
5
6#![cfg_attr(not(feature = "std"), no_std)]
7#![forbid(unsafe_code)]
8
9#[cfg(not(feature = "std"))]
10extern crate alloc;
11
12pub mod aead;
13pub mod aes;
14pub mod cipher;
15pub mod error;
16pub mod streaming;
17
18// Re-export main types for convenience
19pub use aead::chacha20poly1305::{
20    derive_chacha20poly1305_key, generate_salt, ChaCha20Poly1305Cipher,
21    ChaCha20Poly1305CiphertextPackage, ChaCha20Poly1305Key, ChaCha20Poly1305Nonce,
22    XChaCha20Poly1305Cipher, XChaCha20Poly1305Nonce,
23};
24pub use aead::gcm::{Aes128Gcm, Aes256Gcm, AesCiphertextPackage, GcmNonce};
25pub use aes::{Aes128Key, Aes256Key};
26pub use cipher::{Aead, SymmetricCipher};
27
28// Re-export the API error system instead of custom error types
29pub use dcrypt_api::error::{Error, Result};
30
31// Re-export commonly used validation and error handling utilities
32pub use dcrypt_api::error::{validate, ResultExt, SecureErrorHandling, ERROR_REGISTRY};