Struct crypto_mac::MacResult
[−]
[src]
pub struct MacResult<N: ArrayLength<u8>> { /* fields omitted */ }
MacResult
is a thin wrapper around bytes array which provides a safe Eq
implementation that runs in a fixed time.
Methods
impl<N> MacResult<N> where
N: ArrayLength<u8>,
[src]
N: ArrayLength<u8>,
fn new(code: GenericArray<u8, N>) -> MacResult<N>
[src]
Create a new MacResult.
fn code(self) -> GenericArray<u8, N>
[src]
Get the code value as a bytes array. Be very careful using this method,
since incorrect use of the code value may permit timing attacks which
defeat the security provided by the Mac
trait.
fn is_equal(&self, code: &[u8]) -> bool
[src]
Check if equality to provided slice in constant time
Trait Implementations
impl<N: Clone + ArrayLength<u8>> Clone for MacResult<N>
[src]
fn clone(&self) -> MacResult<N>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<N> PartialEq for MacResult<N> where
N: ArrayLength<u8>,
[src]
N: ArrayLength<u8>,
fn eq(&self, x: &MacResult<N>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<N> Eq for MacResult<N> where
N: ArrayLength<u8>,
[src]
N: ArrayLength<u8>,