1 /*
2  * Copyright (c) 2024 Nuvoton Technology Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _NUVOTON_NPCX_SOC_NCL_H_
8 #define _NUVOTON_NPCX_SOC_NCL_H_
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /* The status code returns from Nuvoton Cryptographic Library ROM APIs */
15 enum ncl_status {
16 	NCL_STATUS_OK = 0xA5A5,
17 	NCL_STATUS_FAIL = 0x5A5A,
18 	NCL_STATUS_INVALID_PARAM = 0x02,
19 	NCL_STATUS_PARAM_NOT_SUPPORTED = 0x03,
20 	NCL_STATUS_SYSTEM_BUSY = 0x04,
21 	NCL_STATUS_AUTHENTICATION_FAIL = 0x05,
22 	NCL_STATUS_NO_RESPONSE = 0x06,
23 	NCL_STATUS_HARDWARE_ERROR = 0x07
24 };
25 
26 enum ncl_sha_type {
27 	NCL_SHA_TYPE_2_256 = 0,
28 	NCL_SHA_TYPE_2_384 = 1,
29 	NCL_SHA_TYPE_2_512 = 2,
30 	NCL_SHA_TYPE_NUM
31 };
32 
33 /*
34  * This enum defines the security strengths supported by this DRBG mechanism.
35  * The internally generated entropy and nonce sizes are derived from these
36  * values. The supported actual sizes:
37  *       Security strength (bits)    112 128 192 256 128_Test 256_Test
38  *
39  *       Entropy size (Bytes)        32  48  64  96  111      128
40  *       Nonce size (Bytes)          16  16  24  32  16       0
41  */
42 enum ncl_drbg_security_strength {
43 	NCL_DRBG_SECURITY_STRENGTH_112B = 0,
44 	NCL_DRBG_SECURITY_STRENGTH_128B,
45 	NCL_DRBG_SECURITY_STRENGTH_192B,
46 	NCL_DRBG_SECURITY_STRENGTH_256B,
47 	NCL_DRBG_SECURITY_STRENGTH_128B_TEST,
48 	NCL_DRBG_SECURITY_STRENGTH_256B_TEST,
49 	NCL_DRBG_MAX_SECURITY_STRENGTH
50 };
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* _NUVOTON_NPCX_SOC_NCL_H_ */
57