API参考
载入中...
搜索中...
未找到
Crypt_eal_provider

default provider impl 更多...

Crypt_eal_provider 的协作图:

类型定义

typedef 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_LibCtx * CRYPT_EAL_LibCtxNew (void)
 create Library context
void CRYPT_EAL_LibCtxFree (CRYPT_EAL_LibCtx *libCtx)
 free Library context
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_ProviderRegister (CRYPT_EAL_LibCtx *libCtx, const char *providerName, CRYPT_EAL_ImplProviderInit init, BSL_Param *param, CRYPT_EAL_ProvMgrCtx **mgrCtx)
 Provider register 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_ProviderCtrl (CRYPT_EAL_ProvMgrCtx *ctx, int32_t cmd, void *val, uint32_t valLen)
 Control provider interface
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_ProviderSetLoadPath (CRYPT_EAL_LibCtx *libCtx, const char *searchPath)
 Set the path to load the provider and support duplicate settings. Repeating settings will release the previous path.
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
int32_t CRYPT_EAL_ProviderProcessAll (CRYPT_EAL_LibCtx *ctx, CRYPT_EAL_ProviderProcessCb cb, void *args)
 Process all loaded providers with the specified callback function

详细描述

default provider impl

introduced when then provider is used

using during provider development

Internal use of provider

default provider header

sm provider header

sm provider impl

iso19790 provider header

iso19790 provider impl

类型定义说明

◆ CRYPT_EAL_ImplProviderInit

typedef 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,

参数
mgrCtx[IN] framework generates context for each provider, for provider, it is opaque
param[IN] parameters passed transparently when loading the provider interface
capFuncs[IN] The ability passed from the framework to provider, such as entropy source
outFuncs[OUT] The callback returned by provider, such as entropy source
provCtx[OUT] provider context
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

函数说明

◆ CRYPT_EAL_LibCtxFree()

void CRYPT_EAL_LibCtxFree ( CRYPT_EAL_LibCtx * libCtx)

free Library context

参数
libCtx[IN] Library context

◆ CRYPT_EAL_LibCtxNew()

CRYPT_EAL_LibCtx * CRYPT_EAL_LibCtxNew ( void )

create Library context

返回值
returnLibrary context

◆ CRYPT_EAL_ProviderCtrl()

int32_t CRYPT_EAL_ProviderCtrl ( CRYPT_EAL_ProvMgrCtx * ctx,
int32_t cmd,
void * val,
uint32_t valLen )

Control provider interface

参数
ctx[IN] Provider context
cmd[IN] Control command
val[IN/OUT] Value associated with the command
valLen[IN] Length of the value
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderGetCaps()

int32_t CRYPT_EAL_ProviderGetCaps ( CRYPT_EAL_ProvMgrCtx * ctx,
int32_t cmd,
CRYPT_EAL_ProcessFuncCb cb,
void * args )

Get and process provider capabilities

参数
ctx[IN] Provider context
cmd[IN] Command to specify which capabilities to retrieve
cb[IN] Callback function to process the retrieved capabilities
args[IN] Arguments to be passed to the callback function
返回值
CRYPT_SUCCESSif capability retrieval and processing succeeds Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderGetFuncs()

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

参数
libCtx[IN] Library context
operaId[IN] Operation ID
algId[IN] Algorithm ID
attribute[IN] Attribute string for matching provider capabilities
funcs[OUT] Retrieved function implementations
provCtx[OUT] Provider context associated with the functions
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderIsLoaded()

int32_t CRYPT_EAL_ProviderIsLoaded ( CRYPT_EAL_LibCtx * libCtx,
BSL_SAL_LibFmtCmd cmd,
const char * providerName,
bool * isLoaded )

Check if the provider is loaded

参数
libCtx[IN] Library context
cmd[IN] Command specifying the conversion format for the provider library name.
providerName[IN] provider name
isLoaded[OUT] Whether the provider is loaded
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderLoad()

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

参数
libCtx[IN] Library context
providerName[IN] provider name
param[IN] parameter is transparently passed to the initialization function of the underlying provider
cmd[IN] Command specifying the conversion format for the provider library name. This parameter is used to determine how the provider library name should be converted or formatted. Possible values are:
  • BSL_SAL_LIB_FMT_SO: Convert to .so format
  • BSL_SAL_LIB_FMT_LIBSO: Convert to lib*.so format
  • BSL_SAL_LIB_FMT_LIBDLL: Convert to lib*.dll format
  • BSL_SAL_LIB_FMT_DLL: Convert to .dll format The specific conversion is handled by the BSL_SAL_LibNameFormat function.
mgrCtx[OUT] Provider context
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderProcessAll()

int32_t CRYPT_EAL_ProviderProcessAll ( CRYPT_EAL_LibCtx * ctx,
CRYPT_EAL_ProviderProcessCb cb,
void * args )

Process all loaded providers with the specified callback function

This function iterates through all providers loaded in the given library context and applies the specified callback function to each provider. It allows performing a common operation across all loaded providers.

参数
ctx[IN] Library context containing the providers to process
cb[IN] Callback function to be applied to each provider
args[IN] Arguments to be passed to the callback function
返回值
CRYPT_SUCCESSif all providers were processed successfully The first error code encountered if any provider processing fails Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderRegister()

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

参数
libCtx[IN] Library context
providerName[IN] provider name
init[IN] Provider initialization function
param[IN] parameter is transparently passed to the initialization function of the underlying provider
mgrCtx[OUT] Provider context
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderSetLoadPath()

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 previous path.

参数
libCtx[IN] Library context
searchPath[IN] the path to load the provider
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h

◆ CRYPT_EAL_ProviderUnload()

int32_t CRYPT_EAL_ProviderUnload ( CRYPT_EAL_LibCtx * libCtx,
BSL_SAL_LibFmtCmd cmd,
const char * providerName )

Provider unload interface

参数
libCtx[IN] Library context
cmd[IN] Command specifying the conversion format for the provider library name. This parameter is used to determine how the provider library name should be converted or formatted. Possible values are:
  • BSL_SAL_LIB_FMT_SO: Convert to .so format
  • BSL_SAL_LIB_FMT_LIBSO: Convert to lib*.so format
  • BSL_SAL_LIB_FMT_LIBDLL: Convert to lib*.dll format
  • BSL_SAL_LIB_FMT_DLL: Convert to .dll format The specific conversion is handled by the BSL_SAL_LibNameFormat function.
providerName[IN] provider name
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h