Trait hmac::NewMac [−][src]
pub trait NewMac {
type KeySize: ArrayLength<u8>;
pub fn new(key: &GenericArray<u8, Self::KeySize>) -> Self;
pub fn new_from_slice(key: &[u8]) -> Result<Self, InvalidKeyLength> { ... }
}Instantiate a Mac algorithm.
Associated Types
Loading content...Required methods
pub fn new(key: &GenericArray<u8, Self::KeySize>) -> Self[src]
Initialize new MAC instance from key with fixed size.
Provided methods
pub fn new_from_slice(key: &[u8]) -> Result<Self, InvalidKeyLength>[src]
Initialize new MAC instance from key with variable size.
Default implementation will accept only keys with length equal to
KeySize, but some MACs can accept range of key lengths.
Implementors
impl<D> NewMac for Hmac<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]
impl<D> NewMac for Hmac<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]