fluxencrypt_async/lib.rs
1//! # FluxEncrypt Async
2//!
3//! Async/await support for the FluxEncrypt encryption SDK, providing non-blocking
4//! encryption and decryption operations suitable for high-concurrency applications.
5//!
6//! ## Features
7//!
8//! - **Async Encryption/Decryption**: Non-blocking hybrid encryption operations
9//! - **Streaming Support**: Process large files asynchronously without blocking
10//! - **Concurrent Processing**: Handle multiple operations simultaneously
11//! - **Tokio Integration**: Full compatibility with the Tokio async runtime
12//!
13//! ## Quick Start
14//!
15//! ```rust,no_run
16//! use fluxencrypt_async::{AsyncHybridCipher, Config};
17//! use fluxencrypt::keys::KeyPair;
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
21//! // Generate a new key pair
22//! let keypair = KeyPair::generate(2048)?;
23//!
24//! // Create async cipher
25//! let cipher = AsyncHybridCipher::new(Config::default());
26//!
27//! // Encrypt data asynchronously
28//! let plaintext = b"Hello, async FluxEncrypt!";
29//! let ciphertext = cipher.encrypt_async(&keypair.public_key(), plaintext).await?;
30//!
31//! // Decrypt data asynchronously
32//! let decrypted = cipher.decrypt_async(&keypair.private_key(), &ciphertext).await?;
33//! assert_eq!(plaintext, &decrypted[..]);
34//!
35//! Ok(())
36//! }
37//! ```
38
39#![deny(missing_docs)]
40#![deny(unsafe_code)]
41#![warn(clippy::all)]
42#![allow(clippy::result_large_err)]
43#![warn(rust_2018_idioms)]
44
45pub mod futures;
46pub mod tokio;
47
48// Re-export commonly used types
49pub use crate::tokio::AsyncHybridCipher;
50pub use fluxencrypt::Config;
51
52/// Current version of the FluxEncrypt Async library
53pub const VERSION: &str = env!("CARGO_PKG_VERSION");