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 error definitions of the CryptoCell ChaCha APIs.
10  */
11 
12 /*!
13  @defgroup cc_chacha_error Specific errors of the CryptoCell ChaCha APIs
14  @brief Contains the CryptoCell ChaCha-API error definitions. See mbedtls_cc_chacha_error.h.
15 
16  @{
17  @ingroup cc_chacha
18  @}
19  */
20 
21 #ifndef _MBEDTLS_CC_CHACHA_ERROR_H
22 #define _MBEDTLS_CC_CHACHA_ERROR_H
23 
24 #include "cc_error.h"
25 
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30 
31 
32 
33 
34 
35 /************************ Defines ******************************/
36 
37 /* The base address of errors for the ChaCha module - 0x00F02200. */
38 /*! Illegal Nonce. */
39 #define CC_CHACHA_INVALID_NONCE_ERROR                           (CC_CHACHA_MODULE_ERROR_BASE + 0x01UL)
40 /*! Illegal key size. */
41 #define CC_CHACHA_ILLEGAL_KEY_SIZE_ERROR                    (CC_CHACHA_MODULE_ERROR_BASE + 0x02UL)
42 /*! Illegal key pointer. */
43 #define CC_CHACHA_INVALID_KEY_POINTER_ERROR                 (CC_CHACHA_MODULE_ERROR_BASE + 0x03UL)
44 /*! Illegal operation mode. */
45 #define CC_CHACHA_INVALID_ENCRYPT_MODE_ERROR                (CC_CHACHA_MODULE_ERROR_BASE + 0x04UL)
46 /*! Illegal data-in pointer. */
47 #define CC_CHACHA_DATA_IN_POINTER_INVALID_ERROR             (CC_CHACHA_MODULE_ERROR_BASE + 0x05UL)
48 /*! Illegal data-out pointer. */
49 #define CC_CHACHA_DATA_OUT_POINTER_INVALID_ERROR            (CC_CHACHA_MODULE_ERROR_BASE + 0x06UL)
50 /*! Illegal user context. */
51 #define CC_CHACHA_INVALID_USER_CONTEXT_POINTER_ERROR            (CC_CHACHA_MODULE_ERROR_BASE + 0x07UL)
52 /*! Illegal user context size. */
53 #define CC_CHACHA_CTX_SIZES_ERROR                               (CC_CHACHA_MODULE_ERROR_BASE + 0x08UL)
54 /*! Illegal nonce pointer. */
55 #define CC_CHACHA_INVALID_NONCE_PTR_ERROR                       (CC_CHACHA_MODULE_ERROR_BASE + 0x09UL)
56 /*! Illegal data-in size. */
57 #define CC_CHACHA_DATA_IN_SIZE_ILLEGAL                          (CC_CHACHA_MODULE_ERROR_BASE + 0x0AUL)
58 /*! General error. */
59 #define CC_CHACHA_GENERAL_ERROR                         (CC_CHACHA_MODULE_ERROR_BASE + 0x0BUL)
60 /*! ChaCha is not supported. */
61 #define CC_CHACHA_IS_NOT_SUPPORTED                          (CC_CHACHA_MODULE_ERROR_BASE + 0xFFUL)
62 
63 /************************ Enums ********************************/
64 
65 /************************ Typedefs  ****************************/
66 
67 /************************ Structs  *****************************/
68 
69 /************************ Public Variables *********************/
70 
71 /************************ Public Functions *********************/
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif//_MBEDTLS_CC_CHACHA_ERROR_H
78