Struct hmac::SimpleHmac
source · pub struct SimpleHmac<D: Digest + BlockSizeUser> { /* private fields */ }
Expand description
Simplified HMAC instance able to operate over hash functions which do not expose block-level API and hash functions which process blocks lazily (e.g. BLAKE2).
Trait Implementations§
source§impl<D: Clone + Digest + BlockSizeUser> Clone for SimpleHmac<D>
impl<D: Clone + Digest + BlockSizeUser> Clone for SimpleHmac<D>
source§fn clone(&self) -> SimpleHmac<D>
fn clone(&self) -> SimpleHmac<D>
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<D: Digest + BlockSizeUser + Debug> Debug for SimpleHmac<D>
impl<D: Digest + BlockSizeUser + Debug> Debug for SimpleHmac<D>
source§impl<D: Digest + BlockSizeUser> FixedOutput for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> FixedOutput for SimpleHmac<D>
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) -> GenericArray<u8, Self::OutputSize>
fn finalize_fixed(self) -> GenericArray<u8, Self::OutputSize>
Retrieve result and consume the hasher instance.
source§impl<D: Digest + BlockSizeUser + FixedOutputReset> FixedOutputReset for SimpleHmac<D>
impl<D: Digest + BlockSizeUser + FixedOutputReset> FixedOutputReset for SimpleHmac<D>
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) -> GenericArray<u8, Self::OutputSize>
fn finalize_fixed_reset(&mut self) -> GenericArray<u8, Self::OutputSize>
Retrieve result and reset the hasher state.
source§impl<D: Digest + BlockSizeUser> KeyInit for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> KeyInit for SimpleHmac<D>
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 generate_key(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::KeySize>
fn generate_key( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::KeySize>
Generate random key using the provided
CryptoRng
.source§impl<D: Digest + BlockSizeUser> KeySizeUser for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> KeySizeUser for SimpleHmac<D>
source§impl<D: Digest + BlockSizeUser> OutputSizeUser for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> OutputSizeUser for SimpleHmac<D>
source§type OutputSize = <D as OutputSizeUser>::OutputSize
type OutputSize = <D as OutputSizeUser>::OutputSize
Size of the output in bytes.
source§fn output_size() -> usize
fn output_size() -> usize
Return output size in bytes.
source§impl<D: Digest + BlockSizeUser + Reset> Reset for SimpleHmac<D>
impl<D: Digest + BlockSizeUser + Reset> Reset for SimpleHmac<D>
source§impl<D: Digest + BlockSizeUser> Update for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> Update for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> MacMarker for SimpleHmac<D>
Auto Trait Implementations§
impl<D> Freeze for SimpleHmac<D>
impl<D> RefUnwindSafe for SimpleHmac<D>where
D: RefUnwindSafe,
<<D as BlockSizeUser>::BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<D> Send for SimpleHmac<D>where
D: Send,
impl<D> Sync for SimpleHmac<D>where
D: Sync,
impl<D> Unpin for SimpleHmac<D>
impl<D> UnwindSafe for SimpleHmac<D>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 new(key: &GenericArray<u8, <T as KeySizeUser>::KeySize>) -> Twhere
T: KeyInit,
fn new(key: &GenericArray<u8, <T as KeySizeUser>::KeySize>) -> Twhere
T: KeyInit,
Create new value from fixed size key.
source§fn new_from_slice(key: &[u8]) -> Result<T, InvalidLength>where
T: KeyInit,
fn new_from_slice(key: &[u8]) -> Result<T, InvalidLength>where
T: KeyInit,
Create new value from variable size key.
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: &GenericArray<u8, <T as OutputSizeUser>::OutputSize>,
) -> Result<(), MacError>
fn verify( self, tag: &GenericArray<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: &GenericArray<u8, <T as OutputSizeUser>::OutputSize>,
) -> Result<(), MacError>where
T: FixedOutputReset,
fn verify_reset(
&mut self,
tag: &GenericArray<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