|
Botan 3.14.1
Crypto and TLS for C&
|
#include <xmss_address.h>
Public Types | |
| enum class | Key_Mask : uint8_t { Key_Mode = 0 , Mask_Mode = 1 , Mask_MSB_Mode = 1 , Mask_LSB_Mode = 2 } |
| enum class | Type : uint8_t { None = 255 , OTS_Hash_Address = 0 , LTree_Address = 1 , Hash_Tree_Address = 2 } |
Public Member Functions | |
| std::span< const uint8_t > | bytes () const |
| uint32_t | get_chain_address () const |
| uint32_t | get_hash_address () const |
| Key_Mask | get_key_mask_mode () const |
| uint32_t | get_layer_addr () const |
| uint32_t | get_ltree_address () const |
| uint32_t | get_ots_address () const |
| uint64_t | get_tree_addr () const |
| uint32_t | get_tree_height () const |
| uint32_t | get_tree_index () const |
| Type | get_type () const |
| XMSS_Address & | operator= (const XMSS_Address &other)=default |
| XMSS_Address & | operator= (XMSS_Address &&other)=default |
| void | set_chain_address (uint32_t value) |
| void | set_hash_address (uint32_t value) |
| void | set_key_mask_mode (Key_Mask value) |
| void | set_layer_addr (uint32_t value) |
| void | set_ltree_address (uint32_t value) |
| void | set_ots_address (uint32_t value) |
| void | set_tree_addr (uint64_t value) |
| void | set_tree_height (uint32_t value) |
| void | set_tree_index (uint32_t value) |
| void | set_type (Type type) |
| size_t | size () const |
| XMSS_Address () | |
| XMSS_Address (const XMSS_Address &other)=default | |
| XMSS_Address (Type type) | |
| XMSS_Address (XMSS_Address &&other)=default | |
| ~XMSS_Address ()=default | |
Generic XMSS Address type holding 256 Bits of data. Properties of all three address formats L-Tree-Address, Hash-Tree-Address, OTS-Hash-Address can be called depending on the type currently assigned to the XMSS address using set_type().
Definition at line 25 of file xmss_address.h.
|
strong |
The available modes for an XMSS Address:
| Enumerator | |
|---|---|
| Key_Mode | |
| Mask_Mode | |
| Mask_MSB_Mode | |
| Mask_LSB_Mode | |
Definition at line 42 of file xmss_address.h.
|
strong |
Distinct types an XMSS_Address can represent. The available types are specified in [1] - 2.5 Hash Function Address Scheme.
| Enumerator | |
|---|---|
| None | |
| OTS_Hash_Address | |
| LTree_Address | |
| Hash_Tree_Address | |
Definition at line 31 of file xmss_address.h.
|
inline |
Definition at line 301 of file xmss_address.h.
References None, and set_type().
Referenced by operator=(), operator=(), XMSS_Address(), and XMSS_Address().
|
default |
|
default |
References XMSS_Address().
|
default |
References XMSS_Address().
|
inlineexplicit |
Definition at line 310 of file xmss_address.h.
References set_type().
|
inline |
Definition at line 294 of file xmss_address.h.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash(), and Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().
|
inline |
Retrieve the chain address. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
Definition at line 192 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
|
inline |
Retrieves the address of the hash function call within the chain. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
Definition at line 245 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
|
inline |
Retrieves the mode the address is currently set to. (See XMSS_Address::Key_Mask for details.)
Definition at line 116 of file xmss_address.h.
|
inline |
retrieves the Layer Address. A call to this method is only required by XMSS_MT. The Layer Address is constantly zero for XMSS. For XMSS_MT it describes the height of the tree in the multi-tree structure.
Definition at line 51 of file xmss_address.h.
|
inline |
Retrieves the index of the leaf computed with this LTree. A call to this method is only valid, if the address type is set to Type::LTree_Address.
Definition at line 165 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and LTree_Address.
|
inline |
Retrieve the index of the OTS key pair within the tree. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
Definition at line 137 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
|
inline |
retrieves the Tree Address. A call to this method is only required by XMSS_MT. The Tree Address is constantly zero for XMSS. For XMSS_MT it describes the position of the tree within its layer.
Definition at line 67 of file xmss_address.h.
|
inline |
Retrieves the height of the tree node to be computed within the tree. A call to this method is only valid, if the address type is set to Type::LTree_Address or Type::Hash_Tree_Address.
Definition at line 217 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), Hash_Tree_Address, and LTree_Address.
Referenced by Botan::XMSS_Tree_Builder::tree_hash().
|
inline |
Retrieves the index of the tree node at current tree height in the tree. A call to this method is only valid, if the address type is set to Type::LTree_Address or Type::Hash_Tree_Address.
Definition at line 273 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), Hash_Tree_Address, and LTree_Address.
Referenced by Botan::XMSS_Common_Ops::root_from_signature(), and Botan::XMSS_Tree_Builder::tree_hash().
|
inline |
retrieves the logical type currently assigned to the XMSS Address instance.
Definition at line 91 of file xmss_address.h.
Referenced by get_chain_address(), get_hash_address(), get_ltree_address(), get_ots_address(), get_tree_height(), get_tree_index(), set_chain_address(), set_hash_address(), set_key_mask_mode(), set_ltree_address(), set_ots_address(), set_tree_height(), and set_tree_index().
|
default |
References XMSS_Address().
|
default |
References XMSS_Address().
|
inline |
Set the chain address. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
Definition at line 203 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
|
inline |
Sets the address of the hash function call within the chain. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
| value | address of the hash function call within chain. |
Definition at line 259 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
|
inline |
Changes the mode the address currently used address mode. (XMSS_Address::Key_Mask for details.)
| value | Target mode. |
Definition at line 124 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), Mask_LSB_Mode, and OTS_Hash_Address.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash().
|
inline |
sets the Layer Address. A call to this method is only required by XMSS_MT. The Layer Address is constantly zero for XMSS. For XMSS_MT it describes the height of the tree in the multi-tree structure.
Definition at line 58 of file xmss_address.h.
|
inline |
Sets the index of the leaf computed with this LTree. A call to this method is only valid, if the address type is set to Type::LTree_Address.
| value | index of the leaf. |
Definition at line 179 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and LTree_Address.
Referenced by Botan::XMSS_Common_Ops::root_from_signature().
|
inline |
Sets the index of the OTS key pair within the tree. A call to this method is only valid, if the address type is set to Type::OTS_Hash_Address.
| value | index of OTS key pair. |
Definition at line 151 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), and OTS_Hash_Address.
Referenced by Botan::XMSS_Common_Ops::root_from_signature(), and Botan::XMSS_Signature_Operation::sign().
|
inline |
sets the Tree Address. A call to this method is only required by XMSS_MT. The Tree Address is constantly zero for XMSS. For XMSS_MT it describes the position of the tree within its layer.
Definition at line 79 of file xmss_address.h.
|
inline |
Sets the height of the tree node to be computed within the tree. A call to this method is only valid, if the address type is set to Type::LTree_Address or Type::Hash_Tree_Address.
| value | height of the tree node. |
Definition at line 231 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), Hash_Tree_Address, and LTree_Address.
Referenced by Botan::XMSS_Common_Ops::root_from_signature(), and Botan::XMSS_Tree_Builder::tree_hash().
|
inline |
Sets the index of the tree node at current tree height in the tree. A call to this method is only valid, if the address type is set to Type::LTree_Address or Type::Hash_Tree_Address.
| value | index of the tree node at current height. |
Definition at line 287 of file xmss_address.h.
References BOTAN_ASSERT, get_type(), Hash_Tree_Address, and LTree_Address.
Referenced by Botan::XMSS_Common_Ops::root_from_signature(), and Botan::XMSS_Tree_Builder::tree_hash().
|
inline |
Changes the logical type currently assigned to the XMSS Address instance. Please note that changing the type will automatically reset the 128 LSBs of the Address to zero. This affects the key_mask_mode property as well as all properties identified by XMSS_Address::Property.
| type | Type that shall be assigned to the address (OTS_Hash_Address, LTree_Address or Hash_Tree_Address) |
Definition at line 103 of file xmss_address.h.
Referenced by Botan::XMSS_Common_Ops::root_from_signature(), Botan::XMSS_Signature_Operation::sign(), Botan::XMSS_Tree_Builder::tree_hash(), XMSS_Address(), and XMSS_Address().
|
inline |
Definition at line 299 of file xmss_address.h.
Referenced by Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().