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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user