MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClOscca_Memory.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/* Copyright 2016, 2021, 2023-2024 NXP */
3/* */
4/* NXP Proprietary. 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 */
10/* license terms, then you may not retain, install, activate or otherwise */
11/* use the software. */
12/*--------------------------------------------------------------------------*/
13
21#ifndef MCUXCLOSCCA_MEMORY_H_
22#define MCUXCLOSCCA_MEMORY_H_
23
24#include <mcuxClConfig.h> // Exported features flags header
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define MCUXCLOSCCA_SIZE_ALIGN_OFFSET (sizeof(uint32_t) - 1U)
33
34#define mcuxClOscca_alignAddress(address) \
35 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("The resulting address is carefully calculated, the cast to a pointer-type is safe.") \
36 ((uint8_t *)( (((uint32_t)(address)) + (sizeof(uint32_t) - 1U)) \
37 & ((uint32_t)(~(sizeof(uint32_t) - 1U))) )) \
38 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER()
39
40#define mcuxClOscca_alignSize(size) \
41 ((uint32_t)(((uint32_t)(size)) + (sizeof(uint32_t) - 1U)) \
42 & ((uint32_t)(~(sizeof(uint32_t) - 1U))) )
43
44#define mcuxClOscca_alignAddressWithOffset(address, offset) \
45 MCUX_CSSL_ANALYSIS_START_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER("The resulting address is carefully calculated, the cast to a pointer-type is safe.") \
46 ((uint8_t *)( (((uint32_t)(address) + (uint32_t)(offset)) + (sizeof(uint32_t) - 1U)) \
47 & ((uint32_t)(~(sizeof(uint32_t) - 1U))) )) \
48 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_TYPECAST_BETWEEN_INTEGER_AND_POINTER()
49
50#define mcuxClOscca_alignAddressToBoundary(address, boundary) \
51 ((uint8_t *)( (((uint32_t)(address)) + (boundary - 1U)) \
52 & ((uint32_t)(~(boundary - 1U))) ))
53
54MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOscca_FastSecureXor)
55MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClOscca_FastSecureXor(void *pTgt,
56 void *pSrc1,
57 void *pSrc2,
58 uint32_t length);
59
60MCUX_CSSL_FP_FUNCTION_DECL(mcuxClOscca_switch_endianness)
61MCUX_CSSL_FP_PROTECTED_TYPE(void) mcuxClOscca_switch_endianness(uint32_t *ptr, uint32_t length);
62
63#ifdef __cplusplus
64} /* extern "C" */
65#endif
66
67#endif /* MCUXCLOSCCA_MEMORY_H_ */
Definition of function identifiers for the flow protection mechanism.
Provides the API for the CSSL flow protection mechanism.
#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