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-2026 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
56
111
118 uint32_t nonceLength,
120 uint32_t inLength,
122 uint32_t adataLength,
123 mcuxCl_Buffer_t pOut,
124 uint32_t * const pOutLength,
125 mcuxCl_Buffer_t pTag,
126 uint32_t tagLength
127);
128
181
188 uint32_t nonceLength,
190 uint32_t inLength,
192 uint32_t adataLength,
194 uint32_t tagLength,
195 mcuxCl_Buffer_t pOut,
196 uint32_t * const pOutLength
197);
198
199#ifdef MCUXCL_FEATURE_AEAD_SELFTEST
217MCUX_CSSL_FP_FUNCTION_DECL(mcuxClAead_selftest)
222); /* selftest */
223
224#endif /* MCUXCL_FEATURE_AEAD_SELFTEST */
261
265 mcuxClAead_Context_t * const pContext,
269 uint32_t nonceLength,
270 uint32_t inLength,
271 uint32_t adataLength,
272 uint32_t tagLength
273); /* init encrypt */
274
312
316 mcuxClAead_Context_t * const pContext,
320 uint32_t nonceLength,
321 uint32_t inLength,
322 uint32_t adataLength,
323 uint32_t tagLength
324); /* init decrypt */
325
353 mcuxClAead_Context_t * const pContext,
355 uint32_t inLength,
356 mcuxCl_Buffer_t pOut,
357 uint32_t * const pOutLength
358); /* update */
359
382 mcuxClAead_Context_t * const pContext,
384 uint32_t adataLength
385); /* update associated data */
386
414 mcuxClAead_Context_t * const pContext,
415 mcuxCl_Buffer_t pOut,
416 uint32_t * const pOutLength,
417 mcuxCl_Buffer_t pTag
418); /* finalize encrypt/decrypt + output tag */
419
449 mcuxClAead_Context_t * const pContext,
451 mcuxCl_Buffer_t pOut,
452 uint32_t * const pOutLength
453); /* finalize decrypt + compare tag */
454
456
457#ifdef __cplusplus
458} /* extern "C" */
459#endif
460
461#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_init_encrypt(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 initialization 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_encrypt(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 function.
mcuxClAead_Status_t mcuxClAead_init_decrypt(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 decryption initialization function.
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_decrypt(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_InputBuffer_t pTag, uint32_t tagLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength)
One-shot authenticated decryption 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
const mcuxClAead_TestDescriptor_t *const mcuxClAead_Test_t
Aead selftest mode/algorithm type.
Definition mcuxClAead_Types.h:106
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:111
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:118
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:186
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:158