pub struct PolyvalLite(/* private fields */);Expand description
The same thing as Polyval, except it only processes
one block at a time.
This saves space, but can be slower if the input is more than a couple blocks long.
Implementations§
Source§impl PolyvalLite
impl PolyvalLite
Sourcepub fn new(key: &[u8; 16]) -> Option<Self>
pub fn new(key: &[u8; 16]) -> Option<Self>
Creates a new hash instance.
It returns None if key is all zeroes.
Sourcepub fn new_unchecked(key: &[u8; 16]) -> Self
pub fn new_unchecked(key: &[u8; 16]) -> Self
Creates a hash instance from a known non-zero key.
§Warning
Only use this method if key is known to be
non-zero. Using an all zero key fixes the output
to zero, regardless of the input.
Sourcepub fn update_block(&mut self, block: &[u8; 16])
pub fn update_block(&mut self, block: &[u8; 16])
Writes a single block to the running hash.
Sourcepub fn update_blocks(&mut self, blocks: &[[u8; 16]])
pub fn update_blocks(&mut self, blocks: &[[u8; 16]])
Writes one or more blocks to the running hash.
Sourcepub fn update_padded(&mut self, blocks: &[u8])
pub fn update_padded(&mut self, blocks: &[u8])
Writes one or more blocks to the running hash.
If the length of blocks is non-zero, it’s
padded to the lowest multiple of
BLOCK_SIZE.
Sourcepub fn verify(self, expected_tag: &Tag) -> Choice
pub fn verify(self, expected_tag: &Tag) -> Choice
Reports whether the current authentication tag matches
expected_tag.
Sourcepub fn export(&self) -> PolyvalState
Available on crate feature experimental only.
pub fn export(&self) -> PolyvalState
experimental only.Exports the current state.
Sourcepub fn reset(&mut self, state: &PolyvalState)
Available on crate feature experimental only.
pub fn reset(&mut self, state: &PolyvalState)
experimental only.Resets the hash to state.
Sourcepub fn current_tag(&self) -> Tag
Available on crate feature experimental only.
pub fn current_tag(&self) -> Tag
experimental only.Returns the current authentication tag without consuming the hash.
Trait Implementations§
Source§impl Clone for PolyvalLite
impl Clone for PolyvalLite
Source§fn clone(&self) -> PolyvalLite
fn clone(&self) -> PolyvalLite
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolyvalLite
impl Debug for PolyvalLite
Source§impl Drop for PolyvalLite
impl Drop for PolyvalLite
impl ZeroizeOnDrop for PolyvalLite
zeroize only.