1 /*
2  * Copyright (c) 2017-2020 ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _CC_SEC_DEFS_H
8 #define _CC_SEC_DEFS_H
9 
10 /*!
11 @file
12 @brief This file contains general definitions and types.
13 */
14 
15 
16 #ifdef __cplusplus
17 extern "C"
18 {
19 #endif
20 
21 #include "cc_pal_types.h"
22 
23 /*! Hashblock size in words. */
24 #define HASH_BLOCK_SIZE_IN_WORDS             16
25 /*! Hash - SHA2 results in words. */
26 #define HASH_RESULT_SIZE_IN_WORDS            8
27 /*! Hash - SHA2 results in bytes. */
28 #define HASH_RESULT_SIZE_IN_BYTES            32
29 
30 /*! Definition for hash result array. */
31 typedef uint32_t CCHashResult_t[HASH_RESULT_SIZE_IN_WORDS];
32 
33 /*! Definition for converting pointer to Host address. */
34 #define CONVERT_TO_ADDR(ptr) 	(unsigned long)ptr
35 
36 /*! Definition for converting pointer to SRAM address. */
37 #define CONVERT_TO_SRAM_ADDR(ptr)    (0xFFFFFFFF & ptr)
38 
39 /*! The data size of the signed SW image, in bytes. */
40 /*!\internal ContentCertImageRecord_t includes:  HS(8W) + 64-b dstAddr(2W) + imgSize(1W) + isCodeEncUsed(1W) */
41 #define SW_REC_SIGNED_DATA_SIZE_IN_BYTES            48
42 
43 /*! The data size of the unsigned SW image, in bytes. */
44 /*!\internal CCSbSwImgAddData_t includes: 64-b srcAddr(2W)*/
45 #define SW_REC_NONE_SIGNED_DATA_SIZE_IN_BYTES       8
46 
47 /*! The additional data size - storage address and length of the unsigned SW image, in words. */
48 #define SW_REC_NONE_SIGNED_DATA_SIZE_IN_WORDS       SW_REC_NONE_SIGNED_DATA_SIZE_IN_BYTES/CC_32BIT_WORD_SIZE
49 
50 /*! The additional data section size, in bytes. */
51 #define CC_SB_MAX_SIZE_ADDITIONAL_DATA_BYTES    128
52 
53 /*! Indication of whether or not to load the SW image to memory. */
54 #define CC_SW_COMP_NO_MEM_LOAD_INDICATION       0xFFFFFFFFFFFFFFFFUL
55 
56 /*! Indication of product version, stored in certificate version field. */
57 #define CC_SB_CERT_VERSION_PROJ_PRD             0x713
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif
64 
65 /**
66 @}
67  */
68 
69 
70 
71