API参考
载入中...
搜索中...
未找到
crypt_eal_provider.h
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
21
22#ifndef CRYPT_EAL_PROVIDER_H
23#define CRYPT_EAL_PROVIDER_H
24
25#include <stdint.h>
26#include "crypt_types.h"
27#include "bsl_sal.h"
28#include "bsl_params.h"
29#include "crypt_eal_implprovider.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif // __cplusplus
34
41CRYPT_EAL_LibCtx *CRYPT_EAL_LibCtxNew(void);
42
49void CRYPT_EAL_LibCtxFree(CRYPT_EAL_LibCtx *libCtx);
50
71int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd,
72 const char *providerName, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx);
73
87int32_t CRYPT_EAL_ProviderRegister(CRYPT_EAL_LibCtx *libCtx, const char *providerName, CRYPT_EAL_ImplProviderInit init,
88 BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx);
89
102int32_t CRYPT_EAL_ProviderIsLoaded(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName,
103 bool *isLoaded);
104
117int32_t CRYPT_EAL_ProviderCtrl(CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, void *val, uint32_t valLen);
118
131int32_t CRYPT_EAL_ProviderGetCaps(CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, CRYPT_EAL_ProcessFuncCb cb, void *args);
132
151int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName);
152
153
165int32_t CRYPT_EAL_ProviderSetLoadPath(CRYPT_EAL_LibCtx *libCtx, const char *searchPath);
166
181int32_t CRYPT_EAL_ProviderGetFuncs(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId,
182 const char *attribute, const CRYPT_EAL_Func **funcs, void **provCtx);
183
193typedef int32_t (*CRYPT_EAL_ProviderProcessCb)(CRYPT_EAL_ProvMgrCtx *ctx, void *args);
194
211int32_t CRYPT_EAL_ProviderProcessAll(CRYPT_EAL_LibCtx *ctx, CRYPT_EAL_ProviderProcessCb cb, void *args);
212
213#ifdef __cplusplus
214}
215#endif // __cplusplus
216
217#endif // CRYPT_EAL_PROVIDER_H
int32_t CRYPT_EAL_ProviderCtrl(CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, void *val, uint32_t valLen)
Control provider interface
int32_t CRYPT_EAL_ProviderLoad(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx)
Provider load interface
int32_t CRYPT_EAL_ProviderProcessAll(CRYPT_EAL_LibCtx *ctx, CRYPT_EAL_ProviderProcessCb cb, void *args)
Process all loaded providers with the specified callback function
CRYPT_EAL_LibCtx * CRYPT_EAL_LibCtxNew(void)
create Library context
int32_t(* CRYPT_EAL_ImplProviderInit)(CRYPT_EAL_ProvMgrCtx *mgrCtx, BSL_Param *param, CRYPT_EAL_Func *capFuncs, CRYPT_EAL_Func **outFuncs, void **provCtx)
Provider initialization function prototype,
定义 crypt_eal_implprovider.h:120
int32_t CRYPT_EAL_ProviderGetFuncs(CRYPT_EAL_LibCtx *libCtx, int32_t operaId, int32_t algId, const char *attribute, const CRYPT_EAL_Func **funcs, void **provCtx)
Get function implementations from provider based on operation ID, algorithm ID and attributes
void CRYPT_EAL_LibCtxFree(CRYPT_EAL_LibCtx *libCtx)
free Library context
int32_t CRYPT_EAL_ProviderGetCaps(CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, CRYPT_EAL_ProcessFuncCb cb, void *args)
Get and process provider capabilities
int32_t CRYPT_EAL_ProviderUnload(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName)
Provider unload interface
int32_t CRYPT_EAL_ProviderIsLoaded(CRYPT_EAL_LibCtx *libCtx, BSL_SAL_LibFmtCmd cmd, const char *providerName, bool *isLoaded)
Check if the provider is loaded
int32_t CRYPT_EAL_ProviderSetLoadPath(CRYPT_EAL_LibCtx *libCtx, const char *searchPath)
Set the path to load the provider and support duplicate settings. Repeating settings will release the...
int32_t CRYPT_EAL_ProviderRegister(CRYPT_EAL_LibCtx *libCtx, const char *providerName, CRYPT_EAL_ImplProviderInit init, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx)
Provider register interface
定义 crypt_types.h:952