From bd60133585036cbbc2b7bc813a9e5a00a1c54f4a Mon Sep 17 00:00:00 2001 From: mghazwi Date: Thu, 14 May 2026 14:46:54 +0200 Subject: [PATCH] adjust tests primitives and update README.md --- README.md | 12 +++++------- tests/lioness.rs | 8 ++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 46cfda0..8714f43 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ Use a 32-byte master key and encrypt or decrypt a block in place: use rand_core::{OsRng, RngCore}; use lioness_blockcipher::prelude::*; type TestLioness = Lioness::< - ChaCha20StreamCipher, - KeyedBlake2b, - TurboShake128Kdf + Aes128CtrStreamCipher, + Sha256PrependKey, + DomSepSha256Kdf, >; fn main() -> anyhow::Result<()> { @@ -69,7 +69,5 @@ Some notes: ### TODO - [x] Add more tests, examples, and benchmarks ... - [x] Make it generic for any compatible cipher, keyed_hash, and KDF. -- [ ] Compare with existing implementation + maybe with Haskel when available. -- [x] Add function which prepend the plaintext with k-zeros and checks authenticity after decryption. -- [ ] impl enc and dec to the API to work beside encrypt_in_place and decrypt_in_place. -- ... +- [x] Compare with existing Haskel implementation. +- [x] Add authenticated encryption and decryption which prepend the plaintext with k-zeros and checks authenticity after decryption. diff --git a/tests/lioness.rs b/tests/lioness.rs index cdfb9d2..58fc4db 100644 --- a/tests/lioness.rs +++ b/tests/lioness.rs @@ -3,13 +3,13 @@ mod tests { use rand_core::{OsRng, RngCore}; use lioness_blockcipher::cipher::Aes128CtrStreamCipher; use lioness_blockcipher::kdf::DomSepSha256Kdf; - use lioness_blockcipher::keyed_hash::HmacSha256KeyedHash; + use lioness_blockcipher::keyed_hash::Sha256PrependKey; use lioness_blockcipher::prelude::*; type TestLioness = Lioness::< Aes128CtrStreamCipher, - HmacSha256KeyedHash, - DomSepSha256Kdf - >; + Sha256PrependKey, + DomSepSha256Kdf, + >; fn get_test_key() -> Key256 { let mut key: Key256 = Default::default(); OsRng.fill_bytes(&mut key);