[][src]Struct ghash::GHash

pub struct 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]

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)

Auto Trait Implementations

impl Unpin for GHash

impl Send for GHash

impl Sync for GHash

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self