1 #ifndef PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_HARAKA_H 2 #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_HARAKA_H 3 4 #include <stddef.h> 5 #include <stdint.h> 6 7 typedef struct { 8 uint64_t tweaked512_rc64[10][8]; 9 uint32_t tweaked256_rc32[10][8]; 10 uint32_t tweaked256_rc32_sseed[10][8]; 11 } harakactx; 12 13 /* Tweak constants with seed */ 14 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_tweak_constants( 15 harakactx *state, 16 const unsigned char *pk_seed, const unsigned char *sk_seed, 17 unsigned long long seed_length); 18 19 /* Haraka Sponge */ 20 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka_S_inc_init(uint8_t *s_inc); 21 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka_S_inc_absorb(uint8_t *s_inc, const uint8_t *m, size_t mlen, const harakactx *state); 22 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka_S_inc_finalize(uint8_t *s_inc); 23 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka_S_inc_squeeze(uint8_t *out, size_t outlen, uint8_t *s_inc, const harakactx *state); 24 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka_S( 25 unsigned char *out, unsigned long long outlen, 26 const unsigned char *in, unsigned long long inlen, const harakactx *state); 27 28 /* Applies the 512-bit Haraka permutation to in. */ 29 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka512_perm(unsigned char *out, const unsigned char *in, const harakactx *state); 30 31 /* Implementation of Haraka-512 */ 32 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka512(unsigned char *out, const unsigned char *in, const harakactx *state); 33 34 /* Implementation of Haraka-256 */ 35 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka256(unsigned char *out, const unsigned char *in, const harakactx *state); 36 37 /* Implementation of Haraka-256 using sk.seed constants */ 38 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_CLEAN_haraka256_sk(unsigned char *out, const unsigned char *in, const harakactx *state); 39 40 #endif 41