• 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 
16 #include "hitls_build.h"
17 #ifdef HITLS_CRYPTO_PROVIDER
18 
19 #include "crypt_eal_implprovider.h"
20 #include "crypt_rsa.h"
21 #include "crypt_sm2.h"
22 #include "crypt_paillier.h"
23 #include "crypt_elgamal.h"
24 
25 const CRYPT_EAL_Func g_defEalAsymCipherRsa[] = {
26 #ifdef HITLS_CRYPTO_RSA_ENCRYPT
27     {CRYPT_EAL_IMPLPKEYCIPHER_ENCRYPT, (CRYPT_EAL_ImplPkeyEncrypt)CRYPT_RSA_Encrypt},
28 #endif
29 #ifdef HITLS_CRYPTO_RSA_DECRYPT
30     {CRYPT_EAL_IMPLPKEYCIPHER_DECRYPT, (CRYPT_EAL_ImplPkeyDecrypt)CRYPT_RSA_Decrypt},
31 #endif
32     CRYPT_EAL_FUNC_END
33 };
34 
35 const CRYPT_EAL_Func g_defEalAsymCipherSm2[] = {
36 #ifdef HITLS_CRYPTO_SM2_CRYPT
37     {CRYPT_EAL_IMPLPKEYCIPHER_ENCRYPT, (CRYPT_EAL_ImplPkeyEncrypt)CRYPT_SM2_Encrypt},
38     {CRYPT_EAL_IMPLPKEYCIPHER_DECRYPT, (CRYPT_EAL_ImplPkeyDecrypt)CRYPT_SM2_Decrypt},
39 #endif
40     CRYPT_EAL_FUNC_END
41 };
42 
43 const CRYPT_EAL_Func g_defEalAsymCipherPaillier[] = {
44 #ifdef HITLS_CRYPTO_PAILLIER
45     {CRYPT_EAL_IMPLPKEYCIPHER_ENCRYPT, (CRYPT_EAL_ImplPkeyEncrypt)CRYPT_PAILLIER_Encrypt},
46     {CRYPT_EAL_IMPLPKEYCIPHER_DECRYPT, (CRYPT_EAL_ImplPkeyDecrypt)CRYPT_PAILLIER_Decrypt},
47 #endif
48     CRYPT_EAL_FUNC_END
49 };
50 
51 const CRYPT_EAL_Func g_defEalAsymCipherElGamal[] = {
52 #ifdef HITLS_CRYPTO_ELGAMAL
53     {CRYPT_EAL_IMPLPKEYCIPHER_ENCRYPT, CRYPT_ELGAMAL_Encrypt},
54     {CRYPT_EAL_IMPLPKEYCIPHER_DECRYPT, CRYPT_ELGAMAL_Decrypt},
55 #endif
56     CRYPT_EAL_FUNC_END
57 };
58 
59 #endif /* HITLS_CRYPTO_PROVIDER */