Expand description
Pure Rust implementation of the Gift block cipher.
§⚠️ 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 gift_cipher::cipher::array::Array;
use gift_cipher::cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit};
use gift_cipher::Gift128;
let key = Array::from([0u8; 16]);
let mut block = Array::from([0u8; 16]);
// Initialize cipher
let cipher = Gift128::new(&key);
let block_copy = block;
// 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§
- Gift128
- Gift-128 block cipher instance.