MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEls_Hmac.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020-2023 NXP */
3 /* */
4 /* NXP Confidential. This software is owned or controlled by NXP and may */
5 /* only be used strictly in accordance with the applicable license terms. */
6 /* By expressly accepting such terms or by downloading, installing, */
7 /* activating and/or otherwise using the software, you are agreeing that */
8 /* you have read, and that you agree to comply with and are bound by, such */
9 /* license terms. If you do not agree to be bound by the applicable license */
10 /* terms, then you may not retain, install, activate or otherwise use the */
11 /* software. */
12 /*--------------------------------------------------------------------------*/
13 
29 #ifndef MCUXCLELS_HMAC_H_
30 #define MCUXCLELS_HMAC_H_
31 
32 #include <mcuxClConfig.h> // Exported features flags header
33 #include <mcuxClEls_Common.h> // Common functionality
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /**********************************************
40  * MACROS
41  **********************************************/
54 #define MCUXCLELS_HMAC_EXTERNAL_KEY_ENABLE 1U
55 #define MCUXCLELS_HMAC_EXTERNAL_KEY_DISABLE 0U
56 
60 #define MCUXCLELS_HMAC_PADDED_KEY_SIZE ((size_t) 64U)
61 #define MCUXCLELS_HMAC_OUTPUT_SIZE ((size_t) 32U)
62 
66 /**********************************************
67  * TYPEDEFS
68  **********************************************/
69 
80 typedef union
81 {
82  struct
83  {
84  uint32_t value;
85  } word;
86  struct
87  {
88  uint32_t :13;
89  uint32_t extkey :1;
90  uint32_t :18;
91  } bits;
97 /**********************************************
98  * FUNCTIONS
99  **********************************************/
152 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClEls_Hmac_Async)
154  mcuxClEls_HmacOption_t options,
155  mcuxClEls_KeyIndex_t keyIdx,
156  uint8_t const * pPaddedKey,
157  uint8_t const * pInput,
158  size_t inputLength,
159  uint8_t * pOutput
160  );
161 
162 #ifdef __cplusplus
163 } /* extern "C" */
164 #endif
165 
166 #endif /* MCUXCLELS_HMAC_H_ */
167 
uint32_t extkey
Whether an external key should be used.
Definition: mcuxClEls_Hmac.h:89
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
uint32_t mcuxClEls_KeyIndex_t
Type for ELS keystore indices.
Definition: mcuxClEls_Types.h:221
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t * pOutput
< [out] The memory address of the exported key
Definition: mcuxClEls_KeyManagement.h:295
ELS header for common functionality.
uint32_t mcuxClEls_Status_t
Type for ELS driver status codes.
Definition: mcuxClEls_Types.h:211
Command option bit field for #mcuxClEls_Hmac_Async.
Definition: mcuxClEls_Hmac.h:80
#define MCUXCLELS_API
Marks a function as a public API function of the mcuxClEls component.
Definition: mcuxClEls_Common.h:47
MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClEls_Status_t) mcuxClEls_Hmac_Async(mcuxClEls_HmacOption_t options
Performs HMAC with SHA-256.
Definition: mcuxCsslFlowProtection_example.c:137
uint32_t value
Accesses the bit field as a full word.
Definition: mcuxClEls_Hmac.h:84