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
sourceimpl<D: Clone + Digest + BlockSizeUser> Clone for SimpleHmac<D>
impl<D: Clone + Digest + BlockSizeUser> Clone for SimpleHmac<D>
sourcefn clone(&self) -> SimpleHmac<D>
fn clone(&self) -> SimpleHmac<D>
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<D: Digest + BlockSizeUser + Debug> Debug for SimpleHmac<D>
impl<D: Digest + BlockSizeUser + Debug> Debug for SimpleHmac<D>
sourceimpl<D: Digest + BlockSizeUser> FixedOutput for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> FixedOutput for SimpleHmac<D>
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<D: Digest + BlockSizeUser + FixedOutputReset> FixedOutputReset for SimpleHmac<D>
This is supported on crate feature reset
only.
impl<D: Digest + BlockSizeUser + FixedOutputReset> FixedOutputReset for SimpleHmac<D>
reset
only.sourcefn 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.
sourcefn 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.
sourceimpl<D: Digest + BlockSizeUser> KeyInit for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> KeyInit for SimpleHmac<D>
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<D: Digest + BlockSizeUser> KeySizeUser for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> KeySizeUser for SimpleHmac<D>
sourceimpl<D: Digest + BlockSizeUser> OutputSizeUser for SimpleHmac<D>
impl<D: Digest + BlockSizeUser> OutputSizeUser for SimpleHmac<D>
type OutputSize = D::OutputSize
type OutputSize = D::OutputSize
Size of the output in bytes.
sourcefn output_size() -> usize
fn output_size() -> usize
Return output size in bytes.
sourceimpl<D: Digest + BlockSizeUser + Reset> Reset for SimpleHmac<D>
This is supported on crate feature reset
only.
impl<D: Digest + BlockSizeUser + Reset> Reset for SimpleHmac<D>
reset
only.sourceimpl<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> 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> where
D: Unpin,
<<D as BlockSizeUser>::BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<D> UnwindSafe for SimpleHmac<D> where
D: UnwindSafe,
<<D as BlockSizeUser>::BlockSize 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
sourceimpl<D> DynDigest for D where
D: 'static + Update + FixedOutputReset + Reset + Clone,
impl<D> DynDigest for D where
D: 'static + Update + FixedOutputReset + Reset + Clone,
sourcepub fn finalize_reset(&mut self) -> Box<[u8], Global>
pub fn finalize_reset(&mut self) -> Box<[u8], Global>
Retrieve result and reset hasher instance
sourcepub fn finalize(self: Box<D, Global>) -> Box<[u8], Global>
pub fn finalize(self: Box<D, Global>) -> Box<[u8], Global>
Retrieve result and consume boxed hasher instance
sourcepub fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
pub fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
Write result into provided array and consume the hasher instance. Read more
sourcepub fn finalize_into_reset(
&mut self,
buf: &mut [u8]
) -> Result<(), InvalidBufferSize>
pub fn finalize_into_reset(
&mut self,
buf: &mut [u8]
) -> Result<(), InvalidBufferSize>
Write result into provided array and reset the hasher instance. Read more
sourcepub fn output_size(&self) -> usize
pub fn output_size(&self) -> usize
Get output size of the hasher
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