MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClCore_Examples.h
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020-2023 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 
14 #ifndef MCUXCLCORE_EXAMPLES_H_
15 #define MCUXCLCORE_EXAMPLES_H_
16 
17 #include <mcuxClCore_Platform.h>
18 #include <mcuxCsslFlowProtection.h>
19 
24 // TODO CLNS-3599: #define MCUXCLEXAMPLE_FUNCTION(_name) uint32_t _name(void)
25 #define MCUXCLEXAMPLE_FUNCTION(_name) bool _name(void)
26 
31 #define MCUXCLEXAMPLE_STATUS_OK true // TODO CLNS-3599: 0xC001C0DEu
32 
38 #define MCUXCLEXAMPLE_OK MCUXCLEXAMPLE_STATUS_OK
39 
44 #define MCUXCLEXAMPLE_STATUS_ERROR false // TODO CLNS-3599: 0xEEEEEEEEu
45 
51 #define MCUXCLEXAMPLE_ERROR MCUXCLEXAMPLE_STATUS_ERROR
52 
53 
58 #define MCUXCLEXAMPLE_STATUS_FAILURE false // TODO CLNS-3599: 0xFFFFFFFFu
59 
65 #define MCUXCLEXAMPLE_FAILURE MCUXCLEXAMPLE_STATUS_FAILURE
66 
70 #define MCUXCLEXAMPLE_MAX( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
71 
75 #define MCUXCLEXAMPLE_CEILING(x,y) (((x) + (y) - 1U) / (y))
76 
80 MCUX_CSSL_FP_FUNCTION_DEF(mcuxClCore_assertEqual)
81 static inline bool mcuxClCore_assertEqual(const uint8_t * const x, const uint8_t * const y, uint32_t length)
82 {
83  for (uint32_t i = 0; i < length; ++i)
84  {
85  if (x[i] != y[i])
86  {
87  return false;
88  }
89  }
90 
91  return true;
92 }
93 
94 #endif /* MCUXCLCORE_EXAMPLES_H_ */
Provides the API for the CSSL flow protection mechanism.
#define MCUX_CSSL_FP_FUNCTION_DEF(...)
Definition of a flow protected function.
Definition: mcuxCsslFlowProtection.h:159