MCUX CLNS
MCUX Crypto Library Normal Secure
Loading...
Searching...
No Matches
mcuxClBuffer_Pointer.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2022-2025 NXP */
3/* */
4/* NXP Confidential and Proprietary. This software is owned or controlled */
5/* by NXP and may only be used strictly in accordance with the applicable */
6/* license terms. By expressly accepting such terms or by downloading, */
7/* installing, activating and/or otherwise using the software, you are */
8/* agreeing that you have read, and that you agree to comply with and are */
9/* bound by, such license terms. If you do not agree to be bound by the */
10/* applicable license terms, then you may not retain, install, activate or */
11/* otherwise use the software. */
12/*--------------------------------------------------------------------------*/
13
18
19#ifndef MCUXCLBUFFER_POINTER_H_
20#define MCUXCLBUFFER_POINTER_H_
21
22#include <mcuxClCore_Platform.h>
24
30
38typedef const uint8_t * mcuxCl_InputBuffer_t;
39
47typedef uint8_t * mcuxCl_Buffer_t;
48
59MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_import(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength);
60
71MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_export(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength);
72
86#define MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size) \
87 mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t)(_ptr)
88
102#define MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size) \
103 mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t)(_ptr)
104
118#define MCUXCLBUFFER_INIT_DMA_RO_IMPL(_name, _info, _ptr, _size) \
119 MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size)
120
134#define MCUXCLBUFFER_INIT_DMA_RW_IMPL(_name, _info, _ptr, _size) \
135 MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
136
151#define MCUXCLBUFFER_INIT_CUSTOM_IMPL(_name, _handler, _info, _spec, _ptr, _size) \
152 MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
153
154
163#define MCUXCLBUFFER_UPDATE_IMPL(_name, _offset) \
164 do { (_name) += (_offset); } while(false)
165
175#define MCUXCLBUFFER_DERIVE_RO_IMPL(_name, _original, _offset) \
176 mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t) &(_original)[_offset]
177
187#define MCUXCLBUFFER_DERIVE_RW_IMPL(_name, _original, _offset) \
188 mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t) &(_original)[_offset]
189
199#define MCUXCLBUFFER_SET_IMPL(_name, _ptr, _size) \
200 do { (_name) = (_ptr); } while(false)
201
209#define MCUXCLBUFFER_GET_IMPL(_name) \
210 (_name)
211
219#define MCUXCLBUFFER_IS_NULL_IMPL(_name) \
220 (NULL == MCUXCLBUFFER_GET_IMPL(_name))
221
222
223#endif /* MCUXCLBUFFER_POINTER_H_ */
uint32_t mcuxClBuffer_Status_t
Buffer status code.
Definition mcuxClBuffer_Constants.h:34
mcuxClBuffer_Status_t mcuxClBuffer_import(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength)
Perform a read from the buffer.
mcuxClBuffer_Status_t mcuxClBuffer_export(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength)
Perform a write to the buffer.
Provides the API for the CSSL flow protection mechanism.
const uint8_t * mcuxCl_InputBuffer_t
Input buffer type.
Definition mcuxClBuffer_Pointer.h:38
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:47
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:166
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:138