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 #ifndef _CC_FFCDH_ERROR_H 9 #define _CC_FFCDH_ERROR_H 10 11 12 #include "cc_error.h" 13 14 15 #ifdef __cplusplus 16 extern "C" 17 { 18 #endif 19 20 /*! 21 @file 22 @brief This file contains error codes definitions for CryptoCell FFCDH module. 23 @defgroup ffccc_dh_error CryptoCell FFCDH specific errors 24 @{ 25 @ingroup cc_ffcdh 26 */ 27 /************************ Defines ******************************/ 28 29 /* FFCDH module on the CryptoCell layer base address - 0x00F02700 */ 30 31 /*! The CryptoCell FFCDH module errors */ 32 33 /*! Invalid input argument pointer. */ 34 #define CC_FFCDH_INVALID_ARGUMENT_POINTER_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x00UL) 35 /*! Invalid input argument size. */ 36 #define CC_FFCDH_INVALID_ARGUMENT_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x01UL) 37 /*! Invalid pointer to DH Context structure. */ 38 #define CC_FFCDH_INVALID_CONTEXT_PTR_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x02UL) 39 /*! Invalid DH Context validation Tag.*/ 40 #define CC_FFCDH_CONTEXT_VALIDATION_TAG_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x03UL) 41 /*! Invalid FFCDH Scheme ID. */ 42 #define CC_FFCDH_INVALID_SCHEM_ID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x04UL) 43 /*! Invalid FFCDH parameters set ID. */ 44 #define CC_FFCDH_INVALID_DOMAIN_SIZES_SET_ID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x05UL) 45 /*! Invalid FFCDH Key confirmation mode. */ 46 #define CC_FFCDH_INVALID_CONFIRM_MODE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x06UL) 47 /*! Invalid FFCDH User party ID. */ 48 #define CC_FFCDH_INVALID_USER_PARTY_ID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x07UL) 49 /*! Invalid FFCDH key derivation function mode. */ 50 #define CC_FFCDH_INVALID_KDF_MODE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x08UL) 51 /*! Invalid FFCDH Key validation mode. */ 52 #define CC_FFCDH_INVALID_VALIDAT_MODE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x09UL) 53 /*! Invalid HASH operation mode.*/ 54 #define CC_FFCDH_INVALID_HASH_MODE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x0AUL) 55 /*! Invalid HASH operation digest size is too low.*/ 56 #define CC_FFCDH_INVALID_LOW_HASH_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x0BUL) 57 /*! Invalid HMAC result size is too low.*/ 58 #define CC_FFCDH_INVALID_HMAC_SALT_PARAMS_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x0CUL) 59 /*! Invalid private key size. */ 60 #define CC_FFCDH_INVALID_PRIVATE_KEY_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x10UL) 61 /*! Invalid private key value. */ 62 #define CC_FFCDH_INVALID_PRIVATE_KEY_VALUE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x11UL) 63 /*! Invalid public key size. */ 64 #define CC_FFCDH_INVALID_PUBLIC_KEY_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x12UL) 65 /*! Invalid public key value. */ 66 #define CC_FFCDH_INVALID_PUBLIC_KEY_VALUE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x13UL) 67 /*! Invalid key status mode: static or ephemeral. */ 68 #define CC_FFCDH_INVALID_KEY_STATUS_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x14UL) 69 /*! Invalid rewriting of previously inserted parameter. */ 70 #define CC_FFCDH_ILLEGAL_TRY_REWRITE_PARAM_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x15UL) 71 /*! Invalid optional data parameters (pointer, size). */ 72 #define CC_FFCDH_OPTIONAL_DATA_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x16UL) 73 /*! Invalid parameters of Algorithm ID data (pointer, size). */ 74 #define CC_FFCDH_ALGORITHM_ID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x17UL) 75 /*! Invalid size of any Party Info entry (too great). */ 76 #define CC_FFCDH_PARTY_INFO_SUB_ENTRY_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x18UL) 77 /*! The User tries to pass Nonce, not required by DH Scheme. */ 78 #define CC_FFCDH_NONCE_IS_NOT_REQUIRED_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x19UL) 79 /*! The User tries to pass some Key, not required by DH Scheme. */ 80 #define CC_FFCDH_THE_KEY_IS_NOT_REQUIRED_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x1AUL) 81 /*! The output buffer is too low */ 82 #define CC_FFCDH_LOW_OUTPUT_BUFF_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x1BUL) 83 /*! Invalid size of Partner Info entry. */ 84 #define CC_FFCDH_PARTN_INFO_PARSING_SIZE_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x20UL) 85 /*! Error on parsing and comparing of Partner Info data . */ 86 #define CC_FFCDH_PARTN_INFO_PARSING_DATA_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x21UL) 87 /*! Invalid output pointer to Keying Data. */ 88 #define CC_FFCDH_KEYING_DATA_PTR_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x22UL) 89 /*! Invalid pointer to Keying Data size. */ 90 #define CC_FFCDH_KEYING_DATA_SIZE_PTR_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x23UL) 91 /*! Invalid size of output Keying Data buffer given by the user. */ 92 #define CC_FFCDH_KEYING_DATA_SIZE_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x24UL) 93 /*! Invalid pointer to MacTag output buffer. */ 94 #define CC_FFCDH_MAC_TAG_PTR_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x25UL) 95 /*! Invalid size of MacTag output buffer. */ 96 #define CC_FFCDH_MAC_TAG_SIZE_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x26UL) 97 /*! Calculated MacTag not matches to value, provided by the partner. */ 98 #define CC_FFCDH_MAC_TAG_DATA_INVALID_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x27UL) 99 /* Invalid FFC DH Domain pointer. */ 100 #define CC_FFCDH_INVALID_DOMAIN_PTR_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x30UL) 101 /*! Invalid validation Tag of user passed FFC Domain. */ 102 #define CC_FFCDH_INVALID_DOMAIN_VALIDAT_TAG_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x31UL) 103 /*! FFC Domain parameters not meet to required by input FFC sizes set ID or HASH mode. */ 104 #define CC_FFCDH_INVALID_DOMAIN_DATA_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x32UL) 105 /*! Invalid pointer to FFC DH Shared Secret Value. */ 106 #define CC_FFCDH_INVALID_SHARED_SECR_VAL_PTR_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x33UL) 107 /*! Invalid private key data pointer. */ 108 #define CC_FFCDH_INVALID_PRIV_KEY_PTR_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x34UL) 109 /*! invalid public key size. */ 110 #define CC_FFCDH_INVALID_PUBL_KEY_PTR_ERROR (CC_FFCDH_MODULE_ERROR_BASE + 0x35UL) 111 112 /*! FFC DH is not supported */ 113 #define CC_FFCDH_IS_NOT_SUPPORTED (CC_FFCDH_MODULE_ERROR_BASE + 0xFFUL) 114 115 116 /************************ Enums ********************************/ 117 118 119 /************************ Typedefs ****************************/ 120 121 122 /************************ Structs ******************************/ 123 124 125 /************************ Public Variables **********************/ 126 127 128 /************************ Public Functions **********************/ 129 130 131 132 133 #ifdef __cplusplus 134 } 135 #endif 136 /** 137 @} 138 */ 139 140 #endif 141 142