70 memset(state.Y, 0,
sizeof(state.Y));
88 const uint8_t *d = (
const uint8_t *)data;
90 uint8_t size = 16 - state.posn;
93 uint8_t *y = ((uint8_t *)state.Y) + state.posn;
94 for (uint8_t i = 0; i < size; ++i)
99 if (state.posn == 16) {
129 memcpy(token, state.Y, len);
139 if (state.posn != 0) {
static void mulInit(uint32_t H[4], const void *key)
Initialize multiplication in the GF(2^128) field.
static void mul(uint32_t Y[4], const uint32_t H[4])
Perform a multiplication in the GF(2^128) field.
void update(const void *data, size_t len)
Updates the message authenticator with more data.
GHASH()
Constructs a new GHASH message authenticator.
void reset(const void *key)
Resets the GHASH message authenticator for a new session.
void clear()
Clears the authenticator's state, removing all sensitive data.
void pad()
Pads the input stream with zero bytes to a multiple of 16.
void finalize(void *token, size_t len)
Finalizes the authentication process and returns the token.
~GHASH()
Destroys this GHASH message authenticator.