eme2 0.1.3

EME2 (ECB-Mask-ECB) wide-block cipher mode of operation
Documentation
//! Generic implementation of [EME2 mode][1] for block ciphers.
//!
//! [![Docs](https://docs.rs/eme2/badge.svg)](https://docs.rs/eme2/)
//!
//! Mode functionality is accessed using traits from re-exported [`cipher`] crate.
//! EME2 (ECB-Mask-ECB) is a wide-block cipher mode of operation that acts as a 
//! Strong Pseudorandom Permutation (SPRP).
//!
//! # ⚠️ Security Warning: Hazmat!
//!
//! This crate does not ensure ciphertexts are authentic! Thus ciphertext integrity
//! is not verified, which can lead to serious vulnerabilities!
//! It is highly recommended to use EME2 in combination with a strong MAC 
//! (like BLAKE3) to provide robust authenticated encryption.
//!
//! # Migrating from Stream Ciphers (e.g., CTR Mode)
//! 
//! Because `eme2` strictly implements RustCrypto's `KeyIvInit` traits, instantiating the cipher 
//! is a 1:1 drop-in replacement for stream ciphers like `ctr`. However, **execution differs**:
//! 
//! *   **Stream Ciphers (CTR):** Encryption and decryption are mathematically identical, so they use the `StreamCipher` trait and expose `.apply_keystream(&mut data)`.
//! *   **Wide-Block Ciphers (EME2):** Encryption and decryption are asymmetric. Thus, EME2 does not implement `StreamCipher` and instead exposes explicit `.encrypt(&mut data)` and `.decrypt(&mut data)` methods.
//!
//! # Example
//! ```
//! use aes::cipher::KeyIvInit;
//! use eme2::Eme2;
//! use hex_literal::hex;
//!
//! type Aes128Eme2 = Eme2<aes::Aes128>;
//!
//! let key = [0x42; 16];
//! let tweak = [0x24; 16];
//! let plaintext = *b"hello world! this is my plaintext! it needs to be longer.";
//!
//! // encrypt in-place
//! let mut buf = plaintext.to_vec();
//! let cipher = Aes128Eme2::new(&key.into(), &tweak.into());
//! cipher.encrypt(&mut buf).unwrap();
//!
//! assert_ne!(buf[..], plaintext[..]);
//!
//! // decrypt in-place
//! cipher.decrypt(&mut buf).unwrap();
//! assert_eq!(buf[..], plaintext[..]);
//! ```
//!
//! [1]: https://ieeexplore.ieee.org/servlet/opac?punumber=11277321

#![no_std]
#![forbid(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_debug_implementations, missing_docs, rust_2018_idioms)]

mod eme2;

pub use cipher;
pub use crate::eme2::{Eme2, Error};