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 // Source code for the test .so file
17
18 #include <stdio.h>
19 #include <stdint.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include "bsl_params.h"
23
24 #define CRYPT_EAL_FUNCEND_ID 0
25 #define CRYPT_EAL_FUNC_END {CRYPT_EAL_FUNCEND_ID, NULL}
26 #define CRYPT_EAL_ALGINFO_END {CRYPT_EAL_FUNCEND_ID, NULL, NULL}
27
28 #define CRYPT_EAL_PROVCB_FREE 1
29 #define CRYPT_EAL_PROVCB_QUERY 2
30 #define CRYPT_EAL_PROVCB_CTRL 3
31
32 typedef struct {
33 int32_t id;
34 void *func;
35 } CRYPT_EAL_Func;
36
37
38 typedef struct {
39 int32_t algId; // implemented algorithm id, such as aes128cbc, rsa sign
40 const CRYPT_EAL_Func *implFunc; // implemented algorithm callback
41 const char *attr; // implemented algorithm attribute
42 } CRYPT_EAL_AlgInfo;
43
44 typedef struct EAL_ProviderMgrCtx CRYPT_EAL_ProvMgrCtx;
45
CRYPT_EAL_ProvFreeCb(void * provCtx)46 void CRYPT_EAL_ProvFreeCb(void *provCtx)
47 {
48 return;
49 }
50
CRYPT_EAL_ProvQueryCb(void * provCtx,int32_t operaId,CRYPT_EAL_AlgInfo ** algInfos)51 int32_t CRYPT_EAL_ProvQueryCb(void *provCtx, int32_t operaId, CRYPT_EAL_AlgInfo **algInfos)
52 {
53 return 0;
54 }
55
CRYPT_EAL_ProvCtrlCb(void * provCtx,int32_t cmd,void * val,uint32_t valLen)56 int32_t CRYPT_EAL_ProvCtrlCb(void *provCtx, int32_t cmd, void *val, uint32_t valLen)
57 {
58 return 0;
59 }
60
CRYPT_EAL_ProviderInit(CRYPT_EAL_ProvMgrCtx * mgrCtx,BSL_Param * param,CRYPT_EAL_Func * capFuncs,CRYPT_EAL_Func ** outFuncs,void ** provCtx)61 int32_t CRYPT_EAL_ProviderInit(CRYPT_EAL_ProvMgrCtx *mgrCtx,
62 BSL_Param *param, CRYPT_EAL_Func *capFuncs, CRYPT_EAL_Func **outFuncs, void **provCtx)
63 {
64 return 0;
65 }
66