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 errors definitions of the CryptoCell ChaCha-POLY APIs. 10 */ 11 12 /*! 13 @defgroup cc_chacha_poly_error Specific errors of the CryptoCell ChaCha-POLY APIs 14 @brief Contains the CryptoCell ChaCha-POLY-API errors definitions. See mbedtls_cc_chacha_poly_error.h. 15 @{ 16 @ingroup cc_chacha_poly 17 @} 18 */ 19 20 21 #ifndef _MBEDTLS_CC_CHACHA_POLY_ERROR_H 22 #define _MBEDTLS_CC_CHACHA_POLY_ERROR_H 23 24 25 #include "cc_error.h" 26 27 #ifdef __cplusplus 28 extern "C" 29 { 30 #endif 31 32 33 /************************ Defines ******************************/ 34 35 /* The base address of errors for the ChaCha-POLY module - 0x00F02400. */ 36 /*! Invalid additional data. */ 37 #define CC_CHACHA_POLY_ADATA_INVALID_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x01UL) 38 /*! Invalid input data. */ 39 #define CC_CHACHA_POLY_DATA_INVALID_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x02UL) 40 /*! Illegal encryption mode. */ 41 #define CC_CHACHA_POLY_ENC_MODE_INVALID_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x03UL) 42 /*! Illegal data size. */ 43 #define CC_CHACHA_POLY_DATA_SIZE_INVALID_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x04UL) 44 /*! Key-generation error. */ 45 #define CC_CHACHA_POLY_GEN_KEY_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x05UL) 46 /*! ChaCha key-generation error. */ 47 #define CC_CHACHA_POLY_ENCRYPTION_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x06UL) 48 /*! Authentication error. */ 49 #define CC_CHACHA_POLY_AUTH_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x07UL) 50 /*! MAC comparison error. */ 51 #define CC_CHACHA_POLY_MAC_ERROR (CC_CHACHA_POLY_MODULE_ERROR_BASE + 0x08UL) 52 53 /************************ Enums ********************************/ 54 55 /************************ Typedefs ****************************/ 56 57 /************************ Structs *****************************/ 58 59 /************************ Public Variables *********************/ 60 61 /************************ Public Functions *********************/ 62 63 #ifdef __cplusplus 64 } 65 #endif 66 67 #endif //_MBEDTLS_CC_CHACHA_POLY_ERROR_H 68 69