[][src]Struct sodiumoxide::crypto::auth::hmacsha512256::State

#[must_use]
pub struct State(_);

Authentication State

State for multi-part (streaming) authenticator tag (HMAC) computation.

When a State goes out of scope its contents will be zeroed out.

NOTE: the streaming interface takes variable length keys, as opposed to the simple interface which takes a fixed length key. The streaming interface also does not define its own Key type, instead using slices for its init() method. The caller of the functions is responsible for zeroing out the key after it's been used (in contrast to the simple interface which defines a Drop implementation for Key).

NOTE: these functions are specific to libsodium and do not exist in NaCl.

Methods

impl State[src]

pub fn init(k: &[u8]) -> State[src]

init() initializes an authentication structure using a secret key 'k'.

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

update() can be called more than once in order to compute the authenticator from sequential chunks of the message.

pub fn finalize(self) -> Tag[src]

finalize() finalizes the authenticator computation and returns a Tag. finalize consumes the State so that it cannot be accidentally reused.

Trait Implementations

impl Drop for State[src]

Auto Trait Implementations

impl Send for State

impl Sync for State

impl Unpin for State

impl UnwindSafe for State

impl RefUnwindSafe for State

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]