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_RND_ERROR_H 9 #define _CC_RND_ERROR_H 10 11 #include "cc_error.h" 12 13 #ifdef __cplusplus 14 extern "C" 15 { 16 #endif 17 18 19 /*! 20 @file 21 @brief This file contains the definitions of the CryptoCell RND errors. 22 @defgroup cc_rnd_error CryptoCell RND specific errors 23 @{ 24 @ingroup cc_rnd 25 */ 26 27 28 /************************ Defines ******************************/ 29 /*! RND module on the CryptoCell layer base address - 0x00F00C00 */ 30 /*! Illegal output pointer.*/ 31 #define CC_RND_DATA_OUT_POINTER_INVALID_ERROR (CC_RND_MODULE_ERROR_BASE + 0x0UL) 32 /*! Random generation in range failed .*/ 33 #define CC_RND_CAN_NOT_GENERATE_RAND_IN_RANGE (CC_RND_MODULE_ERROR_BASE + 0x1UL) 34 /*! CPRNGT test failed.*/ 35 #define CC_RND_CPRNG_TEST_FAIL_ERROR (CC_RND_MODULE_ERROR_BASE + 0x2UL) 36 /*! Illegal additional data buffer. */ 37 #define CC_RND_ADDITIONAL_INPUT_BUFFER_NULL (CC_RND_MODULE_ERROR_BASE + 0x3UL) 38 /*! Illegal additional data size. */ 39 #define CC_RND_ADDITIONAL_INPUT_SIZE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x4UL) 40 /*! Data size overflow. */ 41 #define CC_RND_DATA_SIZE_OVERFLOW_ERROR (CC_RND_MODULE_ERROR_BASE + 0x5UL) 42 /*! Illegal vector size. */ 43 #define CC_RND_VECTOR_SIZE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x6UL) 44 /*! Reseed counter overflow - in case this error was returned instantiation or reseeding operation must be called. */ 45 #define CC_RND_RESEED_COUNTER_OVERFLOW_ERROR (CC_RND_MODULE_ERROR_BASE + 0x7UL) 46 /*! Instantiation was not yet called. */ 47 #define CC_RND_INSTANTIATION_NOT_DONE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x8UL) 48 /*! TRNG loss of samples. */ 49 #define CC_RND_TRNG_LOSS_SAMPLES_ERROR (CC_RND_MODULE_ERROR_BASE + 0x9UL) 50 /*! TRNG Time exceeded limitations. */ 51 #define CC_RND_TRNG_TIME_EXCEED_ERROR (CC_RND_MODULE_ERROR_BASE + 0xAUL) 52 /*! TRNG loss of samples and time exceeded limitations. */ 53 #define CC_RND_TRNG_LOSS_SAMPLES_AND_TIME_EXCEED_ERROR (CC_RND_MODULE_ERROR_BASE + 0xBUL) 54 /*! RND is in Known Answer Test mode. */ 55 #define CC_RND_IS_KAT_MODE_ERROR (CC_RND_MODULE_ERROR_BASE + 0xCUL) 56 /*! RND operation not supported. */ 57 #define CC_RND_OPERATION_IS_NOT_SUPPORTED_ERROR (CC_RND_MODULE_ERROR_BASE + 0xDUL) 58 /*! RND validity check failed. */ 59 #define CC_RND_STATE_VALIDATION_TAG_ERROR (CC_RND_MODULE_ERROR_BASE + 0xEUL) 60 /*! RND is not supported. */ 61 #define CC_RND_IS_NOT_SUPPORTED (CC_RND_MODULE_ERROR_BASE + 0xFUL) 62 63 /*! Illegal generate vector function pointer. */ 64 #define CC_RND_GEN_VECTOR_FUNC_ERROR (CC_RND_MODULE_ERROR_BASE + 0x14UL) 65 66 /*! Illegal work buffer pointer. */ 67 #define CC_RND_WORK_BUFFER_PTR_INVALID_ERROR (CC_RND_MODULE_ERROR_BASE + 0x20UL) 68 /*! Illegal AES key size. */ 69 #define CC_RND_ILLEGAL_AES_KEY_SIZE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x21UL) 70 /*! Illegal data pointer. */ 71 #define CC_RND_ILLEGAL_DATA_PTR_ERROR (CC_RND_MODULE_ERROR_BASE + 0x22UL) 72 /*! Illegal data size. */ 73 #define CC_RND_ILLEGAL_DATA_SIZE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x23UL) 74 /*! Illegal parameter. */ 75 #define CC_RND_ILLEGAL_PARAMETER_ERROR (CC_RND_MODULE_ERROR_BASE + 0x24UL) 76 /*! Illegal RND state pointer. */ 77 #define CC_RND_STATE_PTR_INVALID_ERROR (CC_RND_MODULE_ERROR_BASE + 0x25UL) 78 /*! TRNG errors. */ 79 #define CC_RND_TRNG_ERRORS_ERROR (CC_RND_MODULE_ERROR_BASE + 0x26UL) 80 /*! Illegal context pointer. */ 81 #define CC_RND_CONTEXT_PTR_INVALID_ERROR (CC_RND_MODULE_ERROR_BASE + 0x27UL) 82 /*! Illegal output vector pointer. */ 83 #define CC_RND_VECTOR_OUT_PTR_ERROR (CC_RND_MODULE_ERROR_BASE + 0x30UL) 84 /*! Illegal output vector size. */ 85 #define CC_RND_VECTOR_OUT_SIZE_ERROR (CC_RND_MODULE_ERROR_BASE + 0x31UL) 86 /*! Maximal vector size is too small. */ 87 #define CC_RND_MAX_VECTOR_IS_TOO_SMALL_ERROR (CC_RND_MODULE_ERROR_BASE + 0x32UL) 88 /*! Illegal Known Answer Tests parameters. */ 89 #define CC_RND_KAT_DATA_PARAMS_ERROR (CC_RND_MODULE_ERROR_BASE + 0x33UL) 90 /*! TRNG Known Answer Test not supported. */ 91 #define CC_RND_TRNG_KAT_NOT_SUPPORTED_ERROR (CC_RND_MODULE_ERROR_BASE + 0x34UL) 92 /*! SRAM memory is not defined. */ 93 #define CC_RND_SRAM_NOT_SUPPORTED_ERROR (CC_RND_MODULE_ERROR_BASE + 0x35UL) 94 /*! AES operation failure. */ 95 #define CC_RND_AES_ERROR (CC_RND_MODULE_ERROR_BASE + 0x36UL) 96 /*! TRNG mode mismatch between PAL and lib */ 97 #define CC_RND_MODE_MISMATCH_ERROR (CC_RND_MODULE_ERROR_BASE + 0x37UL) 98 99 100 /************************ Enums ********************************/ 101 102 103 /************************ Typedefs ****************************/ 104 105 106 /************************ Structs ******************************/ 107 108 109 /************************ Public Variables **********************/ 110 111 112 /************************ Public Functions **********************/ 113 114 #ifdef __cplusplus 115 } 116 #endif 117 /** 118 @} 119 */ 120 #endif 121 122 123