Expand description
Pure Rust implementation of the CAST6 block cipher (RFC 2612).
§⚠️ Security Warning: Hazmat!
This crate implements only the low-level block cipher function, and is intended for use for implementing higher-level constructions only. It is NOT intended for direct use in applications.
USE AT YOUR OWN RISK!
§Examples
use cast6::cipher::generic_array::GenericArray;
use cast6::cipher::{Key, Block, BlockEncrypt, BlockDecrypt, KeyInit};
use cast6::Cast6;
let key = GenericArray::from([0u8; 32]);
let mut block = GenericArray::from([0u8; 16]);
// Initialize cipher
let cipher = Cast6::new(&key);
let block_copy = block.clone();
// Encrypt block in-place
cipher.encrypt_block(&mut block);
// And decrypt it back
cipher.decrypt_block(&mut block);
assert_eq!(block, block_copy);
Re-exports§
pub use cipher;
Structs§
- The CAST6 block cipher.