Botan 3.11.0
Crypto and TLS for C&
sp_hypertree.h
Go to the documentation of this file.
1/*
2 * SLH-DSA's Hypertree Logic (FIPS 205, Section 7)
3 * (C) 2023 Jack Lloyd
4 * 2023 Fabian Albert, René Meusel, Amos Treiber - Rohde & Schwarz Cybersecurity
5 *
6 * Parts of this file have been adapted from https://github.com/sphincs/sphincsplus
7 *
8 * Botan is released under the Simplified BSD License (see license.txt)
9 */
10
11#ifndef BOTAN_SP_HYPERTREE_H_
12#define BOTAN_SP_HYPERTREE_H_
13
14#include <botan/internal/sp_types.h>
15
16namespace Botan {
17
20
21/**
22 * @brief FIPS 205, Algorithm 12: ht_sign
23 *
24 * Creates a SLH-DSA XMSS hypertree signature of @p message_to_sign. The signature is written
25 * into the buffer defined by @p out_sig. @p tree_index_in_layer and @p idx_leaf define which
26 * XMSS tree of the hypertree and which leaf of this XMSS tree is used for signing.
27 */
29 const SphincsTreeNode& message_to_sign,
30 const SphincsSecretSeed& secret_seed,
31 XmssTreeIndexInLayer tree_index_in_layer,
32 TreeNodeIndex idx_leaf,
33 const Sphincs_Parameters& params,
35
36/**
37 * @brief FIPS 205, Algorithm 13: ht_verify
38 *
39 * Given a message @p signed_msg the SLH-DSA XMSS hypertree is reconstructed
40 * using a hypertree signature @p ht_sig. @p tree_index_in_layer and @p idx_leaf
41 * define which XMSS tree of the hypertree and which leaf of this XMSS tree was
42 * used for signing.
43 *
44 * @returns true iff the top-most reconstructed root equals @p pk_root
45 */
46bool ht_verify(const SphincsTreeNode& signed_msg,
48 const SphincsTreeNode& pk_root,
49 XmssTreeIndexInLayer tree_index_in_layer,
50 TreeNodeIndex idx_leaf,
51 const Sphincs_Parameters& params,
53
54} // namespace Botan
55#endif
Strong< std::vector< uint8_t >, struct SphincsTreeNode_ > SphincsTreeNode
Either an XMSS or FORS tree node or leaf.
Definition sp_types.h:70
Strong< uint64_t, struct XmssTreeIndexInLayer_, EnableArithmeticWithPlainNumber > XmssTreeIndexInLayer
Index of an XMSS tree (unique for just the local hyper-tree layer).
Definition sp_types.h:89
void ht_sign(StrongSpan< SphincsHypertreeSignature > out_sig, const SphincsTreeNode &message_to_sign, const SphincsSecretSeed &secret_seed, XmssTreeIndexInLayer tree_index_in_layer, TreeNodeIndex idx_leaf, const Sphincs_Parameters &params, Sphincs_Hash_Functions &hashes)
FIPS 205, Algorithm 12: ht_sign.
bool ht_verify(const SphincsTreeNode &signed_msg, StrongSpan< const SphincsHypertreeSignature > ht_sig, const SphincsTreeNode &pk_root, XmssTreeIndexInLayer tree_index_in_layer, TreeNodeIndex idx_leaf, const Sphincs_Parameters &params, Sphincs_Hash_Functions &hashes)
FIPS 205, Algorithm 13: ht_verify.
Strong< secure_vector< uint8_t >, struct SphincsSecretSeed_ > SphincsSecretSeed
Definition sp_types.h:61
Strong< uint32_t, struct TreeNodeIndex_, EnableArithmeticWithPlainNumber > TreeNodeIndex
Index of an individual node inside an XMSS or FORS tree.
Definition sp_types.h:92