2019-04-16 14:15:03 +01:00
|
|
|
#ifndef SPX_HARAKA_H
|
|
|
|
#define SPX_HARAKA_H
|
|
|
|
|
2019-06-21 13:34:36 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint64_t tweaked512_rc64[10][8];
|
|
|
|
uint32_t tweaked256_rc32[10][8];
|
|
|
|
uint32_t tweaked256_rc32_sseed[10][8];
|
|
|
|
} harakactx;
|
|
|
|
|
2019-04-16 14:15:03 +01:00
|
|
|
/* Tweak constants with seed */
|
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_tweak_constants(
|
2019-06-21 13:34:36 +01:00
|
|
|
harakactx *state,
|
2019-04-16 14:15:03 +01:00
|
|
|
const unsigned char *pk_seed, const unsigned char *sk_seed,
|
|
|
|
unsigned long long seed_length);
|
|
|
|
|
|
|
|
/* Haraka Sponge */
|
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka_S_inc_init(uint8_t *s_inc);
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka_S_inc_absorb(uint8_t *s_inc, const uint8_t *m, size_t mlen, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka_S_inc_finalize(uint8_t *s_inc);
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka_S_inc_squeeze(uint8_t *out, size_t outlen, uint8_t *s_inc, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka_S(
|
|
|
|
unsigned char *out, unsigned long long outlen,
|
2019-06-21 13:34:36 +01:00
|
|
|
const unsigned char *in, unsigned long long inlen, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
|
|
|
|
/* Applies the 512-bit Haraka permutation to in. */
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka512_perm(unsigned char *out, const unsigned char *in, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
|
|
|
|
/* Implementation of Haraka-512 */
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka512(unsigned char *out, const unsigned char *in, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
|
|
|
|
/* Implementation of Haraka-256 */
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka256(unsigned char *out, const unsigned char *in, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
|
|
|
|
/* Implementation of Haraka-256 using sk.seed constants */
|
2019-06-21 13:34:36 +01:00
|
|
|
void PQCLEAN_SPHINCSHARAKA192FSIMPLE_CLEAN_haraka256_sk(unsigned char *out, const unsigned char *in, const harakactx *state);
|
2019-04-16 14:15:03 +01:00
|
|
|
|
|
|
|
#endif
|