1 #ifndef PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_HARAKA_H 2 #define PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_HARAKA_H 3 4 #include <immintrin.h> 5 #include <stddef.h> 6 #include <stdint.h> 7 8 typedef struct { 9 __m128i rc[40]; 10 __m128i rc_sseed[40]; 11 } harakactx; 12 13 /* Tweak constants with seed */ 14 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_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_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_S_inc_init(uint8_t *s_inc); 21 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_S_inc_absorb(uint8_t *s_inc, const uint8_t *m, size_t mlen, const harakactx *state); 22 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_S_inc_finalize(uint8_t *s_inc); 23 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_S_inc_squeeze(uint8_t *out, size_t outlen, uint8_t *s_inc, const harakactx *state); 24 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_S( 25 unsigned char *out, unsigned long long outlen, 26 const unsigned char *in, unsigned long long inlen, const harakactx *state); 27 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka_Sx4( 28 unsigned char *out0, 29 unsigned char *out1, 30 unsigned char *out2, 31 unsigned char *out3, 32 unsigned long long outlen, 33 const unsigned char *in0, 34 const unsigned char *in1, 35 const unsigned char *in2, 36 const unsigned char *in3, 37 unsigned long long inlen, 38 const harakactx *state); 39 40 41 /* Applies the 512-bit Haraka permutation to in. */ 42 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka512_perm(unsigned char *out, const unsigned char *in, const harakactx *state); 43 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka512_perm_x4(unsigned char *out, const unsigned char *in, const harakactx *state); 44 45 /* Implementation of Haraka-512 */ 46 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka512(unsigned char *out, const unsigned char *in, const harakactx *state); 47 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka512x4(unsigned char *out, const unsigned char *in, const harakactx *state); 48 49 /* Implementation of Haraka-256 */ 50 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka256(unsigned char *out, const unsigned char *in, const harakactx *state); 51 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka256x4(unsigned char *out, const unsigned char *in, const harakactx *state); 52 53 /* Implementation of Haraka-256 using sk.seed constants */ 54 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka256_sk(unsigned char *out, const unsigned char *in, const harakactx *state); 55 void PQCLEAN_SPHINCSHARAKA192FSIMPLE_AESNI_haraka256_skx4(unsigned char *out, const unsigned char *in, const harakactx *state); 56 57 #endif 58