pub struct Polyval { /* 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 + 1
The 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 update(&mut self, blocks: &[u8]) -> Result<(), Error>
pub fn update(&mut self, blocks: &[u8]) -> Result<(), Error>
Writes one or more blocks to the running hash.
It is an error if blocks is not a multiple of
BLOCK_SIZE.
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 not a multiple of
BLOCK_SIZE, it’s padded with zeros.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Polyval
impl Send for Polyval
impl Sync for Polyval
impl Unpin for Polyval
impl UnwindSafe for Polyval
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