API参考
载入中...
搜索中...
未找到
crypt_eal_kdf.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_KDF_H
23#define CRYPT_EAL_KDF_H
24
25#include <stdbool.h>
26#include <stdint.h>
27#include "crypt_algid.h"
28#include "crypt_types.h"
29#include "bsl_params.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif // __cplusplus
34
35typedef struct EalKdfCtx CRYPT_EAL_KdfCtx;
36
37#define CRYPT_EAL_KdfCTX CRYPT_EAL_KdfCtx
38
49
60CRYPT_EAL_KdfCtx *CRYPT_EAL_ProviderKdfNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t algId, const char *attrName);
61
69CRYPT_EAL_KdfCtx *CRYPT_EAL_KdfNewCtx(CRYPT_KDF_AlgId algId);
70
81int32_t CRYPT_EAL_KdfSetParam(CRYPT_EAL_KdfCtx *ctx, const BSL_Param *param);
82
94int32_t CRYPT_EAL_KdfDerive(CRYPT_EAL_KdfCtx *ctx, uint8_t *key, uint32_t keyLen);
95
105int32_t CRYPT_EAL_KdfDeInitCtx(CRYPT_EAL_KdfCtx *ctx);
106
114void CRYPT_EAL_KdfFreeCtx(CRYPT_EAL_KdfCtx *ctx);
115
125int32_t CRYPT_EAL_KdfCopyCtx(CRYPT_EAL_KdfCtx *to, const CRYPT_EAL_KdfCtx *from);
126
135CRYPT_EAL_KdfCtx *CRYPT_EAL_KdfDupCtx(const CRYPT_EAL_KdfCtx *from);
136
137#ifdef __cplusplus
138}
139#endif // __cplusplus
140
141#endif // CRYPT_EAL_KDF_H
CRYPT_KDF_AlgId
定义 crypt_algid.h:382
void CRYPT_EAL_KdfFreeCtx(CRYPT_EAL_KdfCtx *ctx)
Free the context of kdf
int32_t CRYPT_EAL_KdfSetParam(CRYPT_EAL_KdfCtx *ctx, const BSL_Param *param)
Set the parameters of Algorithm kdf
int32_t CRYPT_EAL_KdfDerive(CRYPT_EAL_KdfCtx *ctx, uint8_t *key, uint32_t keyLen)
Derived key
CRYPT_EAL_KdfCtx * CRYPT_EAL_KdfDupCtx(const CRYPT_EAL_KdfCtx *from)
Dup the kdf context.
int32_t CRYPT_EAL_KdfDeInitCtx(CRYPT_EAL_KdfCtx *ctx)
Deinitialize the context of kdf
int32_t CRYPT_EAL_KdfCopyCtx(CRYPT_EAL_KdfCtx *to, const CRYPT_EAL_KdfCtx *from)
Copy the context of kdf Note: When using HKDF for key derivation in CRYPT_KDF_HKDF_MODE_EXTRACT mode,...
CRYPT_EAL_KdfCtx * CRYPT_EAL_ProviderKdfNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t algId, const char *attrName)
Generate kdf handles in the providers
bool CRYPT_EAL_KdfIsValidAlgId(CRYPT_KDF_AlgId id)
Check whether the given kdf algorithm ID is valid.
CRYPT_EAL_KdfCtx * CRYPT_EAL_KdfNewCtx(CRYPT_KDF_AlgId algId)
Generate kdf handles