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 #include <mcuxClSession_Types.h>
22 #include <mcuxClKey.h>
23 #include <mcuxClAead_Types.h>
24 #include <mcuxClCore_Buffer.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
80  mcuxClSession_Handle_t session,
82  mcuxClAead_Mode_t mode,
83  mcuxCl_InputBuffer_t pNonce,
84  uint32_t nonceLength,
86  uint32_t inLength,
87  mcuxCl_InputBuffer_t pAdata,
88  uint32_t adataLength,
89  mcuxCl_Buffer_t pOut,
90  uint32_t * const pOutLength,
91  mcuxCl_Buffer_t pTag,
92  uint32_t tagLength
93 );
94 
126  mcuxClSession_Handle_t session,
127  mcuxClAead_Context_t * const pContext,
128  mcuxClKey_Handle_t key,
129  mcuxClAead_Mode_t mode,
130  mcuxCl_InputBuffer_t pNonce,
131  uint32_t nonceLength,
132  uint32_t inLength,
133  uint32_t adataLength,
134  uint32_t tagLength
135 ); /* init encrypt */
136 
161  mcuxClSession_Handle_t session,
162  mcuxClAead_Context_t * const pContext,
164  uint32_t inLength,
165  mcuxCl_Buffer_t pOut,
166  uint32_t * const pOutLength
167 ); /* update */
168 
188  mcuxClSession_Handle_t session,
189  mcuxClAead_Context_t * const pContext,
190  mcuxCl_InputBuffer_t pAdata,
191  uint32_t adataLength
192 ); /* update associated data */
193 
218  mcuxClSession_Handle_t session,
219  mcuxClAead_Context_t * const pContext,
220  mcuxCl_Buffer_t pOut,
221  uint32_t * const pOutLength,
222  mcuxCl_Buffer_t pTag
223 ); /* finalize encrypt/decrypt + output tag */
224 
251  mcuxClSession_Handle_t session,
252  mcuxClAead_Context_t * const pContext,
254  mcuxCl_Buffer_t pOut,
255  uint32_t * const pOutLength
256 ); /* finalize decrypt + compare tag */
257 
260 #ifdef __cplusplus
261 } /* extern "C" */
262 #endif
263 
264 #endif /* MCUXCLAEAD_FUNCTION_H_ */
mcuxClAead_Status_t mcuxClAead_finish(mcuxClSession_Handle_t session, mcuxClAead_Context_t *const pContext, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength, mcuxCl_Buffer_t pTag)
Multi-part authenticated encryption/decryption finalization function.
uint32_t mcuxClAead_Status_t
AEAD status code.
Definition: mcuxClAead_Types.h:110
struct mcuxClAead_Context mcuxClAead_Context_t
AEAD context type.
Definition: mcuxClAead_Types.h:102
Top-level include file for the mcuxClKey component.
mcuxClAead_Status_t mcuxClAead_process(mcuxClSession_Handle_t session, mcuxClAead_Context_t *const pContext, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength)
Multi-part authenticated encryption/decryption processing function for the regular data (authenticate...
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition: mcuxClKey_Types.h:88
mcuxClAead_Status_t mcuxClAead_verify(mcuxClSession_Handle_t session, mcuxClAead_Context_t *const pContext, mcuxCl_InputBuffer_t pTag, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength)
Multi-part authenticated decryption verification function.
mcuxClAead_Status_t mcuxClAead_crypt(mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClAead_Mode_t mode, mcuxCl_InputBuffer_t pNonce, uint32_t nonceLength, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_InputBuffer_t pAdata, uint32_t adataLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength, mcuxCl_Buffer_t pTag, uint32_t tagLength)
One-shot authenticated encryption/decryption function.
Type definitions for the mcuxClAead component.
mcuxClAead_Status_t mcuxClAead_process_adata(mcuxClSession_Handle_t session, mcuxClAead_Context_t *const pContext, mcuxCl_InputBuffer_t pAdata, uint32_t adataLength)
Multi-part authenticated encryption/decryption processing function for the associated data (authentic...
Type definitions for the mcuxClSession component.
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition: mcuxCsslFlowProtection.h:125
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition: mcuxClSession_Types.h:133
const mcuxClAead_ModeDescriptor_t *const mcuxClAead_Mode_t
AEAD mode/algorithm type.
Definition: mcuxClAead_Types.h:63
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition: mcuxCsslFlowProtection.h:81
mcuxClAead_Status_t mcuxClAead_init(mcuxClSession_Handle_t session, mcuxClAead_Context_t *const pContext, mcuxClKey_Handle_t key, mcuxClAead_Mode_t mode, mcuxCl_InputBuffer_t pNonce, uint32_t nonceLength, uint32_t inLength, uint32_t adataLength, uint32_t tagLength)
Multi-part authenticated encryption/decryption initialization function.
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
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