1 /* 2 * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 /* this file contains the definitions of the hashes used in the rsa */ 8 9 #include "cc_hash_defs.h" 10 #include "cc_general_defs.h" 11 12 const HmacHash_t HmacHashInfo_t[CC_HASH_NumOfModes] = { 13 /*CC_HASH_SHA1_mode */ {CC_HASH_SHA1_DIGEST_SIZE_IN_BYTES, CC_HASH_SHA1_mode}, 14 /*CC_HASH_SHA224_mode */ {CC_HASH_SHA224_DIGEST_SIZE_IN_BYTES, CC_HASH_SHA224_mode}, 15 /*CC_HASH_SHA256_mode */ {CC_HASH_SHA256_DIGEST_SIZE_IN_BYTES, CC_HASH_SHA256_mode}, 16 /*CC_HASH_SHA384_mode */ {CC_HASH_SHA384_DIGEST_SIZE_IN_BYTES, CC_HASH_SHA384_mode}, 17 /*CC_HASH_SHA512_mode */ {CC_HASH_SHA512_DIGEST_SIZE_IN_BYTES, CC_HASH_SHA512_mode}, 18 /*CC_HASH_MD5_mode */ {CC_HASH_MD5_DIGEST_SIZE_IN_BYTES, CC_HASH_MD5_mode}, 19 }; 20 21 const uint8_t HmacSupportedHashModes_t[CC_HASH_NumOfModes] = { 22 /*CC_HASH_SHA1_mode */ CC_TRUE, 23 /*CC_HASH_SHA224_mode */ CC_TRUE, 24 /*CC_HASH_SHA256_mode */ CC_TRUE, 25 /*CC_HASH_SHA384_mode */ CC_TRUE, 26 /*CC_HASH_SHA512_mode */ CC_TRUE, 27 /*CC_HASH_MD5_mode */ CC_FALSE, 28 }; 29 30 const char HashAlgMode2mbedtlsString[CC_HASH_NumOfModes][CC_HASH_NAME_MAX_SIZE] = { 31 "SHA1", 32 "SHA224", 33 "SHA256", 34 "SHA384", 35 "SHA512", 36 "MD5" 37 }; 38 39