mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 22:43:26 -08:00
dev(cipher-traits): add KeyedHash(Instance) traits
This commit is contained in:
13
cipher-traits/src/keyed_hash.rs
Normal file
13
cipher-traits/src/keyed_hash.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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 KeyType;
|
||||||
|
type OutputType;
|
||||||
|
type Error;
|
||||||
|
|
||||||
|
fn keyed_hash(&self, key: &[u8; KEY_LEN], data: &[u8], out: &mut [u8; HASH_LEN]) -> Result<(), Self::Error>;
|
||||||
|
}
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
mod kem;
|
mod kem;
|
||||||
|
mod keyed_hash;
|
||||||
pub use kem::Kem;
|
pub use kem::Kem;
|
||||||
|
pub use keyed_hash::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user