[−][src]Crate cast5
CAST5 block cipher.
Implementation according to RFC 2144.
Usage example
use cast5::block_cipher::generic_array::GenericArray; use cast5::block_cipher::{BlockCipher, NewBlockCipher}; use cast5::Cast5; let key = GenericArray::from_slice(&[0u8; 16]); let mut block = GenericArray::clone_from_slice(&[0u8; 8]); // Initialize cipher let cipher = Cast5::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 block_cipher; |
Structs
Cast5 | The CAST5 block cipher. |
Traits
BlockCipher | The trait which defines in-place encryption and decryption over single block or several blocks in parallel. |