Skip to main content

HmacStream

Struct HmacStream 

Source
pub struct HmacStream<const OUTLEN: usize, const BLOCK: usize, D>{ /* private fields */ }
Expand description

Generic streaming HMAC state, parametrized by output length, block size, and an incremental digest implementation D.

Use the type aliases HmacSha256, HmacSha384, or HmacSha512 rather than spelling out the type parameters directly.

Trait Implementations§

Source§

impl<const OUTLEN: usize, const BLOCK: usize, Digest> HmacState<OUTLEN> for HmacStream<OUTLEN, BLOCK, Digest>

Source§

fn new(key: &[u8]) -> Result<Self, Error>

Initialize a new streaming HMAC computation with the given key.

Source§

fn update(&mut self, data: &[u8]) -> Result<(), Error>

Feed a data fragment into the HMAC computation.
Source§

fn finalize(self, dst: &mut [u8; OUTLEN])

Finalize the HMAC and write the tag into dst.

Auto Trait Implementations§

§

impl<const OUTLEN: usize, const BLOCK: usize, D> Freeze for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> RefUnwindSafe for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> Send for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> Sync for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> Unpin for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> UnsafeUnpin for HmacStream<OUTLEN, BLOCK, D>

§

impl<const OUTLEN: usize, const BLOCK: usize, D> UnwindSafe for HmacStream<OUTLEN, BLOCK, D>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.