HMAC: only 32 byte keys (#424)

* only support HMAC with 32 byte keys

* includes HMAC in the trait to be generic

* re-added HAMC test
This commit is contained in:
kaczmarczyck
2022-01-18 13:14:11 +01:00
committed by GitHub
parent ce08f82d68
commit 98c9191679
5 changed files with 165 additions and 299 deletions

View File

@@ -41,6 +41,10 @@ pub trait Hash256: Sized {
h.update(contents);
h.finalize()
}
fn hmac(key: &[u8; 32], contents: &[u8]) -> [u8; 32] {
hmac::software_hmac_256::<Self>(key, contents)
}
}
// Traits for block ciphers that operate on 16-byte blocks.