10. CMOX_GCM ¶
10.1. GCM single-call algorithms ¶
- group CMOX_GCM_ALGO
-
Variables
-
const
cmox_aead_algo_t
CMOX_AESSMALL_GCMFAST_ENC_ALGO
¶
-
Identifier of the GCM (fast implementation) encryption using AES (small implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESSMALL_GCMFAST_DEC_ALGO
¶
-
Identifier of the GCM (fast implementation) decryption using AES (small implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESFAST_GCMFAST_ENC_ALGO
¶
-
Identifier of the GCM (fast implementation) encryption using AES (fast implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESFAST_GCMFAST_DEC_ALGO
¶
-
Identifier of the GCM (fast implementation) decryption using AES (fast implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESSMALL_GCMSMALL_ENC_ALGO
¶
-
Identifier of the GCM (small implementation) encryption using AES (small implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESSMALL_GCMSMALL_DEC_ALGO
¶
-
Identifier of the GCM (small implementation) decryption using AES (small implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESFAST_GCMSMALL_ENC_ALGO
¶
-
Identifier of the GCM (small implementation) encryption using AES (fast implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESFAST_GCMSMALL_DEC_ALGO
¶
-
Identifier of the GCM (small implementation) decryption using AES (fast implementation) for single-call function (Defined internally).
-
const
cmox_aead_algo_t
CMOX_AESSMALL_GCMFAST_ENC_ALGO
¶
10.2. GCM implementations ¶
- group CMOX_GCM_IMPL
-
Variables
-
const
cmox_gcmSmall_impl_t
CMOX_AESFAST_GCMSMALL_ENC
¶
-
Implementation of GCMSMALL encryption using AES (fast implementation) (Defined internally).
-
const
cmox_gcmSmall_impl_t
CMOX_AESFAST_GCMSMALL_DEC
¶
-
Implementation of GCMSMALL decryption using AES (fast implementation) (Defined internally).
-
const
cmox_gcmSmall_impl_t
CMOX_AESSMALL_GCMSMALL_ENC
¶
-
Implementation of GCMSMALL encryption using AES (small implementation) (Defined internally).
-
const
cmox_gcmSmall_impl_t
CMOX_AESSMALL_GCMSMALL_DEC
¶
-
Implementation of GCMSMALL decryption using AES (small implementation) (Defined internally).
-
const
cmox_gcmFast_impl_t
CMOX_AESFAST_GCMFAST_ENC
¶
-
Implementation of GCMFAST encryption using AES (fast implementation) (Defined internally).
-
const
cmox_gcmFast_impl_t
CMOX_AESFAST_GCMFAST_DEC
¶
-
Implementation of GCMFAST decryption using AES (fast implementation) (Defined internally).
-
const
cmox_gcmFast_impl_t
CMOX_AESSMALL_GCMFAST_ENC
¶
-
Implementation of GCMFAST encryption using AES (small implementation) (Defined internally).
-
const
cmox_gcmFast_impl_t
CMOX_AESSMALL_GCMFAST_DEC
¶
-
Implementation of GCMFAST decryption using AES (small implementation) (Defined internally).
-
const
cmox_gcmSmall_impl_t
CMOX_AESFAST_GCMSMALL_ENC
¶
10.3. GCM public method prototypes ¶
- group CMOX_GCM_PUBLIC_METHODS
-
Functions
-
cmox_cipher_handle_t
*
cmox_gcmSmall_construct
(
cmox_gcmSmall_handle_t
*
P_pThis
,
cmox_gcmSmall_impl_t
P_impl
)
¶
-
GCMSMALL constructor.
The function is used for specifying which block cipher algorithm to use in order to implement the GCM algorithm and if the algorithm will be used for encryption or decryption.
Note
If CMOX_GCM_IMPLEMENTATION macro has been set to CMOX_GCM_SMALL, this constructor can be called also through the wrapper cmox_gcm_construct
- Parameters :
-
P_pThis – Pointer to the GCM handle to initialize
P_impl – Constant that specifies the implementation to use. This parameter can be one of the following values:
CMOX_AESFAST_GCMSMALL_ENC
CMOX_AESFAST_GCMSMALL_DEC
CMOX_AESSMALL_GCMSMALL_ENC
CMOX_AESSMALL_GCMSMALL_DEC
- Returns :
-
cmox_cipher_handle_t* Pointer to a general cipher handle. This will be used by the general purpose cipher functions in order to perform the algorithm
-
cmox_cipher_handle_t
*
cmox_gcmFast_construct
(
cmox_gcmFast_handle_t
*
P_pThis
,
cmox_gcmFast_impl_t
P_impl
)
¶
-
GCMFAST constructor.
The function is used for specifying which block cipher algorithm to use in order to implement the GCM algorithm and if the algorithm will be used for encryption or decryption.
Note
If CMOX_GCM_IMPLEMENTATION macro has been set to CMOX_GCM_FAST, this constructor can be called also through the wrapper cmox_gcm_construct
- Parameters :
-
P_pThis – Pointer to the GCM handle to initialize
P_impl – Constant that specifies the implementation to use. This parameter can be one of the following values:
CMOX_AESFAST_GCMFAST_ENC
CMOX_AESFAST_GCMFAST_DEC
CMOX_AESSMALL_GCMFAST_ENC
CMOX_AESSMALL_GCMFAST_DEC
- Returns :
-
cmox_cipher_handle_t* Pointer to a general cipher handle. This will be used by the general purpose cipher functions in order to perform the algorithm
-
cmox_cipher_handle_t
*
cmox_gcmSmall_construct
(
cmox_gcmSmall_handle_t
*
P_pThis
,
cmox_gcmSmall_impl_t
P_impl
)
¶
10.4. GCM public types ¶
- group CMOX_GCM_PUBLIC_TYPES
-
Typedefs
-
typedef
const
struct
cmox_gcm_gfmulTable_st
*
cmox_gcm_gfmul_t
¶
-
Type for specifying the GFMUL operation to use (internally used).
-
typedef
const
struct
cmox_gcmSmall_implStruct_st
*
cmox_gcmSmall_impl_t
¶
-
GCM SMALL mode implementation.
This type specifies the used block cipher for the GCM construct and if the algorithm will be used for encryption or decryption. This type is defined as a pointer to a structure, that contains the functions needed for the specific implementation, defined in the library internally
-
typedef
const
struct
cmox_gcmFast_implStruct_st
*
cmox_gcmFast_impl_t
¶
-
GCM FAST mode implementation.
This type specifies the used block cipher for the GCM construct and if the algorithm will be used for encryption or decryption. This type is defined as a pointer to a structure, that contains the functions needed for the specific implementation, defined in the library internally
-
typedef
uint32_t
cmox_gcm_poly_t
[
4
]
¶
-
Polynomial type used internally by GCM.
-
typedef
cmox_gcm_poly_t
cmox_gcm_table16_t
[
16
]
¶
-
Polynomial table type used by GCM SMALL implementation.
-
typedef
cmox_gcm_poly_t
cmox_gcm_table8x16_t
[
8
]
[
16
]
¶
-
Polynomial table type used by GCM FAST implementation.
-
typedef
cmox_gcmFast_handle_t
cmox_gcm_handle_t
¶
-
Default GCM handle definition.
-
typedef
cmox_gcmFast_impl_t
cmox_gcm_impl_t
¶
-
Default GCM implementation definition.
-
struct
cmox_gcm_common_t
¶
-
#include <cmox_gcm.h>
Common fields for both GCM FAST and GCM SMALL handles.
Public Members
-
cmox_blockcipher_handle_t
blockCipher
¶
-
Block cipher handle
-
uint32_t
iv
[
CMOX_CIPHER_BLOCK_SIZE
]
¶
-
Buffer containing the IV
-
size_t
tagLen
¶
-
Size in bytes of the authentication tag
-
size_t
AdLen
¶
-
Size in bytes of the Additional Data
-
size_t
payloadLen
¶
-
Processed payload size in bytes
-
cmox_gcm_poly_t
partialAuth
¶
-
Partial authentication value
-
cmox_gcm_gfmul_t
gfmul
¶
-
GF mul implementation
-
cmox_blockcipher_handle_t
blockCipher
¶
-
struct
cmox_gcmSmall_handle_t
¶
-
#include <cmox_gcm.h>
GCM SMALL handle structure definition.
Public Members
-
cmox_cipher_handle_t
super
¶
-
General cipher handle
-
cmox_gcm_common_t
common
¶
-
Common values with the GCM FAST handle type
-
cmox_gcm_table16_t
precomputedValues
¶
-
Precomputation of polynomial according to Shoup’s 4-bit table
-
cmox_cipher_handle_t
super
¶
-
struct
cmox_gcmFast_handle_t
¶
-
#include <cmox_gcm.h>
GCM fast context.
Public Members
-
cmox_cipher_handle_t
super
¶
-
General cipher handle
-
cmox_gcm_common_t
common
¶
-
Common values with the GCM SMALL handle type
-
cmox_gcm_table8x16_t
precomputedValues
¶
-
Precomputation of polynomial according to Shoup’s 8-bit table
-
cmox_cipher_handle_t
super
¶
-
typedef
const
struct
cmox_gcm_gfmulTable_st
*
cmox_gcm_gfmul_t
¶