Trait hmac::Mac
[−]
pub trait Mac { type OutputSize: ArrayLength<u8>; fn new(key: &[u8]) -> Self; fn input(&mut self, data: &[u8]); fn result(self) -> MacResult<Self::OutputSize>; }
The Mac trait defines methods for a Message Authentication function.
Associated Types
type OutputSize: ArrayLength<u8>
Required Methods
fn new(key: &[u8]) -> Self
Create new MAC instance. DO NOT USE low-entropy keys (e.g. passwords)!
For low-entropy keys first use an appropriate key derivation function (KDF), e.g. argon2, scrypt or PBKDF2
fn input(&mut self, data: &[u8])
Process input data.
fn result(self) -> MacResult<Self::OutputSize>
Obtain the result of a Mac
computation as a MacResult
.