API参考
载入中...
搜索中...
未找到
crypt_xmss.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_XMSS_H
17#define CRYPT_XMSS_H
18
19#include "hitls_build.h"
20#ifdef HITLS_CRYPTO_XMSS
21
22#include <stdint.h>
23#include "bsl_params.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif /* __cplusplus */
28
29typedef struct CryptXmssCtx CryptXmssCtx;
30
37CryptXmssCtx *CRYPT_XMSS_NewCtx(void); // create key structure
38
47CryptXmssCtx *CRYPT_XMSS_NewCtxEx(void *libCtx);
48
54void CRYPT_XMSS_FreeCtx(CryptXmssCtx *ctx);
55
65int32_t CRYPT_XMSS_Gen(CryptXmssCtx *ctx);
66
77int32_t CRYPT_XMSS_Sign(CryptXmssCtx *ctx, int32_t algId, const uint8_t *data, uint32_t dataLen, uint8_t *sign,
78 uint32_t *signLen);
79
90int32_t CRYPT_XMSS_Verify(const CryptXmssCtx *ctx, int32_t algId, const uint8_t *data, uint32_t dataLen,
91 const uint8_t *sign, uint32_t signLen);
92
101int32_t CRYPT_XMSS_Ctrl(CryptXmssCtx *ctx, int32_t opt, void *val, uint32_t len);
102
109int32_t CRYPT_XMSS_GetPubKey(const CryptXmssCtx *ctx, BSL_Param *para);
110
117int32_t CRYPT_XMSS_GetPrvKey(const CryptXmssCtx *ctx, BSL_Param *para);
118
125int32_t CRYPT_XMSS_SetPubKey(CryptXmssCtx *ctx, const BSL_Param *para);
126
133int32_t CRYPT_XMSS_SetPrvKey(CryptXmssCtx *ctx, const BSL_Param *para);
134
135CryptXmssCtx *CRYPT_XMSS_DupCtx(CryptXmssCtx *ctx);
136
137#ifdef HITLS_CRYPTO_XMSS_CHECK
138
150int32_t CRYPT_XMSS_Check(uint32_t checkType, const CryptXmssCtx *pkey1, const CryptXmssCtx *pkey2);
151
152#endif // HITLS_CRYPTO_XMSS_CHECK
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif // HITLS_CRYPTO_XMSS
159
160#endif // CRYPT_XMSS_H