2017-10-19 15:04:42 +01:00
|
|
|
#ifndef XMSS_HASH_ADDRESS_H
|
|
|
|
#define XMSS_HASH_ADDRESS_H
|
|
|
|
|
2016-07-11 10:15:16 +01:00
|
|
|
#include <stdint.h>
|
2016-02-16 15:31:18 +00:00
|
|
|
|
2017-10-24 15:20:31 +01:00
|
|
|
#define XMSS_ADDR_TYPE_OTS 0
|
|
|
|
#define XMSS_ADDR_TYPE_LTREE 1
|
|
|
|
#define XMSS_ADDR_TYPE_HASHTREE 2
|
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_layer_addr(uint32_t addr[8], uint32_t layer);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_tree_addr(uint32_t addr[8], uint64_t tree);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_type(uint32_t addr[8], uint32_t type);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_key_and_mask(uint32_t addr[8], uint32_t key_and_mask);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-10-24 10:53:45 +01:00
|
|
|
/* Copies the layer and tree part of one address into the other */
|
|
|
|
void copy_subtree_addr(uint32_t out[8], const uint32_t in[8]);
|
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
/* These functions are used for OTS addresses. */
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_ots_addr(uint32_t addr[8], uint32_t ots);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_chain_addr(uint32_t addr[8], uint32_t chain);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_hash_addr(uint32_t addr[8], uint32_t hash);
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-10-23 13:10:39 +01:00
|
|
|
/* This function is used for L-tree addresses. */
|
2016-07-11 10:15:16 +01:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_ltree_addr(uint32_t addr[8], uint32_t ltree);
|
2016-02-16 15:31:18 +00:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
/* These functions are used for hash tree addresses. */
|
2016-02-16 15:31:18 +00:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_tree_height(uint32_t addr[8], uint32_t treeHeight);
|
2016-02-16 15:31:18 +00:00
|
|
|
|
2017-08-03 16:38:34 +01:00
|
|
|
void set_tree_index(uint32_t addr[8], uint32_t treeIndex);
|
2017-10-19 15:04:42 +01:00
|
|
|
|
|
|
|
#endif
|