Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

hash_address.h 1.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef XMSS_HASH_ADDRESS_H
  2. #define XMSS_HASH_ADDRESS_H
  3. #include <stdint.h>
  4. #define XMSS_ADDR_TYPE_OTS 0
  5. #define XMSS_ADDR_TYPE_LTREE 1
  6. #define XMSS_ADDR_TYPE_HASHTREE 2
  7. void set_layer_addr(uint32_t addr[8], uint32_t layer);
  8. void set_tree_addr(uint32_t addr[8], uint64_t tree);
  9. void set_type(uint32_t addr[8], uint32_t type);
  10. void set_key_and_mask(uint32_t addr[8], uint32_t key_and_mask);
  11. /* Copies the layer and tree part of one address into the other */
  12. void copy_subtree_addr(uint32_t out[8], const uint32_t in[8]);
  13. /* These functions are used for OTS addresses. */
  14. void set_ots_addr(uint32_t addr[8], uint32_t ots);
  15. void set_chain_addr(uint32_t addr[8], uint32_t chain);
  16. void set_hash_addr(uint32_t addr[8], uint32_t hash);
  17. /* This function is used for L-tree addresses. */
  18. void set_ltree_addr(uint32_t addr[8], uint32_t ltree);
  19. /* These functions are used for hash tree addresses. */
  20. void set_tree_height(uint32_t addr[8], uint32_t tree_height);
  21. void set_tree_index(uint32_t addr[8], uint32_t tree_index);
  22. #endif