forked from pq-code-package/slhdsa-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslh_prehash.h
More file actions
40 lines (30 loc) · 1.08 KB
/
Copy pathslh_prehash.h
File metadata and controls
40 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright (c) The slhdsa-c project authors
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
*/
/* === FIPS 205 Stateless Hash-Based Digital Signature Standard. */
/* HashSLH functions */
#ifndef _SLH_PREHASH_H_
#define _SLH_PREHASH_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include "slh_dsa.h"
/* === Generates a pre-hash SLH-DSA signature. */
/* Algorithm 23: Algorithm 23 hash_slh_sign(M, ctx, PH, SK) */
size_t hash_slh_sign(uint8_t *sig, const uint8_t *m, size_t m_sz,
const uint8_t *ctx, size_t ctx_sz, const char *ph,
const uint8_t *sk, const uint8_t *addrnd,
const slh_param_t *prm);
/* === Verifies a pre-hash SLH-DSA signature. */
/* Algorithm 25: hash_slh_verify(M, SIG, ctx, PH, PK) */
int hash_slh_verify(const uint8_t *m, size_t m_sz, const uint8_t *sig,
size_t sig_sz, const uint8_t *ctx, size_t ctx_sz,
const char *ph, const uint8_t *pk,
const slh_param_t *prm);
#ifdef __cplusplus
}
#endif
/* _SLH_PREHASH_H_ */
#endif