API参考
载入中...
搜索中...
未找到
crypt_frodokem.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_FRODOKEM_H
17#define CRYPT_FRODOKEM_H
18
19#include <stdint.h>
20#include "bsl_params.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26// FrodoKEM key management context
27typedef struct Frodokem_Ctx CRYPT_FRODOKEM_Ctx;
28
29CRYPT_FRODOKEM_Ctx *CRYPT_FRODOKEM_NewCtx(void);
30CRYPT_FRODOKEM_Ctx *CRYPT_FRODOKEM_NewCtxEx(void *libCtx);
31int32_t CRYPT_FRODOKEM_Gen(CRYPT_FRODOKEM_Ctx *ctx);
32int32_t CRYPT_FRODOKEM_SetPrvKeyEx(CRYPT_FRODOKEM_Ctx *ctx, BSL_Param *param);
33int32_t CRYPT_FRODOKEM_SetPubKeyEx(CRYPT_FRODOKEM_Ctx *ctx, BSL_Param *param);
34int32_t CRYPT_FRODOKEM_GetPrvKeyEx(CRYPT_FRODOKEM_Ctx *ctx, BSL_Param *param);
35int32_t CRYPT_FRODOKEM_GetPubKeyEx(CRYPT_FRODOKEM_Ctx *ctx, BSL_Param *param);
36CRYPT_FRODOKEM_Ctx *CRYPT_FRODOKEM_DupCtx(CRYPT_FRODOKEM_Ctx *srcCtx);
37int32_t CRYPT_FRODOKEM_Cmp(CRYPT_FRODOKEM_Ctx *ctx1, CRYPT_FRODOKEM_Ctx *ctx2);
38int32_t CRYPT_FRODOKEM_Ctrl(CRYPT_FRODOKEM_Ctx *ctx, int32_t cmd, void *val, uint32_t valLen);
39void CRYPT_FRODOKEM_FreeCtx(CRYPT_FRODOKEM_Ctx *ctx);
40
41int32_t CRYPT_FRODOKEM_EncapsInit(CRYPT_FRODOKEM_Ctx *ctx, const BSL_Param *params);
42int32_t CRYPT_FRODOKEM_DecapsInit(CRYPT_FRODOKEM_Ctx *ctx, const BSL_Param *params);
43int32_t CRYPT_FRODOKEM_Encaps(CRYPT_FRODOKEM_Ctx *ctx, uint8_t *ciphertext, uint32_t *ctLen, uint8_t *sharedSecret,
44 uint32_t *ssLen);
45int32_t CRYPT_FRODOKEM_Decaps(CRYPT_FRODOKEM_Ctx *ctx, const uint8_t *ciphertext, uint32_t ctLen, uint8_t *sharedSecret,
46 uint32_t *ssLen);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif // CRYPT_FRODOKEM_H
定义 frodo_local.h:56