|
Botan 3.14.1
Crypto and TLS for C&
|
#include <xmss_common_ops.h>
Static Public Member Functions | |
| static void | create_l_tree (secure_vector< uint8_t > &result, const wots_keysig_t &pk, XMSS_Address adrs, const secure_vector< uint8_t > &seed, XMSS_Hash &hash, size_t element_size, size_t wots_len) |
| static void | create_l_trees (std::span< uint8_t > leaves, std::span< uint8_t > pks, std::span< XMSS_Address > addrs, std::span< const uint8_t > seed, XMSS_Hash &hash, size_t element_size, size_t wots_len) |
| static void | randomize_tree_hash (secure_vector< uint8_t > &result, const secure_vector< uint8_t > &left, const secure_vector< uint8_t > &right, XMSS_Address adrs, const secure_vector< uint8_t > &seed, XMSS_Hash &hash, size_t element_size) |
| static secure_vector< uint8_t > | root_from_signature (uint32_t idx_leaf, const XMSS_TreeSignature &tree_sig, const secure_vector< uint8_t > &msg, XMSS_Address adrs, const secure_vector< uint8_t > &seed, XMSS_Hash &hash, const XMSS_WOTS_Parameters &wots_params, size_t tree_height) |
Operations shared by XMSS signature generation and verification operations.
Definition at line 38 of file xmss_common_ops.h.
|
static |
Algorithm 8: "ltree" Create an L-tree used to compute the leaves of the binary hash tree. Takes a WOTS+ public key and compresses it to a single n-byte value.
This overload is used in multithreaded scenarios, where it is required to provide separate instances of XMSS_Hash to each thread.
| [out] | result | Public key compressed to a single n-byte value pk[0]. |
| [in] | pk | Winternitz One Time Signatures+ public key. |
| [in] | adrs | Address encoding the address of the L-Tree |
| [in] | SEED | The seed generated during the public key generation. |
| [in] | Hashes | Instance of XMSS_Hash, that may only be used by the thread executing create_l_tree. |
| [in] | element_size | Size of each node in bytes, the parameter "n" |
| [in] | wots_len | Number of WOTS+ chains, the parameter "len" |
Definition at line 49 of file xmss_common_ops.cpp.
References BOTAN_ASSERT_NOMSG, Botan::copy_mem(), and create_l_trees().
Referenced by root_from_signature().
|
static |
Algorithm 8: "ltree", applied to many WOTS+ public keys at once, batching the hash calls of each tree level across all keys.
| [out] | leaves | The compressed n-byte value of each key |
| [in,out] | pks | The WOTS+ public keys, each len*n bytes, contiguous. Destroyed by the computation. |
| [in,out] | addrs | Per key, its L-tree address with the L-tree address set. The tree height/index and key/mask mode are modified. |
| [in] | SEED | The public seed |
| [in] | Hashes | Instance of XMSS_Hash, that may only be used by the thread executing create_l_trees. |
| [in] | element_size | Size of each node in bytes, the parameter "n" |
| [in] | wots_len | Number of WOTS+ chains, the parameter "len" |
Definition at line 69 of file xmss_common_ops.cpp.
References BOTAN_ASSERT_NOMSG, Botan::concat(), Botan::copy_mem(), Botan::XMSS_Hash::h_batch(), Botan::XMSS_Address::Key_Mode, Botan::XMSS_Address::Mask_LSB_Mode, Botan::XMSS_Address::Mask_MSB_Mode, Botan::XMSS_Hash::prf_batch(), and Botan::xor_buf().
Referenced by create_l_tree().
|
static |
Algorithm 7: "RAND_HASH"
Generates a randomized hash.
This overload is used in multithreaded scenarios, where it is required to provide separate instances of XMSS_Hash to each thread.
| [out] | result | The resulting randomized hash. |
| [in] | left | Left half of the hash function input. |
| [in] | right | Right half of the hash function input. |
| [in] | adrs | Address of the hash function call. |
| [in] | SEED | The seed for G. |
| [in] | Hashes | Instance of XMSS_Hash, that may only by the thread executing generate_public_key. |
| [in] | element_size | Size of each node in bytes, the parameter "n" |
Definition at line 18 of file xmss_common_ops.cpp.
References BOTAN_ASSERT, Botan::XMSS_Address::bytes(), Botan::XMSS_Hash::h(), Botan::XMSS_Address::Key_Mode, Botan::XMSS_Address::Mask_LSB_Mode, Botan::XMSS_Address::Mask_MSB_Mode, Botan::XMSS_Hash::prf(), and Botan::XMSS_Address::set_key_mask_mode().
Referenced by root_from_signature(), and Botan::XMSS_Tree_Builder::tree_hash().
|
static |
Algorithm 13: "XMSS_rootFromSig" Computes a root node using a tree signature and a message.
| [in] | idx_leaf | Index of the WOTS+ key pair (the leaf) within the tree. |
| [in] | tree_sig | The WOTS+ signature and authentication path. |
| [in] | msg | The signed message (for XMSS^MT layers above the lowest: the root node of the tree below). |
| [in] | adrs | Address of the tree. The caller presets the layer and tree address fields (both zero for XMSS). |
| [in] | SEED | The public seed. |
| [in] | Hashes | The hash instance to use. |
| [in] | wots_params | The WOTS+ parameters. |
| [in] | tree_height | Height of the tree, the parameter "h" (for XMSS^MT: the height of a single layer's tree, "h/d"). |
Definition at line 167 of file xmss_common_ops.cpp.
References Botan::XMSS_TreeSignature::authentication_path, create_l_tree(), Botan::XMSS_WOTS_Parameters::element_size(), Botan::XMSS_Address::get_tree_index(), Botan::XMSS_Address::Hash_Tree_Address, Botan::XMSS_WOTS_Base::key_data(), Botan::XMSS_WOTS_Parameters::len(), Botan::XMSS_Address::LTree_Address, Botan::XMSS_Address::OTS_Hash_Address, Botan::XMSS_TreeSignature::ots_signature, randomize_tree_hash(), Botan::XMSS_Address::set_ltree_address(), Botan::XMSS_Address::set_ots_address(), Botan::XMSS_Address::set_tree_height(), Botan::XMSS_Address::set_tree_index(), and Botan::XMSS_Address::set_type().