API参考
载入中...
搜索中...
未找到
crypt_eal_cmvp.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_CMVP_H
23#define CRYPT_EAL_CMVP_H
24
25#include <stdint.h>
26#include "bsl_params.h"
27#include "crypt_types.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif // __cplusplus
32
43
44typedef enum {
45 /* Set the self test flag of drbg, 0: disable, 1: enable */
46 CRYPT_CTRL_SET_SELFTEST_FLAG = CRYPT_CTRL_RAND_MAX + 1,
47} CRYPT_CMVP_RandCtrl;
48
58typedef void (*CRYPT_EAL_CMVP_LogFunc)(CRYPT_EVENT_TYPE oper, CRYPT_ALGO_TYPE type, int32_t id, int32_t err);
59
60typedef struct EAL_SelftestCtx CRYPT_SelftestCtx;
61
72CRYPT_SelftestCtx *CRYPT_CMVP_SelftestNewCtx(CRYPT_EAL_LibCtx *libCtx, const char *attrName);
73
83const char *CRYPT_CMVP_GetVersion(CRYPT_SelftestCtx *ctx);
84
95int32_t CRYPT_CMVP_Selftest(CRYPT_SelftestCtx *ctx, const BSL_Param *param);
96
103void CRYPT_CMVP_SelftestFreeCtx(CRYPT_SelftestCtx *ctx);
104
105#ifdef __cplusplus
106}
107#endif // __cplusplus
108#endif // CRYPT_EAL_CMVP_H
int32_t CRYPT_CMVP_Selftest(CRYPT_SelftestCtx *ctx, const BSL_Param *param)
Run the self-test.
void(* CRYPT_EAL_CMVP_LogFunc)(CRYPT_EVENT_TYPE oper, CRYPT_ALGO_TYPE type, int32_t id, int32_t err)
Log function for provider.
定义 crypt_eal_cmvp.h:58
const char * CRYPT_CMVP_GetVersion(CRYPT_SelftestCtx *ctx)
Get the version of the provider.
CRYPT_CMVP_SELFTEST_TYPE
The type of the self-test.
定义 crypt_eal_cmvp.h:37
CRYPT_SelftestCtx * CRYPT_CMVP_SelftestNewCtx(CRYPT_EAL_LibCtx *libCtx, const char *attrName)
Create a new context for self-test.
void CRYPT_CMVP_SelftestFreeCtx(CRYPT_SelftestCtx *ctx)
Free the context of the self-test.
@ CRYPT_CMVP_KAT_TEST
定义 crypt_eal_cmvp.h:39
@ CRYPT_CMVP_RANDOMNESS_TEST
定义 crypt_eal_cmvp.h:40
@ CRYPT_CMVP_INTEGRITY_TEST
定义 crypt_eal_cmvp.h:38
CRYPT_ALGO_TYPE
定义 crypt_types.h:843
CRYPT_EVENT_TYPE
定义 crypt_types.h:810
定义 crypt_cmvp.h:47