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_utils_errors 9 @{ 10 */ 11 12 /*! 13 @file 14 @brief This file contains the error definitions of the CryptoCell utility APIs. 15 */ 16 17 #ifndef _CC_UTIL_ERROR_H 18 #define _CC_UTIL_ERROR_H 19 20 #ifdef __cplusplus 21 extern "C" 22 { 23 #endif 24 25 /***********************/ 26 /* Util return codes */ 27 /***********************/ 28 /*! Success definition. */ 29 #define CC_UTIL_OK 0x00UL 30 /*! The error base address definition. */ 31 #define CC_UTIL_MODULE_ERROR_BASE 0x80000000 32 /*! Illegal key type. */ 33 #define CC_UTIL_INVALID_KEY_TYPE (CC_UTIL_MODULE_ERROR_BASE + 0x00UL) 34 /*! Illegal data-in pointer. */ 35 #define CC_UTIL_DATA_IN_POINTER_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x01UL) 36 /*! Illegal data-in size. */ 37 #define CC_UTIL_DATA_IN_SIZE_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x02UL) 38 /*! Illegal data-out pointer. */ 39 #define CC_UTIL_DATA_OUT_POINTER_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x03UL) 40 /*! Illegal data-out size. */ 41 #define CC_UTIL_DATA_OUT_SIZE_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x04UL) 42 /*! Fatal error. */ 43 #define CC_UTIL_FATAL_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x05UL) 44 /*! Illegal parameters. */ 45 #define CC_UTIL_ILLEGAL_PARAMS_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x06UL) 46 /*! Invalid address given. */ 47 #define CC_UTIL_BAD_ADDR_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x07UL) 48 /*! Illegal domain for endorsement key. */ 49 #define CC_UTIL_EK_DOMAIN_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x08UL) 50 /*! HUK is not valid. */ 51 #define CC_UTIL_KDR_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x09UL) 52 /*! LCS is not valid. */ 53 #define CC_UTIL_LCS_INVALID_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x0AUL) 54 /*! Session key is not valid. */ 55 #define CC_UTIL_SESSION_KEY_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x0BUL) 56 /*! Illegal user key size. */ 57 #define CC_UTIL_INVALID_USER_KEY_SIZE (CC_UTIL_MODULE_ERROR_BASE + 0x0DUL) 58 /*! Illegal LCS for the required operation. */ 59 #define CC_UTIL_ILLEGAL_LCS_FOR_OPERATION_ERR (CC_UTIL_MODULE_ERROR_BASE + 0x0EUL) 60 /*! Invalid PRF type. */ 61 #define CC_UTIL_INVALID_PRF_TYPE (CC_UTIL_MODULE_ERROR_BASE + 0x0FUL) 62 /*! Invalid hash mode. */ 63 #define CC_UTIL_INVALID_HASH_MODE (CC_UTIL_MODULE_ERROR_BASE + 0x10UL) 64 /*! Unsupported hash mode. */ 65 #define CC_UTIL_UNSUPPORTED_HASH_MODE (CC_UTIL_MODULE_ERROR_BASE + 0x11UL) 66 /*! Key is unusable */ 67 #define CC_UTIL_KEY_UNUSABLE_ERROR (CC_UTIL_MODULE_ERROR_BASE + 0x12UL) 68 #ifdef __cplusplus 69 } 70 #endif 71 72 /*! 73 @} 74 */ 75 #endif /*_CC_UTIL_ERROR_H*/ 76