MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClAead_Functions.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2020-2024 NXP */
3/* */
4/* SPDX-License-Identifier: BSD-3-Clause */
5/* */
6/* Redistribution and use in source and binary forms, with or without */
7/* modification, are permitted provided that the following conditions are */
8/* met: */
9/* */
10/* 1. Redistributions of source code must retain the above copyright */
11/* notice, this list of conditions and the following disclaimer. */
12/* */
13/* 2. Redistributions in binary form must reproduce the above copyright */
14/* notice, this list of conditions and the following disclaimer in the */
15/* documentation and/or other materials provided with the distribution. */
16/* */
17/* 3. Neither the name of the copyright holder nor the names of its */
18/* contributors may be used to endorse or promote products derived from */
19/* this software without specific prior written permission. */
20/* */
21/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS */
22/* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED */
23/* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A */
24/* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
25/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
26/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
27/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR */
28/* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
29/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
30/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
31/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
32/*--------------------------------------------------------------------------*/
33
36
37#ifndef MCUXCLAEAD_FUNCTIONS_H_
38#define MCUXCLAEAD_FUNCTIONS_H_
39
40#include <mcuxClConfig.h> // Exported features flags header
41#include <mcuxClSession_Types.h>
42#include <mcuxClKey.h>
43#include <mcuxClAead_Types.h>
44#include <mcuxClBuffer.h>
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
106 uint32_t nonceLength,
108 uint32_t inLength,
110 uint32_t adataLength,
111 mcuxCl_Buffer_t pOut,
112 uint32_t * const pOutLength,
113 mcuxCl_Buffer_t pTag,
114 uint32_t tagLength
115);
116
145
149 mcuxClAead_Context_t * const pContext,
153 uint32_t nonceLength,
154 uint32_t inLength,
155 uint32_t adataLength,
156 uint32_t tagLength
157); /* init encrypt */
158
184 mcuxClAead_Context_t * const pContext,
186 uint32_t inLength,
187 mcuxCl_Buffer_t pOut,
188 uint32_t * const pOutLength
189); /* update */
190
211 mcuxClAead_Context_t * const pContext,
213 uint32_t adataLength
214); /* update associated data */
215
241 mcuxClAead_Context_t * const pContext,
242 mcuxCl_Buffer_t pOut,
243 uint32_t * const pOutLength,
244 mcuxCl_Buffer_t pTag
245); /* finalize encrypt/decrypt + output tag */
246
274 mcuxClAead_Context_t * const pContext,
276 mcuxCl_Buffer_t pOut,
277 uint32_t * const pOutLength
278); /* finalize decrypt + compare tag */
279
281
282#ifdef __cplusplus
283} /* extern "C" */
284#endif
285
286#endif /* MCUXCLAEAD_FUNCTION_H_ */
Type definitions for the mcuxClAead component.
Top-level include file for the mcuxClBuffer component.
Top-level include file for the mcuxClKey component.
Type definitions for the mcuxClSession component.
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.
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.
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...
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...
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.
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.
uint32_t mcuxClAead_Status_t
AEAD status code.
Definition mcuxClAead_Types.h:130
const mcuxClAead_ModeDescriptor_t *const mcuxClAead_Mode_t
AEAD mode/algorithm type.
Definition mcuxClAead_Types.h:83
struct mcuxClAead_Context mcuxClAead_Context_t
AEAD context type.
Definition mcuxClAead_Types.h:122
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:58
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:67
mcuxClKey_Descriptor_t *const mcuxClKey_Handle_t
Key handle type.
Definition mcuxClKey_Types.h:108
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:133
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:145
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:101