Rename hash selection enum to KeyedHash, restructure traits

This commit is contained in:
Jan Winkelmann (keks)
2025-02-24 12:42:49 +01:00
parent b94ddd980d
commit 32ae8f7051
12 changed files with 144 additions and 136 deletions

View File

@@ -0,0 +1,20 @@
pub trait KeyedHash<const KEY_LEN: usize, const HASH_LEN: usize> {
type Error;
fn keyed_hash(
key: &[u8; KEY_LEN],
data: &[u8],
out: &mut [u8; HASH_LEN],
) -> Result<(), Self::Error>;
}
pub trait KeyedHashInstance<const KEY_LEN: usize, const HASH_LEN: usize> {
type Error;
fn keyed_hash(
&self,
key: &[u8; KEY_LEN],
data: &[u8],
out: &mut [u8; HASH_LEN],
) -> Result<(), Self::Error>;
}