API参考
载入中...
搜索中...
未找到
slh_dsa_hash.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 SLH_DSA_HASH_H
17#define SLH_DSA_HASH_H
18
19#include "hitls_build.h"
20#ifdef HITLS_CRYPTO_SLH_DSA
21
22/*
23 * Initialize SLH-DSA hash functions for a given algorithm
24 *
25 * This function sets up the hash function pointers in the SLH-DSA context
26 * based on the algorithm parameters.
27 *
28 * @param ctx SLH-DSA context (will be initialized with hash function pointer)
29 */
30void SlhDsaInitHashFuncs(CryptSlhDsaCtx *ctx);
31
32/*
33 * SLH-DSA-SHA2: PreHash pkseed and padding then save the mdctx
34 * @param ctx SLH-DSA context
35 */
36int32_t InitMdCtx(CryptSlhDsaCtx *ctx);
37
38/*
39 * SLH-DSA-SHA2: dup the md ctx
40 * @param dest dest SLH-DSA context
41 * @param src source SLH-DSA context
42 */
43void DupMdCtx(CryptSlhDsaCtx *dest, CryptSlhDsaCtx *src);
44
45/*
46 * SLH-DSA-SHA2: free the md ctx
47 * @param ctx SLH-DSA context
48 */
49void FreeMdCtx(CryptSlhDsaCtx *ctx);
50
51#endif // HITLS_CRYPTO_SLH_DSA
52#endif // SLH_DSA_HASH_H