API参考
载入中...
搜索中...
未找到
crypt_eal_entropy.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
16#ifndef CRYPT_EAL_ENTROPY_H
17#define CRYPT_EAL_ENTROPY_H
18
19#include <stdbool.h>
20#include <stdint.h>
21#include "crypt_algid.h"
22#include "crypt_types.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28typedef struct CryptEalEntropySource CRYPT_EAL_Es;
29
36typedef void (*CRYPT_EAL_EsLogFunc)(int32_t ret);
37
47CRYPT_EAL_Es *CRYPT_EAL_EsNew(void);
48
58void CRYPT_EAL_EsFree(CRYPT_EAL_Es *es);
59
70int32_t CRYPT_EAL_EsInit(CRYPT_EAL_Es *es);
71
113int32_t CRYPT_EAL_EsCtrl(CRYPT_EAL_Es *es, int32_t type, void *data, uint32_t len);
114
125uint32_t CRYPT_EAL_EsEntropyGet(CRYPT_EAL_Es *es, uint8_t *data, uint32_t len);
126
127typedef struct EAL_SeedPool CRYPT_EAL_SeedPoolCtx;
128
137CRYPT_EAL_SeedPoolCtx *CRYPT_EAL_SeedPoolNew(bool isCreateNullPool);
138
148int32_t CRYPT_EAL_SeedPoolAddEs(CRYPT_EAL_SeedPoolCtx *ctx, const CRYPT_EAL_EsPara *para);
149
160int32_t CRYPT_EAL_SeedPoolGetEntropy(CRYPT_EAL_SeedPoolCtx *ctx, CRYPT_Data *entropy, uint32_t strength,
161 const CRYPT_Range *lenRange);
162
170void CRYPT_EAL_SeedPoolFree(CRYPT_EAL_SeedPoolCtx *ctx);
171
172#ifdef __cplusplus
173}
174#endif
175#endif
定义 crypt_types.h:38
定义 crypt_types.h:236
定义 crypt_types.h:58