|
Lightweight Cryptography Primitives
|
GHASH algorithm for supporting GCM mode. More...
#include "internal-util.h"#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | gf128_value_t |
| Representation of a value in the GF(2^128) field. More... | |
| struct | ghash_state_t |
| State information for GHASH. More... | |
Macros | |
| #define | GHASH_SHOUP_4BIT 1 |
| Define to 1 to use Shoup's 4-bit method for GF(2^128) multiplications, or define to 0 to use a simpler but slower bit-by-bit method. | |
Functions | |
| void | ghash_init (ghash_state_t *state, const unsigned char *key) |
| Initializes the GHASH state. More... | |
| void | ghash_update (ghash_state_t *state, const unsigned char *data, size_t size) |
| Updates a GHASH state with more data. More... | |
| void | ghash_pad (ghash_state_t *state) |
| Pads a GHASH state with zeroes to the next block boundary. More... | |
| void | ghash_finalize (ghash_state_t *state, unsigned char *hash) |
| Finalizes a GHASH state. More... | |
GHASH algorithm for supporting GCM mode.
Note: This implementation is not constant cache. Internally it uses lookup tables for multiplication in the GF(2^128) field. This means that it has similar behaviour to other fast but memory-efficient software implementations of GHASH but is not suitable for use where memory cache attacks are a concern.
| void ghash_finalize | ( | ghash_state_t * | state, |
| unsigned char * | hash | ||
| ) |
Finalizes a GHASH state.
| state | GHASH state to be finalized. |
| hash | Points to the output hash value, which is 16 bytes in length. |
| void ghash_init | ( | ghash_state_t * | state, |
| const unsigned char * | key | ||
| ) |
Initializes the GHASH state.
| state | GHASH state to be initialized. |
| key | 128-bit key. |
| void ghash_pad | ( | ghash_state_t * | state | ) |
Pads a GHASH state with zeroes to the next block boundary.
| state | GHASH state to be padded. |
| void ghash_update | ( | ghash_state_t * | state, |
| const unsigned char * | data, | ||
| size_t | size | ||
| ) |
Updates a GHASH state with more data.
| state | GHASH state to be updated. |
| data | Points to the input data. |
| size | Number of bytes of input data. |
1.8.6