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-2024 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
19#ifndef MCUXCLBUFFER_POINTER_H_
20#define MCUXCLBUFFER_POINTER_H_
21
22#include <mcuxClCore_Platform.h>
24
46typedef const uint8_t * mcuxCl_InputBuffer_t;
47
55typedef uint8_t * mcuxCl_Buffer_t;
56
67MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_import(mcuxCl_InputBuffer_t bufSrc, uint32_t offset, uint8_t *pDst, uint32_t byteLength);
68
79MCUX_CSSL_FP_PROTECTED_TYPE(mcuxClBuffer_Status_t) mcuxClBuffer_export(mcuxCl_Buffer_t bufDst, uint32_t offset, const uint8_t *pSrc, uint32_t byteLength);
80
94#define MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size) \
95 mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t)(_ptr)
96
110#define MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size) \
111 mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t)(_ptr)
112
126#define MCUXCLBUFFER_INIT_DMA_RO_IMPL(_name, _info, _ptr, _size) \
127 MCUXCLBUFFER_INIT_PLAIN_RO_IMPL(_name, _info, _ptr, _size)
128
142#define MCUXCLBUFFER_INIT_DMA_RW_IMPL(_name, _info, _ptr, _size) \
143 MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
144
159#define MCUXCLBUFFER_INIT_CUSTOM_IMPL(_name, _handler, _info, _spec, _ptr, _size) \
160 MCUXCLBUFFER_INIT_PLAIN_RW_IMPL(_name, _info, _ptr, _size)
161
162
171#define MCUXCLBUFFER_UPDATE_IMPL(_name, _offset) \
172 do { (_name) += (_offset); } while(false)
173
183#define MCUXCLBUFFER_DERIVE_RO_IMPL(_name, _original, _offset) \
184 mcuxCl_InputBuffer_t (_name) = (mcuxCl_InputBuffer_t) &(_original)[_offset]
185
195#define MCUXCLBUFFER_DERIVE_RW_IMPL(_name, _original, _offset) \
196 mcuxCl_Buffer_t (_name) = (mcuxCl_Buffer_t) &(_original)[_offset]
197
207#define MCUXCLBUFFER_SET_IMPL(_name, _ptr, _size) \
208 do { (_name) = (_ptr); } while(false)
209
217#define MCUXCLBUFFER_GET_IMPL(_name) \
218 (_name)
219
227#define MCUXCLBUFFER_IS_NULL_IMPL(_name) \
228 (NULL == MCUXCLBUFFER_GET_IMPL(_name))
229
230
231#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:46
uint8_t * mcuxCl_Buffer_t
Input/output buffer type.
Definition mcuxClBuffer_Pointer.h:55
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:125
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:81