1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef  _CC_ASSET_PROV_H
8 #define  _CC_ASSET_PROV_H
9 
10 /*!
11 @file
12 @brief This file contains the functions and definitions for the OEM Asset provisioning.
13 */
14 
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 #include "cc_bitops.h"
20 
21 #define ASSET_PROV_TOKEN    0x41736574UL
22 #define ASSET_PROV_VERSION      0x10000UL
23 
24 #define KPICV_KEY_SIZE      16
25 #define KPROV_KEY_SIZE      16
26 #define KPROV_DATA_IN_SIZE  8
27 #define ASSET_NONCE_SIZE    12
28 #define ASSET_RESERVED_SIZE     8
29 #define ASSET_RESERVED_WORD_SIZE    (8/CC_32BIT_WORD_SIZE)
30 #define ASSET_TAG_SIZE      16
31 #define ASSET_BLOCK_SIZE    16
32 #define MAX_ASSET_SIZE      512
33 #define ASSET_ADATA_SIZE    (3*CC_32BIT_WORD_SIZE+ASSET_RESERVED_SIZE)  // token||version||assetId||reserved
34 
35 typedef struct {
36         uint32_t  token;
37         uint32_t  version;
38         uint32_t  assetSize;
39         uint32_t  reserved[ASSET_RESERVED_WORD_SIZE];
40         uint8_t   nonce[ASSET_NONCE_SIZE];
41         uint8_t   encAsset[MAX_ASSET_SIZE+ASSET_TAG_SIZE];
42 }CCBsvAssetProv_t;
43 
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /*_CC_ASSET_PROV_H */
50