API参考
载入中...
搜索中...
未找到
crypt_mldsa.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_ML_DSA_H
17#define CRYPT_ML_DSA_H
18#include <stdint.h>
19#include "crypt_types.h"
20#include "bsl_params.h"
21#include "crypt_params_key.h"
22
23typedef struct CryptMlDsaCtx CRYPT_ML_DSA_Ctx;
24
25CRYPT_ML_DSA_Ctx *CRYPT_ML_DSA_NewCtx(void);
26CRYPT_ML_DSA_Ctx *CRYPT_ML_DSA_NewCtxEx(void *libCtx);
27
28void CRYPT_ML_DSA_FreeCtx(CRYPT_ML_DSA_Ctx *ctx);
29
30CRYPT_ML_DSA_Ctx *CRYPT_ML_DSA_DupCtx(CRYPT_ML_DSA_Ctx *ctx);
31
32int32_t CRYPT_ML_DSA_Ctrl(CRYPT_ML_DSA_Ctx *ctx, int32_t opt, void *val, uint32_t len);
33
34int32_t CRYPT_ML_DSA_GenKey(CRYPT_ML_DSA_Ctx *ctx);
35
36int32_t CRYPT_ML_DSA_Sign(CRYPT_ML_DSA_Ctx *ctx, int32_t hashId, const uint8_t *data, uint32_t dataLen,
37 uint8_t *sign, uint32_t *signLen);
38
39int32_t CRYPT_ML_DSA_Verify(CRYPT_ML_DSA_Ctx *ctx, int32_t hashId, const uint8_t *data, uint32_t dataLen,
40 uint8_t *sign, uint32_t signLen);
41
42int32_t CRYPT_ML_DSA_SetPrvKey(CRYPT_ML_DSA_Ctx *ctx, CRYPT_MlDsaPrv *prv);
43
44int32_t CRYPT_ML_DSA_SetPubKey(CRYPT_ML_DSA_Ctx *ctx, CRYPT_MlDsaPub *pub);
45
46int32_t CRYPT_ML_DSA_GetPrvKey(const CRYPT_ML_DSA_Ctx *ctx, CRYPT_MlDsaPrv *prv);
47
48int32_t CRYPT_ML_DSA_GetPubKey(const CRYPT_ML_DSA_Ctx *ctx, CRYPT_MlDsaPub *pub);
49
50int32_t CRYPT_ML_DSA_SetPrvKeyEx(CRYPT_ML_DSA_Ctx *ctx, const BSL_Param *para);
51
52int32_t CRYPT_ML_DSA_SetPubKeyEx(CRYPT_ML_DSA_Ctx *ctx, const BSL_Param *para);
53
54int32_t CRYPT_ML_DSA_GetPrvKeyEx(const CRYPT_ML_DSA_Ctx *ctx, BSL_Param *para);
55
56int32_t CRYPT_ML_DSA_GetPubKeyEx(const CRYPT_ML_DSA_Ctx *ctx, BSL_Param *para);
57
58#ifdef HITLS_CRYPTO_MLDSA_CMP
59int32_t CRYPT_ML_DSA_Cmp(const CRYPT_ML_DSA_Ctx *a, const CRYPT_ML_DSA_Ctx *b);
60#else
61#define CRYPT_ML_DSA_Cmp NULL
62#endif
63
64#ifdef HITLS_CRYPTO_MLDSA_CHECK
65
77int32_t CRYPT_ML_DSA_Check(uint32_t checkType, const CRYPT_ML_DSA_Ctx *pkey1, const CRYPT_ML_DSA_Ctx *pkey2);
78
79#endif // HITLS_CRYPTO_MLDSA_CHECK
80
81#endif // CRYPT_ML_DSA_H
Parameter identifiers
CRYPT_Data CRYPT_MlDsaPrv
定义 crypt_types.h:324
CRYPT_Data CRYPT_MlDsaPub
定义 crypt_types.h:463
定义 ml_dsa_local.h:80