• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CRYPT_EALINIT_H
16 #define CRYPT_EALINIT_H
17 
18 #include "hitls_build.h"
19 #ifdef HITLS_CRYPTO_ASM_CHECK
20 #include <stdint.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif // __cplusplus
25 
26 /**
27  * @ingroup crypt_asmcap
28  * @brief Check cpu capability for assembly implementation
29  *
30  * @param id [IN] algorithm id
31  * @retval CRYPT_SUCCESS                    Instantiation succeeded.
32  * @retval CRYPT_EAL_ALG_ASM_NOT_SUPPORT    CPU is not supported for assembly implementation
33 */
34 int32_t CRYPT_ASMCAP_Cipher(CRYPT_CIPHER_AlgId id);
35 
36 /**
37  * @ingroup crypt_asmcap
38  * @brief Check cpu capability for assembly implementation
39  *
40  * @param id [IN] algorithm id
41  * @retval CRYPT_SUCCESS                    Instantiation succeeded.
42  * @retval CRYPT_EAL_ALG_ASM_NOT_SUPPORT    CPU is not supported for assembly implementation
43 */
44 int32_t CRYPT_ASMCAP_Md(CRYPT_MD_AlgId id);
45 
46 /**
47  * @ingroup crypt_asmcap
48  * @brief Check cpu capability for assembly implementation
49  *
50  * @param id [IN] algorithm id
51  * @retval CRYPT_SUCCESS                    Instantiation succeeded.
52  * @retval CRYPT_EAL_ALG_ASM_NOT_SUPPORT    CPU is not supported for assembly implementation
53 */
54 int32_t CRYPT_ASMCAP_Pkey(CRYPT_PKEY_AlgId id);
55 
56 /**
57  * @ingroup crypt_asmcap
58  * @brief Check cpu capability for assembly implementation
59  *
60  * @param id [IN] algorithm id
61  * @retval CRYPT_SUCCESS                    Instantiation succeeded.
62  * @retval CRYPT_EAL_ALG_ASM_NOT_SUPPORT    CPU is not supported for assembly implementation
63 */
64 int32_t CRYPT_ASMCAP_Mac(CRYPT_MAC_AlgId id);
65 
66 /**
67  * @ingroup crypt_asmcap
68  * @brief Check cpu capability for assembly implementation
69  *
70  * @param id [IN] algorithm id
71  * @retval CRYPT_SUCCESS                    Instantiation succeeded.
72  * @retval CRYPT_EAL_ALG_ASM_NOT_SUPPORT    CPU is not supported for assembly implementation
73 */
74 int32_t CRYPT_ASMCAP_Drbg(CRYPT_RAND_AlgId id);
75 
76 
77 #ifdef __cplusplus
78 }
79 #endif // __cplusplus
80 #endif // HITLS_CRYPTO_ASM_CHECK
81 #endif // CRYPT_EALINIT_H