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.
 
 
 

27 lines
941 B

  1. #ifndef SPX_HASH_STATE_H
  2. #define SPX_HASH_STATE_H
  3. /**
  4. * Defines the type of the hash function state.
  5. *
  6. * Don't be fooled into thinking this instance of SPHINCS+ isn't stateless!
  7. *
  8. * From Section 7.2.2 from the SPHINCS+ round-2 specification:
  9. *
  10. * Each of the instances of the tweakable hash function take PK.seed as its
  11. * first input, which is constant for a given key pair – and, thus, across
  12. * a single signature. This leads to a lot of redundant computation. To remedy
  13. * this, we pad PK.seed to the length of a full 64-byte SHA-256 input block.
  14. * Because of the Merkle-Damgård construction that underlies SHA-256, this
  15. * allows for reuse of the intermediate SHA-256 state after the initial call to
  16. * the compression function which improves performance.
  17. *
  18. * We pass this hash state around in functions, because otherwise we need to
  19. * have a global variable.
  20. */
  21. #include "haraka.h"
  22. #define hash_state harakactx
  23. #endif