MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxCsslSecureCounter.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*/
2 /* Copyright 2020 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 MCUX_CSSL_SECURE_COUNTER_H_
20 #define MCUX_CSSL_SECURE_COUNTER_H_
21 
22 /* Include the actual implementation of the secure counter mechanism. */
23 #include <internal/mcuxCsslSecureCounter_Impl.h>
24 
42 /****************************************************************************/
43 /* Constants */
44 /****************************************************************************/
45 
52 #define MCUX_CSSL_SC_CHECK_PASSED \
53  MCUX_CSSL_SC_CHECK_PASSED_IMPL
54 
61 #define MCUX_CSSL_SC_CHECK_FAILED \
62  MCUX_CSSL_SC_CHECK_FAILED_IMPL
63 
70 #define MCUX_CSSL_SC_VALUE_TYPE \
71  MCUX_CSSL_SC_VALUE_TYPE_IMPL
72 
73 /****************************************************************************/
74 /* Initialization */
75 /****************************************************************************/
76 
83 #define MCUX_CSSL_SC_ALLOC() \
84  MCUX_CSSL_SC_ALLOC_IMPL()
85 
94 #define MCUX_CSSL_SC_INIT(value) \
95  MCUX_CSSL_SC_INIT_IMPL(value)
96 
97 /****************************************************************************/
98 /* Check */
99 /****************************************************************************/
100 
111 #define MCUX_CSSL_SC_CHECK(reference) \
112  MCUX_CSSL_SC_CHECK_IMPL(reference)
113 
114 /****************************************************************************/
115 /* Counter increment */
116 /****************************************************************************/
136 #define MCUX_CSSL_SC_ADD(value) \
137  MCUX_CSSL_SC_ADD_IMPL(value)
138 
150 #define MCUX_CSSL_SC_ADD_0x1() \
151  MCUX_CSSL_SC_ADD_0x1_IMPL()
152 
164 #define MCUX_CSSL_SC_ADD_0x10() \
165  MCUX_CSSL_SC_ADD_0x10_IMPL()
166 
178 #define MCUX_CSSL_SC_ADD_0x100() \
179  MCUX_CSSL_SC_ADD_0x100_IMPL()
180 
181 /****************************************************************************/
182 /* Counter decrement */
183 /****************************************************************************/
203 #define MCUX_CSSL_SC_SUB(value) \
204  MCUX_CSSL_SC_SUB_IMPL(value)
205 
217 #define MCUX_CSSL_SC_SUB_0x1() \
218  MCUX_CSSL_SC_SUB_0x1_IMPL()
219 
231 #define MCUX_CSSL_SC_SUB_0x10() \
232  MCUX_CSSL_SC_SUB_0x10_IMPL()
233 
245 #define MCUX_CSSL_SC_SUB_0x100() \
246  MCUX_CSSL_SC_SUB_0x100_IMPL()
247 
248 /****************************************************************************/
249 /* Direct access (optional) */
250 /****************************************************************************/
272 #define MCUX_CSSL_SC_VALUE() \
273  MCUX_CSSL_SC_VALUE_IMPL()
274 
288 #define MCUX_CSSL_SC_ASSIGN(value) \
289  MCUX_CSSL_SC_ASSIGN_IMPL(value)
290 
291 #endif /* MCUX_CSSL_SECURE_COUNTER_H_ */