API参考
载入中...
搜索中...
未找到
crypt_util_ctrl.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_UTIL_CTRL_H
17#define CRYPT_UTIL_CTRL_H
18
19#include "hitls_build.h"
20
21#include <stdint.h>
22#include "crypt_local_types.h"
23#include "crypt_algid.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29typedef uint32_t (*GetNumCallBack)(const void *arg);
30
31#define CRYPT_CTRL_GET_NUM32_EX(getNumCb, arg, val, len) \
32 CRYPT_CTRL_GetNum32Ex((GetNumCallBack)(getNumCb), (arg), (val), (len))
33
45int32_t CRYPT_CTRL_GetNum32(uint32_t num, void *val, uint32_t valLen);
46
59int32_t CRYPT_CTRL_GetNum32Ex(GetNumCallBack getNumCb, void *cbArg, void *val, uint32_t valLen);
60
61#if defined(HITLS_CRYPTO_HKDF) || defined(HITLS_CRYPTO_KDFTLS12) || defined(HITLS_CRYPTO_PBKDF2) || \
62defined(HITLS_CRYPTO_SCRYPT)
75int32_t CRYPT_CTRL_SetData(const uint8_t *src, uint32_t srcLen, uint8_t **dst, uint32_t *dstLen);
76#endif
77
78#if defined(HITLS_CRYPTO_HKDF) || defined(HITLS_CRYPTO_KDFTLS12) || defined(HITLS_CRYPTO_PBKDF2)
87int32_t CRYPT_CTRL_SetMdAttrToHmac(const char *mdAttr, uint32_t mdAttrLen, MacSetParam setParamCb, void *hmacCtx);
88
99int32_t CRYPT_CTRL_SetMacMethod(void *libCtx, CRYPT_MAC_AlgId inId, int32_t ret, void **macCtx, EAL_MacMethod *macMeth,
100 CRYPT_MAC_AlgId *id);
101#endif
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif // CRYPT_UTIL_CTRL_H
CRYPT_MAC_AlgId
定义 crypt_algid.h:91
定义 crypt_local_types.h:303