Struct crypto_mac::MacResult
source · [−]pub struct MacResult<N: ArrayLength<u8>> { /* private fields */ }
Expand description
MacResult
is a thin wrapper around bytes array which provides a safe Eq
implementation that runs in a fixed time.
Implementations
sourceimpl<N> MacResult<N> where
N: ArrayLength<u8>,
impl<N> MacResult<N> where
N: ArrayLength<u8>,
sourcepub fn new(code: GenericArray<u8, N>) -> MacResult<N>
pub fn new(code: GenericArray<u8, N>) -> MacResult<N>
Create a new MacResult.
sourcepub fn code(self) -> GenericArray<u8, N>
pub fn code(self) -> GenericArray<u8, N>
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.
Trait Implementations
sourceimpl<N> ConstantTimeEq for MacResult<N> where
N: ArrayLength<u8>,
impl<N> ConstantTimeEq for MacResult<N> where
N: ArrayLength<u8>,
impl<N> Eq for MacResult<N> where
N: ArrayLength<u8>,
Auto Trait Implementations
impl<N> RefUnwindSafe for MacResult<N> where
<N as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<N> Send for MacResult<N>
impl<N> Sync for MacResult<N>
impl<N> Unpin for MacResult<N> where
<N as ArrayLength<u8>>::ArrayType: Unpin,
impl<N> UnwindSafe for MacResult<N> where
<N as ArrayLength<u8>>::ArrayType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more