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 @addtogroup cc_general_defs 9 @{ 10 */ 11 12 /*! 13 @file 14 @brief This file contains general definitions of the CryptoCell runtime SW APIs. 15 */ 16 17 18 #ifndef _CC_GENERAL_DEFS_H 19 #define _CC_GENERAL_DEFS_H 20 21 #ifdef __cplusplus 22 extern "C" 23 { 24 #endif 25 26 #include "cc_hash_defs.h" 27 28 /************************ Defines ******************************/ 29 /*! Hash parameters for HMAC operation. */ 30 typedef struct { 31 /*! The size of the HMAC hash result. */ 32 uint16_t hashResultSize; 33 /*! The hash operation mode. */ 34 CCHashOperationMode_t hashMode; 35 }HmacHash_t; 36 37 /*! The maximal size of the hash string. */ 38 #define CC_HASH_NAME_MAX_SIZE 10 39 /*! Hash parameters for HMAC operation. */ 40 extern const HmacHash_t HmacHashInfo_t[CC_HASH_NumOfModes]; 41 /*! Supported hash modes. */ 42 extern const uint8_t HmacSupportedHashModes_t[CC_HASH_NumOfModes]; 43 /*! Hash string names. */ 44 extern const char HashAlgMode2mbedtlsString[CC_HASH_NumOfModes][CC_HASH_NAME_MAX_SIZE]; 45 46 47 /* general definitions */ 48 /*-------------------------*/ 49 /*! Maximal size of AES HUK in bytes. */ 50 #define CC_AES_KDR_MAX_SIZE_BYTES 32 51 /*! Maximal size of AES HUK in words. */ 52 #define CC_AES_KDR_MAX_SIZE_WORDS (CC_AES_KDR_MAX_SIZE_BYTES/sizeof(uint32_t)) 53 54 55 /* Life-cycle states. */ 56 /*! The Chip Manufacturer (CM) LCS value. */ 57 #define CC_LCS_CHIP_MANUFACTURE_LCS 0x0 58 /*! The Secure LCS value. */ 59 #define CC_LCS_SECURE_LCS 0x5 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 /*! 66 @} 67 */ 68 #endif 69 70