2. CMOX_HMAC ¶
2.1. HMAC single-call algorithms ¶
- group CMOX_HMAC_ALGO
-
Variables
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA1_ALGO
-
Identifier of the HMAC-SHA1 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA224_ALGO
-
Identifier of the HMAC-SHA224 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA256_ALGO
-
Identifier of the HMAC-SHA256 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA384_ALGO
-
Identifier of the HMAC-SHA384 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA512_ALGO
-
Identifier of the HMAC-SHA512 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA512_224_ALGO
-
Identifier of the HMAC-SHA512/224 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA512_256_ALGO
-
Identifier of the HMAC-SHA512/256 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SM3_ALGO
-
Identifier of the HMAC-SM3 mac algorithm for single-call function (Defined internally).
-
const
cmox_mac_algo_t
CMOX_HMAC_SHA1_ALGO
2.2. HMAC implementations ¶
- group CMOX_HMAC_IMPL
-
Variables
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA1
-
Implementation of HMAC using SHA-1 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA224
-
Implementation of HMAC using SHA-224 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA256
-
Implementation of HMAC using SHA-256 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA384
-
Implementation of HMAC using SHA-384 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA512
-
Implementation of HMAC using SHA-512 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA512_224
-
Implementation of HMAC using SHA-512/224 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA512_256
-
Implementation of HMAC using SHA-512/256 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SM3
-
Implementation of HMAC using SM3 (Defined internally).
-
const
cmox_hmac_impl_t
CMOX_HMAC_SHA1
2.3. HMAC public method prototypes ¶
- group CMOX_HMAC_PUBLIC_METHODS
-
Functions
-
cmox_mac_handle_t
*
cmox_hmac_construct
(
cmox_hmac_handle_t
*
P_pThis
,
cmox_hmac_impl_t
P_impl
)
-
HMAC constructor.
The function is used for specifying which hash function to use in order to implement the HMAC algorithm.
- Parameters :
-
P_pThis – Pointer to the HMAC handle to initialize
P_impl – Constant that specifies the implementation to use. This parameter can be one of the following values:
CMOX_HMAC_SHA1
CMOX_HMAC_SHA224
CMOX_HMAC_SHA256
CMOX_HMAC_SHA384
CMOX_HMAC_SHA512
CMOX_HMAC_SHA512_224
CMOX_HMAC_SHA512_256
CMOX_HMAC_SM3
- Returns :
-
cmox_mac_handle_t* Pointer to a general MAC handle. This will be used by the general purpose MAC functions in order to perform the algorithm
-
cmox_mac_handle_t
*
cmox_hmac_construct
(
cmox_hmac_handle_t
*
P_pThis
,
cmox_hmac_impl_t
P_impl
)
2.4. HMAC public types ¶
- group CMOX_HMAC_PUBLIC_TYPES
-
Typedefs
-
typedef
const
struct
cmox_hmac_implStruct_st
*
cmox_hmac_impl_t
-
HMAC implementation.
This type specifies the used hash function for the HMAC construct. 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_hmac_supportStruct_st
*
cmox_hmac_support_t
-
HMAC internal support functions.
This type specifies some functions used internally by the HMAC in order to correctly compute the MAC. The structure pointed by the type is defined in the library internally
-
struct
cmox_hmac_handle_t
-
#include <cmox_hmac.h>
HMAC handle structure definition.
Public Members
-
cmox_mac_handle_t
super
-
General MAC handle
-
cmox_mdSmall_handle_t
md_small
-
Handle for SHA-224, SHA-256, SM3
-
cmox_mdLarge_handle_t
md_large
-
Handle for SHA-384, SHA-512
-
union
cmox_hmac_handle_t
hash_context
-
Hash function handle.
Depending on the chosen hash function, one of the two fields of the union will be used.
-
cmox_hash_handle_t
*
hash
-
Pointer to general hash handle
-
uint8_t
key
[
128
]
-
Buffer of bytes containing the derivated key
-
cmox_hmac_support_t
support
-
Support functions for HMAC computation
-
cmox_mac_handle_t
super
-
typedef
const
struct
cmox_hmac_implStruct_st
*
cmox_hmac_impl_t