1 /* 2 * This file is part of the openHiTLS project. 3 * 4 * openHiTLS is licensed under the Mulan PSL v2. 5 * You can use this software according to the terms and conditions of the Mulan PSL v2. 6 * You may obtain a copy of Mulan PSL v2 at: 7 * 8 * http://license.coscl.org.cn/MulanPSL2 9 * 10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 13 * See the Mulan PSL v2 for more details. 14 */ 15 16 /** 17 * @defgroup crypt_method 18 * @ingroup crypt 19 * @brief methods of crypto 20 */ 21 22 #ifndef CRYPT_EAL_INIT_H 23 #define CRYPT_EAL_INIT_H 24 25 #include <stdint.h> 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif // __cplusplus 30 31 #define CRYPT_EAL_INIT_CPU 0x01 32 #define CRYPT_EAL_INIT_BSL 0x02 33 #define CRYPT_EAL_INIT_RAND 0x04 34 #define CRYPT_EAL_INIT_PROVIDER 0x08 35 #define CRYPT_EAL_INIT_LOCK 0x10 36 #define CRYPT_EAL_INIT_PROVIDER_RAND 0x20 37 38 /** 39 * @ingroup crypt_method 40 * @brief CRYPTO initialization 41 * 42 * @param opts [IN] Bit information to be initialized, the first three bits are used at present. 43 * The first bit is CRYPT_EAL_INIT_CPU marked as "CPU ", the second bit is BSL 44 * CRYPT_EAL_INIT_BSL marked as "BSL", and the third bit is CRYPT_EAL_INIT_RAND 45 * marked as "RAND". 46 * @retval #CRYPT_SUCCESS, if successful. 47 * For other error codes, see the crypt_errno.h file. 48 */ 49 int32_t CRYPT_EAL_Init(uint64_t opts); 50 51 /** 52 * @ingroup crypt_method 53 * @brief release the CRYPTO initialization memory. 54 * 55 * @param opts [IN] information about the bits to be deinitialized, which is the same as that of CRYPT_EAL_Init. 56 */ 57 void CRYPT_EAL_Cleanup(uint64_t opts); 58 59 #ifdef __cplusplus 60 } 61 #endif // __cplusplus 62 63 #endif // CRYPT_EAL_INIT_H 64