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 @file 9 @brief This file contains the definitions of the CryptoCell AES errors. 10 @defgroup cc_aes_error CryptoCell AES specific errors 11 @{ 12 @ingroup cc_aes 13 */ 14 15 #ifndef CC_AES_ERROR_H 16 #define CC_AES_ERROR_H 17 18 #include "cc_error.h" 19 20 #ifdef __cplusplus 21 extern "C" 22 { 23 #endif 24 25 /************************ Defines ******************************/ 26 27 /*! CC_AES_MODULE_ERROR_BASE - 0x00F00000 */ 28 /*! Illegal user context. */ 29 #define CC_AES_INVALID_USER_CONTEXT_POINTER_ERROR (CC_AES_MODULE_ERROR_BASE + 0x00UL) 30 /*! Illegal IV or tweak pointer. */ 31 #define CC_AES_INVALID_IV_OR_TWEAK_PTR_ERROR (CC_AES_MODULE_ERROR_BASE + 0x01UL) 32 /*! Illegal operation. */ 33 #define CC_AES_ILLEGAL_OPERATION_MODE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x02UL) 34 /*! Illegal key size. */ 35 #define CC_AES_ILLEGAL_KEY_SIZE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x03UL) 36 /*! Illegal key pointer. */ 37 #define CC_AES_INVALID_KEY_POINTER_ERROR (CC_AES_MODULE_ERROR_BASE + 0x04UL) 38 /*! Unsupported key type. */ 39 #define CC_AES_KEY_TYPE_NOT_SUPPORTED_ERROR (CC_AES_MODULE_ERROR_BASE + 0x05UL) 40 /*! Illegal operation. */ 41 #define CC_AES_INVALID_ENCRYPT_MODE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x06UL) 42 /*! User context corrupted. */ 43 #define CC_AES_USER_CONTEXT_CORRUPTED_ERROR (CC_AES_MODULE_ERROR_BASE + 0x07UL) 44 /*! Illegal data in pointer. */ 45 #define CC_AES_DATA_IN_POINTER_INVALID_ERROR (CC_AES_MODULE_ERROR_BASE + 0x08UL) 46 /*! Illegal data out pointer. */ 47 #define CC_AES_DATA_OUT_POINTER_INVALID_ERROR (CC_AES_MODULE_ERROR_BASE + 0x09UL) 48 /*! Illegal data in size. */ 49 #define CC_AES_DATA_IN_SIZE_ILLEGAL (CC_AES_MODULE_ERROR_BASE + 0x0AUL) 50 /*! Illegal data out address. */ 51 #define CC_AES_DATA_OUT_DATA_IN_OVERLAP_ERROR (CC_AES_MODULE_ERROR_BASE + 0x0BUL) 52 /*! Illegal data in buffer size. */ 53 #define CC_AES_DATA_IN_BUFFER_SIZE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x0CUL) 54 /*! Illegal data out buffer size. */ 55 #define CC_AES_DATA_OUT_BUFFER_SIZE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x0DUL) 56 /*! Illegal padding type. */ 57 #define CC_AES_ILLEGAL_PADDING_TYPE_ERROR (CC_AES_MODULE_ERROR_BASE + 0x0EUL) 58 /*! Incorrect padding. */ 59 #define CC_AES_INCORRECT_PADDING_ERROR (CC_AES_MODULE_ERROR_BASE + 0x0FUL) 60 /*! Output is corrupted. */ 61 #define CC_AES_CORRUPTED_OUTPUT_ERROR (CC_AES_MODULE_ERROR_BASE + 0x10UL) 62 /*! Illegal output size. */ 63 #define CC_AES_DATA_OUT_SIZE_POINTER_INVALID_ERROR (CC_AES_MODULE_ERROR_BASE + 0x11UL) 64 /*! Decryption operation is not permitted in this mode. */ 65 #define CC_AES_DECRYPTION_NOT_ALLOWED_ON_THIS_MODE (CC_AES_MODULE_ERROR_BASE + 0x12UL) 66 /*! Additional block operation is not permitted. */ 67 #define CC_AES_ADDITIONAL_BLOCK_NOT_PERMITTED_ERROR (CC_AES_MODULE_ERROR_BASE + 0x15UL) 68 /*! Illegal context size. */ 69 #define CC_AES_CTX_SIZES_ERROR (CC_AES_MODULE_ERROR_BASE + 0x16UL) 70 /*! Illegal parameters. */ 71 #define CC_AES_ILLEGAL_PARAMS_ERROR (CC_AES_MODULE_ERROR_BASE + 0x60UL) 72 /*! Illegal CTR block offset. */ 73 #define CC_AES_CTR_ILLEGAL_BLOCK_OFFSET_ERROR (CC_AES_MODULE_ERROR_BASE + 0x70UL) 74 /*! Illegal counter (in CTR mode). */ 75 #define CC_AES_CTR_ILLEGAL_COUNTER_ERROR (CC_AES_MODULE_ERROR_BASE + 0x71UL) 76 /*! AES is not supported. */ 77 #define CC_AES_IS_NOT_SUPPORTED (CC_AES_MODULE_ERROR_BASE + 0xFFUL) 78 79 /************************ Enums ********************************/ 80 81 /************************ Typedefs ****************************/ 82 83 /************************ Structs *****************************/ 84 85 /************************ Public Variables *********************/ 86 87 /************************ Public Functions *********************/ 88 89 #ifdef __cplusplus 90 } 91 #endif 92 /** 93 @} 94 */ 95 96 #endif /* #ifndef CC_AES_ERROR_H */ 97