mirror of
https://github.com/kristoferssolo/cipher-workshop.git
synced 2025-12-31 13:52:29 +00:00
Add AesCbc struct with:
- CBC mode encryption with PKCS#7 padding
- CBC mode decryption with padding validation
- XOR chaining with IV for first block
- Expose encrypt_block/decrypt_block as pub(crate)
24 lines
505 B
Rust
24 lines
505 B
Rust
//! AES (Advanced Encryption Standard) implementation.
|
|
//!
|
|
//! Provides AES-128 block cipher with 128-bit keys and blocks.
|
|
//!
|
|
//! # Example
|
|
//! ```
|
|
//! use aes::Aes;
|
|
//! use cipher_core::BlockCipher;
|
|
//!
|
|
//! let cipher = Aes::new(0x2b7e1516_28aed2a6_abf71588_09cf4f3c_u128);
|
|
//! let ciphertext = cipher.encrypt(&[0u8; 16]).unwrap();
|
|
//! ```
|
|
|
|
mod aes;
|
|
mod block;
|
|
mod cbc;
|
|
mod constants;
|
|
mod iv;
|
|
mod key;
|
|
mod operations;
|
|
mod sbox;
|
|
|
|
pub use {aes::Aes, block::Block32, block::Block128, cbc::AesCbc, iv::Iv};
|