API参考
载入中...
搜索中...
未找到
crypt_hybridkem.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_HYBRIDKEM_H
17#define CRYPT_HYBRIDKEM_H
18#include <stdint.h>
19#include "hitls_build.h"
20#include "crypt_types.h"
21#include "bsl_params.h"
22#include "crypt_params_key.h"
23
24#ifdef HITLS_CRYPTO_ECDH
25
26typedef struct HybridKemCtx CRYPT_HybridKemCtx;
27
28CRYPT_HybridKemCtx *CRYPT_HYBRID_KEM_NewCtx(void);
29
30CRYPT_HybridKemCtx *CRYPT_HYBRID_KEM_NewCtxEx(void *libCtx);
31
32void CRYPT_HYBRID_KEM_FreeCtx(CRYPT_HybridKemCtx *ctx);
33
34int32_t CRYPT_HYBRID_KEM_KeyCtrl(CRYPT_HybridKemCtx *ctx, int32_t opt, void *val, uint32_t len);
35
36int32_t CRYPT_HYBRID_KEM_GenKey(CRYPT_HybridKemCtx *ctx);
37
38int32_t CRYPT_HYBRID_KEM_SetEncapsKey(CRYPT_HybridKemCtx *ctx, const CRYPT_KemEncapsKey *ek);
39int32_t CRYPT_HYBRID_KEM_SetDecapsKey(CRYPT_HybridKemCtx *ctx, const CRYPT_KemDecapsKey *dk);
40
41int32_t CRYPT_HYBRID_KEM_GetEncapsKey(const CRYPT_HybridKemCtx *ctx, CRYPT_KemEncapsKey *ek);
42int32_t CRYPT_HYBRID_KEM_GetDecapsKey(const CRYPT_HybridKemCtx *ctx, CRYPT_KemDecapsKey *dk);
43
44int32_t CRYPT_HYBRID_KEM_GetEncapsKeyEx(const CRYPT_HybridKemCtx *ctx, BSL_Param *para);
45int32_t CRYPT_HYBRID_KEM_GetDecapsKeyEx(const CRYPT_HybridKemCtx *ctx, BSL_Param *para);
46
47int32_t CRYPT_HYBRID_KEM_SetEncapsKeyEx(CRYPT_HybridKemCtx *ctx, const BSL_Param *para);
48int32_t CRYPT_HYBRID_KEM_SetDecapsKeyEx(CRYPT_HybridKemCtx *ctx, const BSL_Param *para);
49
50int32_t CRYPT_HYBRID_KEM_Encaps(const CRYPT_HybridKemCtx *ctx, uint8_t *cipher, uint32_t *cipherLen,
51 uint8_t *sharekey, uint32_t *shareLen);
52
53int32_t CRYPT_HYBRID_KEM_Decaps(const CRYPT_HybridKemCtx *ctx, uint8_t *cipher, uint32_t cipherLen,
54 uint8_t *sharekey, uint32_t *shareLen);
55
56#endif
57#endif // CRYPT_HYBRIDKEM_H
Parameter identifiers
CRYPT_Data CRYPT_KemEncapsKey
定义 crypt_types.h:456
CRYPT_Data CRYPT_KemDecapsKey
定义 crypt_types.h:317
定义 crypt_hybridkem_local.h:22