1 #ifndef PQCLEAN_SPHINCSHARAKA192SROBUST_AESNI_UTILSX4_H
2 #define PQCLEAN_SPHINCSHARAKA192SROBUST_AESNI_UTILSX4_H
3 
4 #include "hash_state.h"
5 #include "params.h"
6 
7 #include <stdint.h>
8 
9 /**
10  * For a given leaf index, computes the authentication path and the resulting
11  * root node using Merkle's TreeHash algorithm.
12  * Expects the layer and tree parts of the tree_addr to be set, as well as the
13  * tree type (i.e. PQCLEAN_SPHINCSHARAKA192SROBUST_AESNI_ADDR_TYPE_HASHTREE or PQCLEAN_SPHINCSHARAKA192SROBUST_AESNI_ADDR_TYPE_FORSTREE).
14  * Applies the offset idx_offset to indices before building addresses, so that
15  * it is possible to continue counting indices across trees.
16  */
17 void PQCLEAN_SPHINCSHARAKA192SROBUST_AESNI_treehashx4_FORS_HEIGHT(unsigned char *rootx4,
18         unsigned char *auth_pathx4,
19         const unsigned char *sk_seed,
20         const unsigned char *pub_seed,
21         const uint32_t leaf_idx[4],
22         uint32_t idx_offset[4],
23         void (*gen_leafx4)(unsigned char * /* leaf0 */,
24                            unsigned char * /* leaf1 */,
25                            unsigned char * /* leaf2 */,
26                            unsigned char * /* leaf3 */,
27                            const unsigned char * /* sk_seed */,
28                            const unsigned char * /* pub_seed */,
29                            uint32_t /* addr_idx0 */,
30                            uint32_t /* addr_idx1 */,
31                            uint32_t /* addr_idx2 */,
32                            uint32_t /* addr_idx3 */,
33                            const uint32_t[8] /* tree_addr */,
34                            const hash_state * /* state_seeded */),
35         uint32_t tree_addrx4[4 * 8],
36         const hash_state *state_seeded);
37 
38 #endif
39