Botan 3.6.1
Crypto and TLS for C&
sp_xmss.h
Go to the documentation of this file.
1/*
2 * SLH-DSA's XMSS - eXtended Merkle Signature Scheme (FIPS 205, Section 6)
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_XMSS_H_
12#define BOTAN_SP_XMSS_H_
13
14#include <botan/internal/sp_types.h>
15
16#include <optional>
17
18namespace Botan {
19
20class Sphincs_Address;
21class Sphincs_Hash_Functions;
22class Sphincs_Parameters;
23
24/**
25 * @brief FIPS 205, Algorithm 10: xmss_sign
26 *
27 * This generates a Merkle signature of @p message (i.e. a FORS public key
28 * (bottom layer) or an XMSS root node). The Merkle authentication path logic
29 * is mostly hidden in treehash_spec. The WOTS signature followed by the Merkle
30 * authentication path are stored in @p out_sig.
31 * Set @p idx_leaf to `std::nullopt` if no signature is
32 * desired.
33 *
34 * @returns the XMSS public key (i.e. the root of the XMSS merkle tree)
35 */
36SphincsTreeNode xmss_sign_and_pkgen(StrongSpan<SphincsXmssSignature> out_sig,
37 const SphincsTreeNode& message,
38 const SphincsSecretSeed& secret_seed,
39 Sphincs_Address& wots_addr,
40 Sphincs_Address& tree_addr,
41 std::optional<TreeNodeIndex> idx_leaf,
42 const Sphincs_Parameters& params,
43 Sphincs_Hash_Functions& hashes);
44
45/**
46 * Compute the XMSS public key (root node) of the top-most subtree.
47 * Contains logic of FIPS 205, Algorithm 18: slh_keygen_internal
48 */
49SphincsTreeNode xmss_gen_root(const Sphincs_Parameters& params,
50 const SphincsSecretSeed& secret_seed,
51 Sphincs_Hash_Functions& hashes);
52
53} // namespace Botan
54#endif
Strong< std::vector< uint8_t >, struct SphincsTreeNode_ > SphincsTreeNode
Either an XMSS or FORS tree node or leaf.
Definition sp_types.h:70
SphincsTreeNode xmss_gen_root(const Sphincs_Parameters &params, const SphincsSecretSeed &secret_seed, Sphincs_Hash_Functions &hashes)
Definition sp_xmss.cpp:58
Strong< secure_vector< uint8_t >, struct SphincsSecretSeed_ > SphincsSecretSeed
Definition sp_types.h:61
SphincsTreeNode xmss_sign_and_pkgen(StrongSpan< SphincsXmssSignature > out_sig, const SphincsTreeNode &message, const SphincsSecretSeed &secret_seed, Sphincs_Address &wots_addr, Sphincs_Address &tree_addr, std::optional< TreeNodeIndex > idx_leaf, const Sphincs_Parameters &params, Sphincs_Hash_Functions &hashes)
FIPS 205, Algorithm 10: xmss_sign.
Definition sp_xmss.cpp:19