Skip to main content

StreamingHashHmacSession

Struct StreamingHashHmacSession 

Source
pub struct StreamingHashHmacSession<H, F>
where H: StreamingHash, F: Fn() -> H + Send,
{ /* private fields */ }
Expand description

Incremental HMAC session.

Created by StreamingHashHmac::streaming_session. Maintains the inner hasher state pre-loaded with ipad_key, ready for message data via update. Calling finalize computes the outer hash and returns the final HMAC tag.

Implementations§

Source§

impl<H, F> StreamingHashHmacSession<H, F>
where H: StreamingHash, F: Fn() -> H + Send + Clone,

Source

pub fn update(&mut self, data: &[u8])

Feed additional message bytes into the inner hash.

Source

pub fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>

Finalise the inner hash and compute the outer HMAC, writing the tag into out.

Consumes self.

§Errors

Returns CryptoError::BufferTooSmall if out.len() < output_len.

Auto Trait Implementations§

§

impl<H, F> Freeze for StreamingHashHmacSession<H, F>
where H: Freeze, F: Freeze,

§

impl<H, F> RefUnwindSafe for StreamingHashHmacSession<H, F>

§

impl<H, F> Send for StreamingHashHmacSession<H, F>

§

impl<H, F> Sync for StreamingHashHmacSession<H, F>
where H: Sync, F: Sync,

§

impl<H, F> Unpin for StreamingHashHmacSession<H, F>
where H: Unpin, F: Unpin,

§

impl<H, F> UnsafeUnpin for StreamingHashHmacSession<H, F>
where H: UnsafeUnpin, F: UnsafeUnpin,

§

impl<H, F> UnwindSafe for StreamingHashHmacSession<H, F>
where H: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeDebug for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.