1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _CC_AESCCM_ERROR_H
8 #define _CC_AESCCM_ERROR_H
9 
10 
11 #include "cc_error.h"
12 
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17 
18 /*!
19 @file
20 @brief This file contains the definitions of the CryptoCell AESCCM errors.
21 @defgroup cc_aesccm_error CryptoCell AES-CCM specific errors
22 @{
23 @ingroup cc_aesccm
24 
25 */
26 
27 /************************ Defines ******************************/
28 
29 /*! CryptoCell AESCCM module errors. CC_AESCCM_MODULE_ERROR_BASE = 0x00F01500 */
30 /*! Invalid context pointer. */
31 #define CC_AESCCM_INVALID_USER_CONTEXT_POINTER_ERROR     (CC_AESCCM_MODULE_ERROR_BASE + 0x00UL)
32 /*! Illegal key size. */
33 #define CC_AESCCM_ILLEGAL_KEY_SIZE_ERROR                 (CC_AESCCM_MODULE_ERROR_BASE + 0x01UL)
34 /*! Invalid key pointer. */
35 #define CC_AESCCM_INVALID_KEY_POINTER_ERROR              (CC_AESCCM_MODULE_ERROR_BASE + 0x02UL)
36 /*! Invalid encryption mode. */
37 #define CC_AESCCM_INVALID_ENCRYPT_MODE_ERROR             (CC_AESCCM_MODULE_ERROR_BASE + 0x03UL)
38 /*! Context is corrupted. */
39 #define CC_AESCCM_USER_CONTEXT_CORRUPTED_ERROR           (CC_AESCCM_MODULE_ERROR_BASE + 0x04UL)
40 /*! Invalid data in pointer. */
41 #define CC_AESCCM_DATA_IN_POINTER_INVALID_ERROR          (CC_AESCCM_MODULE_ERROR_BASE + 0x05UL)
42 /*! Invalid data out pointer. */
43 #define CC_AESCCM_DATA_OUT_POINTER_INVALID_ERROR         (CC_AESCCM_MODULE_ERROR_BASE + 0x06UL)
44 /*! Illegal data in size. */
45 #define CC_AESCCM_DATA_IN_SIZE_ILLEGAL                   (CC_AESCCM_MODULE_ERROR_BASE + 0x07UL)
46 /*! Illegal data in or data out address. */
47 #define CC_AESCCM_DATA_OUT_DATA_IN_OVERLAP_ERROR         (CC_AESCCM_MODULE_ERROR_BASE + 0x08UL)
48 /*! Illegal data out size. */
49 #define CC_AESCCM_DATA_OUT_SIZE_INVALID_ERROR            (CC_AESCCM_MODULE_ERROR_BASE + 0x09UL)
50 /*! Illegal call to process additional data. */
51 #define CC_AESCCM_ADDITIONAL_BLOCK_NOT_PERMITTED_ERROR   (CC_AESCCM_MODULE_ERROR_BASE + 0x0AUL)
52 /*! Illegal dma buffer type. */
53 #define CC_AESCCM_ILLEGAL_DMA_BUFF_TYPE_ERROR            (CC_AESCCM_MODULE_ERROR_BASE + 0x0BUL)
54 /*! Illegal parameter size. */
55 #define CC_AESCCM_ILLEGAL_PARAMETER_SIZE_ERROR           (CC_AESCCM_MODULE_ERROR_BASE + 0x0CUL)
56 /*! Invalid parameter pointer. */
57 #define CC_AESCCM_ILLEGAL_PARAMETER_PTR_ERROR            (CC_AESCCM_MODULE_ERROR_BASE + 0x0DUL)
58 /*! Invalid data type. */
59 #define CC_AESCCM_ILLEGAL_DATA_TYPE_ERROR                (CC_AESCCM_MODULE_ERROR_BASE + 0x0EUL)
60 /*! CCM MAC compare failure. */
61 #define CC_AESCCM_CCM_MAC_INVALID_ERROR                  (CC_AESCCM_MODULE_ERROR_BASE + 0x0FUL)
62 /*! Illegal operation. */
63 #define CC_AESCCM_LAST_BLOCK_NOT_PERMITTED_ERROR         (CC_AESCCM_MODULE_ERROR_BASE + 0x10UL)
64 /*! Illegal parameter. */
65 #define CC_AESCCM_ILLEGAL_PARAMETER_ERROR                (CC_AESCCM_MODULE_ERROR_BASE + 0x11UL)
66 /*! Additional data input size is incorrect. */
67 #define CC_AESCCM_NOT_ALL_ADATA_WAS_PROCESSED_ERROR      (CC_AESCCM_MODULE_ERROR_BASE + 0x13UL)
68 /*! Text data input size is incorrect. */
69 #define CC_AESCCM_NOT_ALL_DATA_WAS_PROCESSED_ERROR       (CC_AESCCM_MODULE_ERROR_BASE + 0x14UL)
70 /*! Additional data was already processed (must be processed only once). */
71 #define CC_AESCCM_ADATA_WAS_PROCESSED_ERROR          (CC_AESCCM_MODULE_ERROR_BASE + 0x15UL)
72 /*! Illegal Nonce size. */
73 #define CC_AESCCM_ILLEGAL_NONCE_SIZE_ERROR       (CC_AESCCM_MODULE_ERROR_BASE + 0x16UL)
74 /*! Illegal tag (MAC) size. */
75 #define CC_AESCCM_ILLEGAL_TAG_SIZE_ERROR         (CC_AESCCM_MODULE_ERROR_BASE + 0x17UL)
76 /*! Illegal context size. */
77 #define CC_AESCCM_CTX_SIZES_ERROR            (CC_AESCCM_MODULE_ERROR_BASE + 0x28UL)
78 /*! Illegal parameters. */
79 #define CC_AESCCM_ILLEGAL_PARAMS_ERROR           (CC_AESCCM_MODULE_ERROR_BASE + 0x29UL)
80 /*! AESCCM is not supported. */
81 #define CC_AESCCM_IS_NOT_SUPPORTED                       (CC_AESCCM_MODULE_ERROR_BASE + 0xFFUL)
82 
83 /************************ Enums ********************************/
84 
85 /************************ Typedefs  ****************************/
86 
87 /************************ Structs  *****************************/
88 
89 /************************ Public Variables *********************/
90 
91 /************************ Public Functions *********************/
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 /**
97 @}
98  */
99 
100 
101 #endif /* _CC_AESCCM_ERROR_H */
102 
103 
104