1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 
8 #ifndef _BSV_CRYPTO_DEFS_H
9 #define _BSV_CRYPTO_DEFS_H
10 
11 #ifdef __cplusplus
12 extern "C"
13 {
14 #endif
15 
16 /*! @file
17 @brief This file contains cryptographic ROM APIs definitions.
18 */
19 
20 /*! AES CMAC result size in words. */
21 #define CC_BSV_CMAC_RESULT_SIZE_IN_WORDS    4  /* 128b */
22 /*! AES CMAC result size in Bytes. */
23 #define CC_BSV_CMAC_RESULT_SIZE_IN_BYTES    16 /* 128b */
24 /*! AES CCM 128bit key size in Bytes. */
25 #define CC_BSV_CCM_KEY_SIZE_BYTES               16
26 /*! AES CCM 128bit key size in words. */
27 #define CC_BSV_CCM_KEY_SIZE_WORDS               4
28 /*! AES CCM NONCE size in Bytes. */
29 #define CC_BSV_CCM_NONCE_SIZE_BYTES     12
30 
31 
32 /*! Definitions for AES key types. */
33 typedef enum  {
34         /*! Root key (HUK).*/
35         CC_BSV_HUK_KEY = 0,
36         /*! RTL key (Krtl).*/
37         CC_BSV_RTL_KEY = 1,
38         /*! OEM Provision key (Kcp).*/
39         CC_BSV_PROV_KEY = 2,
40         /*! OEM Code encryption key (Kce).*/
41         CC_BSV_CE_KEY = 3,
42         /*! ICV Provision key (Kpicv).*/
43         CC_BSV_ICV_PROV_KEY = 4,
44         /*! ICV Code encryption key (Kceicv).*/
45         CC_BSV_ICV_CE_KEY = 5,
46         /*! User's key.*/
47         CC_BSV_USER_KEY = 6,
48         /*! Reserved.*/
49         CC_BSV_END_OF_KEY_TYPE = 0x7FFFFFFF
50 }CCBsvKeyType_t;
51 
52 
53 /*! CMAC result buffer. */
54 typedef uint32_t CCBsvCmacResult_t[CC_BSV_CMAC_RESULT_SIZE_IN_WORDS];
55 
56 /*! AES_CCM key buffer definition.*/
57 typedef uint32_t CCBsvCcmKey_t[CC_BSV_CCM_KEY_SIZE_WORDS];
58 
59 /*! AES_CCM nonce buffer definition.*/
60 typedef uint8_t CCBsvCcmNonce_t[CC_BSV_CCM_NONCE_SIZE_BYTES];
61 
62 /*! AES_CCM MAC buffer definition.*/
63 typedef uint8_t CCBsvCcmMacRes_t[CC_BSV_CMAC_RESULT_SIZE_IN_BYTES];
64 
65 
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif
72