Struct hmac::Hmac
[−]
[src]
pub struct Hmac<D> where
D: Input + FixedOutput + Default,
<D as Input>::BlockSize: ArrayLength<u8>, { /* fields omitted */ }
The Hmac
struct represents an HMAC using a given hash function D
.
Trait Implementations
impl<D> Mac for Hmac<D> where
D: Input + FixedOutput + Default,
<D as Input>::BlockSize: ArrayLength<u8>,
<D as FixedOutput>::OutputSize: ArrayLength<u8>,
[src]
D: Input + FixedOutput + Default,
<D as Input>::BlockSize: ArrayLength<u8>,
<D as FixedOutput>::OutputSize: ArrayLength<u8>,
type OutputSize = D::OutputSize
fn new(key: &[u8]) -> Hmac<D>
Create new MAC instance. DO NOT USE low-entropy keys (e.g. passwords)! Read more
fn input(&mut self, data: &[u8])
Process input data.
fn result(self) -> MacResult<D::OutputSize>
Obtain the result of a Mac
computation as a MacResult
.
fn verify(self, code: &[u8]) -> bool
Check if code is correct for the processed input