pub struct Blake2sMac<OutSize>{ /* private fields */ }Expand description
Blake2s MAC function
Implementations§
Source§impl<OutSize> Blake2sMac<OutSize>
impl<OutSize> Blake2sMac<OutSize>
Sourcepub fn new_with_salt_and_personal(
key: Option<&[u8]>,
salt: &[u8],
persona: &[u8],
) -> Result<Self, InvalidLength>
pub fn new_with_salt_and_personal( key: Option<&[u8]>, salt: &[u8], persona: &[u8], ) -> Result<Self, InvalidLength>
Create new instance using provided key, salt, and persona.
Setting key to None indicates unkeyed usage.
§Errors
If key is Some, then its length should not be zero or bigger
than the block size. The 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§
Source§impl<OutSize> Clone for Blake2sMac<OutSize>
impl<OutSize> Clone for Blake2sMac<OutSize>
Source§fn clone(&self) -> Blake2sMac<OutSize>
fn clone(&self) -> Blake2sMac<OutSize>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<OutSize> Debug for Blake2sMac<OutSize>
impl<OutSize> Debug for Blake2sMac<OutSize>
Source§impl<OutSize> Drop for Blake2sMac<OutSize>
impl<OutSize> Drop for Blake2sMac<OutSize>
Source§impl<OutSize> FixedOutput for Blake2sMac<OutSize>
impl<OutSize> FixedOutput for Blake2sMac<OutSize>
Source§fn finalize_into(self, out: &mut Output<Self>)
fn finalize_into(self, out: &mut Output<Self>)
Consume value and write result into provided array.
Source§fn finalize_fixed(self) -> Array<u8, Self::OutputSize>
fn finalize_fixed(self) -> Array<u8, Self::OutputSize>
Retrieve result and consume the hasher instance.
Source§impl<OutSize> FixedOutputReset for Blake2sMac<OutSize>
Available on crate feature reset only.
impl<OutSize> FixedOutputReset for Blake2sMac<OutSize>
Available on crate feature
reset only.Source§fn finalize_into_reset(&mut self, out: &mut Output<Self>)
fn finalize_into_reset(&mut self, out: &mut Output<Self>)
Write result into provided array and reset the hasher state.
Source§fn finalize_fixed_reset(&mut self) -> Array<u8, Self::OutputSize>
fn finalize_fixed_reset(&mut self) -> Array<u8, Self::OutputSize>
Retrieve result and reset the hasher state.
Source§impl<OutSize> KeyInit for Blake2sMac<OutSize>
impl<OutSize> KeyInit for Blake2sMac<OutSize>
Source§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
Source§fn weak_key_test(_key: &Array<u8, Self::KeySize>) -> Result<(), WeakKeyError>
fn weak_key_test(_key: &Array<u8, Self::KeySize>) -> Result<(), WeakKeyError>
Check if the key might be considered weak.
Source§fn new_checked(key: &Array<u8, Self::KeySize>) -> Result<Self, WeakKeyError>
fn new_checked(key: &Array<u8, Self::KeySize>) -> Result<Self, WeakKeyError>
Create new value from fixed size key after checking it for weakness.
Source§impl<OutSize> KeySizeUser for Blake2sMac<OutSize>
impl<OutSize> KeySizeUser for Blake2sMac<OutSize>
Source§impl<OutSize> OutputSizeUser for Blake2sMac<OutSize>
impl<OutSize> OutputSizeUser for Blake2sMac<OutSize>
Source§type OutputSize = OutSize
type OutputSize = OutSize
Size of the output in bytes.
Source§fn output_size() -> usize
fn output_size() -> usize
Return output size in bytes.
Source§impl<OutSize> Reset for Blake2sMac<OutSize>
Available on crate feature reset only.
impl<OutSize> Reset for Blake2sMac<OutSize>
Available on crate feature
reset only.Source§impl<OutSize> Update for Blake2sMac<OutSize>
impl<OutSize> Update for Blake2sMac<OutSize>
impl<OutSize> MacMarker for Blake2sMac<OutSize>
impl<OutSize> ZeroizeOnDrop for Blake2sMac<OutSize>
Available on crate feature
zeroize only.Auto Trait Implementations§
impl<OutSize> Freeze for Blake2sMac<OutSize>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> DynDigest for D
impl<D> DynDigest for D
Source§fn finalize_reset(&mut self) -> Box<[u8]>
fn finalize_reset(&mut self) -> Box<[u8]>
Retrieve result and reset hasher instance
Source§fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
Write result into provided array and consume the hasher instance. Read more
Source§fn finalize_into_reset(
&mut self,
buf: &mut [u8],
) -> Result<(), InvalidBufferSize>
fn finalize_into_reset( &mut self, buf: &mut [u8], ) -> Result<(), InvalidBufferSize>
Write result into provided array and reset the hasher instance. Read more
Source§fn output_size(&self) -> usize
fn output_size(&self) -> usize
Get output size of the hasher
Source§impl<T> Mac for T
impl<T> Mac for T
Source§fn chain_update(self, data: impl AsRef<[u8]>) -> T
fn chain_update(self, data: impl AsRef<[u8]>) -> T
Process input data in a chained manner.
Source§fn finalize_reset(&mut self) -> CtOutput<T>where
T: FixedOutputReset,
fn finalize_reset(&mut self) -> CtOutput<T>where
T: FixedOutputReset,
Source§fn verify(
self,
tag: &Array<u8, <T as OutputSizeUser>::OutputSize>,
) -> Result<(), MacError>
fn verify( self, tag: &Array<u8, <T as OutputSizeUser>::OutputSize>, ) -> Result<(), MacError>
Check if tag/code value is correct for the processed input.
Source§fn verify_reset(
&mut self,
tag: &Array<u8, <T as OutputSizeUser>::OutputSize>,
) -> Result<(), MacError>where
T: FixedOutputReset,
fn verify_reset(
&mut self,
tag: &Array<u8, <T as OutputSizeUser>::OutputSize>,
) -> Result<(), MacError>where
T: FixedOutputReset,
Check if tag/code value is correct for the processed input and reset
Mac instance.Source§fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>
fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>
Check truncated tag correctness using all bytes
of calculated tag. Read more