pqc/common/fips202.h

48 lines
1.6 KiB
C
Raw Normal View History

2019-01-15 14:35:25 +00:00
#ifndef FIPS202_H
#define FIPS202_H
2019-02-17 10:54:38 +00:00
#include <stddef.h>
2019-01-15 14:35:25 +00:00
#include <stdint.h>
#define SHAKE128_RATE 168
#define SHAKE256_RATE 136
#define SHA3_256_RATE 136
#define SHA3_512_RATE 72
2019-01-15 14:35:25 +00:00
2019-02-17 10:54:38 +00:00
void shake128_absorb(uint64_t *s, const uint8_t *input, size_t inlen);
2019-01-16 09:15:18 +00:00
2019-02-17 10:54:38 +00:00
void shake128_squeezeblocks(uint8_t *output, size_t nblocks, uint64_t *s);
2019-01-16 09:15:18 +00:00
void shake128_inc_init(uint64_t *s_inc);
void shake128_inc_absorb(uint64_t *s_inc, const uint8_t *input, size_t inlen);
void shake128_inc_finalize(uint64_t *s_inc);
void shake128_inc_squeeze(uint8_t *output, size_t outlen, uint64_t *s_inc);
2019-01-16 09:15:18 +00:00
void shake256_absorb(uint64_t *s, const uint8_t *input, size_t inlen);
2019-02-17 10:54:38 +00:00
void shake256_squeezeblocks(uint8_t *output, size_t nblocks, uint64_t *s);
2019-01-15 14:35:25 +00:00
void shake256_inc_init(uint64_t *s_inc);
void shake256_inc_absorb(uint64_t *s_inc, const uint8_t *input, size_t inlen);
void shake256_inc_finalize(uint64_t *s_inc);
void shake256_inc_squeeze(uint8_t *output, size_t outlen, uint64_t *s_inc);
2019-02-17 10:54:38 +00:00
void shake128(uint8_t *output, size_t outlen,
const uint8_t *input, size_t inlen);
2019-01-16 09:15:18 +00:00
2019-02-17 10:54:38 +00:00
void shake256(uint8_t *output, size_t outlen,
const uint8_t *input, size_t inlen);
2019-01-16 09:15:18 +00:00
2019-03-07 15:35:27 +00:00
void sha3_256_inc_init(uint64_t *s_inc);
void sha3_256_inc_absorb(uint64_t *s_inc, const uint8_t *input, size_t inlen);
void sha3_256_inc_finalize(uint8_t *output, uint64_t *s_inc);
2019-02-17 10:54:38 +00:00
void sha3_256(uint8_t *output, const uint8_t *input, size_t inlen);
2019-03-07 15:35:27 +00:00
void sha3_512_inc_init(uint64_t *s_inc);
void sha3_512_inc_absorb(uint64_t *s_inc, const uint8_t *input, size_t inlen);
void sha3_512_inc_finalize(uint8_t *output, uint64_t *s_inc);
2019-02-17 10:54:38 +00:00
void sha3_512(uint8_t *output, const uint8_t *input, size_t inlen);
2019-01-15 14:35:25 +00:00
#endif