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  **********************************************/
153  mcuxClEls_HmacOption_t options,
154  mcuxClEls_KeyIndex_t keyIdx,
155  uint8_t const * pPaddedKey,
156  uint8_t const * pInput,
157  size_t inputLength,
158  uint8_t * pOutput
159  );
160 
161 #ifdef __cplusplus
162 } /* extern "C" */
163 #endif
164 
165 #endif /* MCUXCLELS_HMAC_H_ */
166 
uint32_t mcuxClEls_KeyIndex_t
Type for ELS keystore indices.
Definition: mcuxClEls_Types.h:221
uint32_t extkey
Whether an external key should be used.
Definition: mcuxClEls_Hmac.h:89
#define MCUXCLELS_API
Marks a function as a public API function of the mcuxClEls component.
Definition: mcuxClEls_Common.h:47
ELS header for common functionality.
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
uint32_t value
Accesses the bit field as a full word.
Definition: mcuxClEls_Hmac.h:84
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Hmac_Async(mcuxClEls_HmacOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pPaddedKey, uint8_t const *pInput, size_t inputLength, uint8_t *pOutput)
Performs HMAC with SHA-256.
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition: mcuxCsslFlowProtection.h:81
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