Struct sodiumoxide::crypto::auth::hmacsha256::State
[−]
[src]
#[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]
fn init(k: &[u8]) -> State
init()
initializes an authentication structure using a secret key 'k'.
fn update(&mut self, in_: &[u8])
update()
can be called more than once in order to compute the authenticator
from sequential chunks of the message.
fn finalize(&mut self) -> Tag
finalize()
finalizes the authenticator computation and returns a Tag
.