Arduino Cryptography Library
Static Public Member Functions | List of all members
GF128 Class Reference

Operations in the Galois field GF(2^128). More...

#include <GF128.h>

Static Public Member Functions

static void mulInit (uint32_t H[4], const void *key)
 Initialize multiplication in the GF(2^128) field. More...
 
static void mul (uint32_t Y[4], const uint32_t H[4])
 Perform a multiplication in the GF(2^128) field. More...
 
static void dbl (uint32_t V[4])
 Doubles a value in the GF(2^128) field. More...
 
static void dblEAX (uint32_t V[4])
 Doubles a value in the GF(2^128) field using EAX conventions. More...
 
static void dblXTS (uint32_t V[4])
 Doubles a value in the GF(2^128) field using XTS conventions. More...
 

Detailed Description

Operations in the Galois field GF(2^128).

This class contains helper functions for performing operations in the Galois field GF(2^128) which is used as the basis of GCM and GHASH. These functions are provided for use by other cryptographic protocols that make use of GF(2^128).

Most of the functions in this class use the field, polynomial, and byte ordering conventions described in NIST SP 800-38D (GCM). The one exception is dblEAX() which uses the conventions of EAX mode instead.

References: NIST SP 800-38D

See also
GCM, GHASH

Definition at line 28 of file GF128.h.

Member Function Documentation

◆ dbl()

void GF128::dbl ( uint32_t  V[4])
static

Doubles a value in the GF(2^128) field.

Parameters
VThe value to double, and the result. This array is assumed to be in big-endian order on entry and exit.

Block cipher modes such as XEX are similar to CTR mode but instead of incrementing the nonce every block, the modes multiply the nonce by 2 in the GF(2^128) field every block. This function is provided to help with implementing such modes.

See also
dblEAX(), dblXTS(), mul()

Definition at line 314 of file GF128.cpp.

◆ dblEAX()

void GF128::dblEAX ( uint32_t  V[4])
static

Doubles a value in the GF(2^128) field using EAX conventions.

Parameters
VThe value to double, and the result. This array is assumed to be in big-endian order on entry and exit.

This function differs from dbl() that it uses the conventions of EAX mode instead of those of NIST SP 800-38D (GCM). The two operations have equivalent security but the bits are ordered differently with the value shifted left instead of right.

References: https://en.wikipedia.org/wiki/EAX_mode, http://web.cs.ucdavis.edu/~rogaway/papers/eax.html

See also
dbl(), dblXTS(), mul()

Definition at line 406 of file GF128.cpp.

◆ dblXTS()

void GF128::dblXTS ( uint32_t  V[4])
static

Doubles a value in the GF(2^128) field using XTS conventions.

Parameters
VThe value to double, and the result. This array is assumed to be in littlen-endian order on entry and exit.

This function differs from dbl() that it uses the conventions of XTS mode instead of those of NIST SP 800-38D (GCM). The two operations have equivalent security but the bits are ordered differently with the value shifted left instead of right.

References: IEEE Std. 1619-2007, XTS-AES

See also
dbl(), dblEAX(), mul()

Definition at line 497 of file GF128.cpp.

◆ mul()

void GF128::mul ( uint32_t  Y[4],
const uint32_t  H[4] 
)
static

Perform a multiplication in the GF(2^128) field.

Parameters
YThe first value to multiply, and the result. This array is assumed to be in big-endian order on entry and exit.
HThe second value to multiply, which must have been initialized by the mulInit() function.

This function and the companion mulInit() are intended for use by other classes that need access to the raw GF(2^128) field multiplication of GHASH without the overhead of GHASH itself.

See also
mulInit(), dbl()

Definition at line 90 of file GF128.cpp.

◆ mulInit()

void GF128::mulInit ( uint32_t  H[4],
const void *  key 
)
static

Initialize multiplication in the GF(2^128) field.

Parameters
HThe hash state to be initialized.
keyPoints to the 16 byte authentication key which is assumed to be in big-endian byte order.

This function and the companion mul() are intended for use by other classes that need access to the raw GF(2^128) field multiplication of GHASH without the overhead of GHASH itself.

See also
mul(), dbl()

Definition at line 58 of file GF128.cpp.


The documentation for this class was generated from the following files: