You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
1.7 KiB

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