mirror of
https://github.com/logos-storage/lioness_blockcipher.git
synced 2026-05-18 18:49:28 +00:00
fix domain separation and use simple primitives in examples.
This commit is contained in:
parent
9ff3fa3b49
commit
36b1269475
@ -1,12 +1,15 @@
|
||||
use anyhow::Result;
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use lioness_blockcipher::cipher::Aes128CtrStreamCipher;
|
||||
use lioness_blockcipher::kdf::DomSepSha256Kdf;
|
||||
use lioness_blockcipher::keyed_hash::Sha256PrependKey;
|
||||
use lioness_blockcipher::lioness::SEC_PARAM;
|
||||
use lioness_blockcipher::prelude::*;
|
||||
|
||||
type TestLioness = Lioness::<
|
||||
ChaCha20StreamCipher,
|
||||
KeyedBlake2b,
|
||||
TurboShake128Kdf
|
||||
Aes128CtrStreamCipher,
|
||||
Sha256PrependKey,
|
||||
DomSepSha256Kdf,
|
||||
>;
|
||||
|
||||
fn prepend_before_enc() -> Result<()>{
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use lioness_blockcipher::cipher::Aes128CtrStreamCipher;
|
||||
use lioness_blockcipher::kdf::DomSepSha256Kdf;
|
||||
use lioness_blockcipher::keyed_hash::Sha256PrependKey;
|
||||
use lioness_blockcipher::prelude::*;
|
||||
type TestLioness = Lioness::<
|
||||
ChaCha20StreamCipher,
|
||||
KeyedBlake2b,
|
||||
TurboShake128Kdf
|
||||
Aes128CtrStreamCipher,
|
||||
Sha256PrependKey,
|
||||
DomSepSha256Kdf,
|
||||
>;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
|
||||
@ -63,7 +63,7 @@ const LIONESS_ROUND_KEY_DOMAINS: [&[u8]; 4] = [
|
||||
b"lioness-key1",
|
||||
b"lioness-key2",
|
||||
b"lioness-key3",
|
||||
b"lionesskey4",
|
||||
b"lioness-key4",
|
||||
];
|
||||
impl LionessKdf for DomSepSha256Kdf {
|
||||
fn derive_keys(master_key: &Key256) -> anyhow::Result<RoundKeys> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user