Struct blake2::Blake2sMac
source · [−]pub struct Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero, { /* private fields */ }
Expand description
Blake2s MAC function
Implementations
sourceimpl<OutSize> Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
sourcepub fn new_with_salt_and_personal(
key: &[u8],
salt: &[u8],
persona: &[u8]
) -> Result<Self, InvalidLength>
pub fn new_with_salt_and_personal(
key: &[u8],
salt: &[u8],
persona: &[u8]
) -> Result<Self, InvalidLength>
Create new instance using provided key, salt, and persona.
Key length should not be bigger than block size, salt and persona length should not be bigger than quarter of block size. If any of those conditions is false the method will return an error.
Trait Implementations
sourceimpl<OutSize: Clone> Clone for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize: Clone> Clone for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
sourcefn clone(&self) -> Blake2sMac<OutSize>
fn clone(&self) -> Blake2sMac<OutSize>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<OutSize> Debug for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> Debug for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
sourceimpl<OutSize> FixedOutput for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32> + 'static,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> FixedOutput for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32> + 'static,
LeEq<OutSize, U32>: NonZero,
sourcefn finalize_into(self, out: &mut Output<Self>)
fn finalize_into(self, out: &mut Output<Self>)
Consume value and write result into provided array.
sourcefn finalize_fixed(self) -> GenericArray<u8, Self::OutputSize>
fn finalize_fixed(self) -> GenericArray<u8, Self::OutputSize>
Retrieve result and consume the hasher instance.
sourceimpl<OutSize> KeyInit for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> KeyInit for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
sourcefn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
sourceimpl<OutSize> KeySizeUser for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> KeySizeUser for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
sourceimpl<OutSize> OutputSizeUser for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32> + 'static,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> OutputSizeUser for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32> + 'static,
LeEq<OutSize, U32>: NonZero,
type OutputSize = OutSize
type OutputSize = OutSize
Size of the output in bytes.
sourcefn output_size() -> usize
fn output_size() -> usize
Return output size in bytes.
sourceimpl<OutSize> Update for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> Update for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
impl<OutSize> MacMarker for Blake2sMac<OutSize> where
OutSize: ArrayLength<u8> + IsLessOrEqual<U32>,
LeEq<OutSize, U32>: NonZero,
Auto Trait Implementations
impl<OutSize> RefUnwindSafe for Blake2sMac<OutSize> where
OutSize: RefUnwindSafe,
impl<OutSize> Send for Blake2sMac<OutSize> where
OutSize: Send,
impl<OutSize> Sync for Blake2sMac<OutSize> where
OutSize: Sync,
impl<OutSize> Unpin for Blake2sMac<OutSize> where
OutSize: Unpin,
impl<OutSize> UnwindSafe for Blake2sMac<OutSize> where
OutSize: 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
sourceimpl<T> Mac for T where
T: Update + FixedOutput + MacMarker,
impl<T> Mac for T where
T: Update + FixedOutput + MacMarker,
sourcepub fn new(key: &GenericArray<u8, <T as KeySizeUser>::KeySize>) -> T where
T: KeyInit,
pub fn new(key: &GenericArray<u8, <T as KeySizeUser>::KeySize>) -> T where
T: KeyInit,
Create new value from fixed size key.
sourcepub fn new_from_slice(key: &[u8]) -> Result<T, InvalidLength> where
T: KeyInit,
pub fn new_from_slice(key: &[u8]) -> Result<T, InvalidLength> where
T: KeyInit,
Create new value from variable size key.
sourcepub fn finalize_reset(&mut self) -> CtOutput<T> where
T: FixedOutputReset,
pub fn finalize_reset(&mut self) -> CtOutput<T> where
T: FixedOutputReset,
sourcepub fn verify(
self,
tag: &GenericArray<u8, <T as OutputSizeUser>::OutputSize>
) -> Result<(), MacError>
pub fn verify(
self,
tag: &GenericArray<u8, <T as OutputSizeUser>::OutputSize>
) -> Result<(), MacError>
Check if tag/code value is correct for the processed input.
sourcepub fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>
pub fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>
Check truncated tag correctness using all bytes of calculated tag. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more