[−][src]Struct ghash::GHash
GHASH: universal hash over GF(2^128) used by AES-GCM.
GHASH is a universal hash function whose polynomial is the "reverse" of the one used by POLYVAL, and is used for message authentication in the AES-GCM authenticated encryption cipher.
From RFC 8452 Appendix A: https://tools.ietf.org/html/rfc8452#appendix-A
GHASH and POLYVAL both operate in GF(2^128), although with different irreducible polynomials: POLYVAL works modulo x^128 + x^127 + x^126 + x^121 + 1 and GHASH works modulo x^128 + x^7 + x^2 + x + 1. Note that these irreducible polynomials are the "reverse" of each other.
Trait Implementations
impl Clone for GHash
[src]
fn clone(&self) -> GHash
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl UniversalHash for GHash
[src]
type KeySize = U16
Size of the key for the universal hash function
type OutputSize = U16
Size of the output from the universal hash function
fn new(h: &GenericArray<u8, U16>) -> Self
[src]
Initialize GHASH with the given H
field element
fn update_block(&mut self, x: &GenericArray<u8, U16>)
[src]
Input a field element X
to be authenticated
fn reset(&mut self)
[src]
Reset internal state
fn result(self) -> Output<U16>
[src]
Get POLYVAL result (i.e. computed S
field element)
fn update_padded(&mut self, data: &[u8])
fn result_reset(&mut self) -> Output<Self::OutputSize>
fn verify(self, other: &GenericArray<u8, Self::OutputSize>) -> Result<(), Error>
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self