MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClAead_Functions.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 
17 #ifndef MCUXCLAEAD_FUNCTIONS_H_
18 #define MCUXCLAEAD_FUNCTIONS_H_
19 
20 #include <mcuxClConfig.h> // Exported features flags header
21 
22 #include <mcuxClSession_Types.h>
23 #include <mcuxClKey.h>
24 #include <mcuxClAead_Types.h>
25 #include <mcuxClCore_Buffer.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
81 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_crypt)
83  mcuxClSession_Handle_t session,
85  mcuxClAead_Mode_t mode,
86  mcuxCl_InputBuffer_t pNonce,
87  uint32_t nonceLength,
89  uint32_t inLength,
90  mcuxCl_InputBuffer_t pAdata,
91  uint32_t adataLength,
92  mcuxCl_Buffer_t pOut,
93  uint32_t * const pOutLength,
94  mcuxCl_Buffer_t pTag,
95  uint32_t tagLength
96 );
97 
98 
99 
100 
101 
132 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_init)
134  mcuxClSession_Handle_t session,
135  mcuxClAead_Context_t * const pContext,
136  mcuxClKey_Handle_t key,
137  mcuxClAead_Mode_t mode,
138  mcuxCl_InputBuffer_t pNonce,
139  uint32_t nonceLength,
140  uint32_t inLength,
141  uint32_t adataLength,
142  uint32_t tagLength
143 ); /* init encrypt */
144 
145 
146 
147 
170 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_process)
172  mcuxClSession_Handle_t session,
173  mcuxClAead_Context_t * const pContext,
175  uint32_t inLength,
176  mcuxCl_Buffer_t pOut,
177  uint32_t * const pOutLength
178 ); /* update */
179 
197 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_process_adata)
198 MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClAead_Status_t) mcuxClAead_process_adata(
199  mcuxClSession_Handle_t session,
200  mcuxClAead_Context_t * const pContext,
201  mcuxCl_InputBuffer_t pAdata,
202  uint32_t adataLength
203 ); /* update associated data */
204 
227 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_finish)
229  mcuxClSession_Handle_t session,
230  mcuxClAead_Context_t * const pContext,
231  mcuxCl_Buffer_t pOut,
232  uint32_t * const pOutLength,
233  mcuxCl_Buffer_t pTag
234 ); /* finalize encrypt/decrypt + output tag */
235 
260 MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_verify)
262  mcuxClSession_Handle_t session,
263  mcuxClAead_Context_t * const pContext,
265  mcuxCl_Buffer_t pOut,
266  uint32_t * const pOutLength
267 ); /* finalize decrypt + compare tag */
268 
271 #ifdef __cplusplus
272 } /* extern "C" */
273 #endif
274 
275 #endif /* MCUXCLAEAD_FUNCTION_H_ */
struct mcuxClAead_Context mcuxClAead_Context_t
AEAD context type.
Definition: mcuxClAead_Types.h:79
const mcuxClAead_ModeDescriptor_t *const mcuxClAead_Mode_t
AEAD mode/algorithm type.
Definition: mcuxClAead_Types.h:63
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition: mcuxClSession_Types.h:124
MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClAead_Status_t) mcuxClAead_crypt(mcuxClSession_Handle_t session
One-shot authenticated encryption/decryption function.
Definition: mcuxCsslFlowProtection_example.c:137
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition: mcuxClKey_Types.h:87
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
Type definitions for the mcuxClAead component.
uint8_t *const mcuxCl_Buffer_t
Generic buffer typeThis type provides a pointer to the memory location that can be used for both read...
Definition: mcuxClCore_Buffer.h:51
Top-level include file for the mcuxClKey component.
uint32_t mcuxClAead_Status_t
AEAD status code.
Definition: mcuxClAead_Types.h:87
Type definitions for the mcuxClSession component.
const uint8_t *const mcuxCl_InputBuffer_t
Input buffer typeThis type provides a pointer to the memory location that should be used to read inpu...
Definition: mcuxClCore_Buffer.h:42