-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsha256.h
28 lines (19 loc) · 814 Bytes
/
sha256.h
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
#ifndef SPX_SHA256_H
#define SPX_SHA256_H
#define SPX_SHA256_BLOCK_BYTES 64
#define SPX_SHA256_OUTPUT_BYTES 32 /* This does not necessarily equal SPX_N */
#if SPX_SHA256_OUTPUT_BYTES < SPX_N
#error Linking against SHA-256 with N larger than 32 bytes is not supported
#endif
#define SPX_SHA256_ADDR_BYTES 22
#include <stddef.h>
#include <stdint.h>
void sha256_inc_init(uint8_t *state);
void sha256_inc_blocks(uint8_t *state, const uint8_t *in, size_t inblocks);
void sha256_inc_finalize(uint8_t *out, uint8_t *state, const uint8_t *in, size_t inlen);
void sha256(uint8_t *out, const uint8_t *in, size_t inlen);
void mgf1(unsigned char *out, unsigned long outlen,
const unsigned char *in, unsigned long inlen);
uint8_t state_seeded[40];
void seed_state(const unsigned char *pub_seed);
#endif