pub struct Polyval<B = Precomputed>(/* private fields */);Expand description
An implementation of POLYVAL.
POLYVAL is similar to GHASH. It operates in GF(2¹²⁸)
defined by the irreducible polynomial
x^128 + x^127 + x^126 + x^121 + 1The field has characteristic 2, so addition is performed with XOR. Multiplication is polynomial multiplication reduced modulo the polynomial.
For more information on POLYVAL, see RFC 8452.
Implementations§
Source§impl Polyval
impl Polyval
Sourcepub fn export(&self) -> State
Available on crate feature experimental only.
pub fn export(&self) -> State
experimental only.Exports the current state.
Sourcepub fn reset(&mut self, state: &State)
Available on crate feature experimental only.
pub fn reset(&mut self, state: &State)
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
self.
Source§impl<B: Backend> Polyval<B>
impl<B: Backend> Polyval<B>
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_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 and is not
a multiple of BLOCK_SIZE, it’s padded with zeros.
Trait Implementations§
impl<T> ZeroizeOnDrop for Polyval<T>
Available on crate feature
zeroize only.Auto Trait Implementations§
impl<B> Freeze for Polyval<B>where
B: Freeze,
impl<B> RefUnwindSafe for Polyval<B>where
B: RefUnwindSafe,
impl<B> Send for Polyval<B>where
B: Send,
impl<B> Sync for Polyval<B>where
B: Sync,
impl<B> Unpin for Polyval<B>where
B: Unpin,
impl<B> UnwindSafe for Polyval<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more