Struct blake2::Blake2bMac
source · pub struct Blake2bMac<OutSize>{ /* private fields */ }
Expand description
Blake2b MAC function
Implementations§
source§impl<OutSize> Blake2bMac<OutSize>
impl<OutSize> Blake2bMac<OutSize>
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.
§Errors
Key length should not be empty or bigger than the block size and 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 Blake2bMac<OutSize>
impl<OutSize> Clone for Blake2bMac<OutSize>
source§fn clone(&self) -> Blake2bMac<OutSize>
fn clone(&self) -> Blake2bMac<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 Blake2bMac<OutSize>
impl<OutSize> Debug for Blake2bMac<OutSize>
source§impl<OutSize> Drop for Blake2bMac<OutSize>
impl<OutSize> Drop for Blake2bMac<OutSize>
source§impl<OutSize> FixedOutput for Blake2bMac<OutSize>
impl<OutSize> FixedOutput for Blake2bMac<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 Blake2bMac<OutSize>
Available on crate feature reset
only.
impl<OutSize> FixedOutputReset for Blake2bMac<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 Blake2bMac<OutSize>
impl<OutSize> KeyInit for Blake2bMac<OutSize>
source§impl<OutSize> KeySizeUser for Blake2bMac<OutSize>
impl<OutSize> KeySizeUser for Blake2bMac<OutSize>
source§impl<OutSize> OutputSizeUser for Blake2bMac<OutSize>
impl<OutSize> OutputSizeUser for Blake2bMac<OutSize>
§type OutputSize = OutSize
type OutputSize = OutSize
Size of the output in bytes.
§fn output_size() -> usize
fn output_size() -> usize
Return output size in bytes.
source§impl<OutSize> Reset for Blake2bMac<OutSize>
Available on crate feature reset
only.
impl<OutSize> Reset for Blake2bMac<OutSize>
Available on crate feature
reset
only.source§impl<OutSize> Update for Blake2bMac<OutSize>
impl<OutSize> Update for Blake2bMac<OutSize>
impl<OutSize> MacMarker for Blake2bMac<OutSize>
impl<OutSize> ZeroizeOnDrop for Blake2bMac<OutSize>
Available on crate feature
zeroize
only.Auto Trait Implementations§
impl<OutSize> RefUnwindSafe for Blake2bMac<OutSize>where
OutSize: RefUnwindSafe,
impl<OutSize> Send for Blake2bMac<OutSize>where
OutSize: Send,
impl<OutSize> Sync for Blake2bMac<OutSize>where
OutSize: Sync,
impl<OutSize> Unpin for Blake2bMac<OutSize>where
OutSize: Unpin,
impl<OutSize> UnwindSafe for Blake2bMac<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<D> DynDigest for D
impl<D> DynDigest for D
source§fn finalize_reset(&mut self) -> Box<[u8]>
fn finalize_reset(&mut self) -> Box<[u8]>
Available on crate feature
alloc
only.Retrieve result and reset hasher instance
source§fn finalize(self: Box<D>) -> Box<[u8]>
fn finalize(self: Box<D>) -> Box<[u8]>
Available on crate feature
alloc
only.Retrieve result and consume boxed 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