Botan 3.4.0
Crypto and TLS for C&
sp_xmss.h
Go to the documentation of this file.
1/*
2 * Sphincs+ XMSS logic
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* This generates a Merkle signature of @p root. The Merkle authentication path logic
26* is mostly hidden in treehash_spec. The WOTS signature followed by the Merkle
27* authentication path are stored in @p out_sig, the new root of the Merkle tree
28* is stored in @p out_root. Set @p idx_leaf to `std::nullopt` if no signature is
29* desired.
30*/
31SphincsTreeNode xmss_sign_and_pkgen(StrongSpan<SphincsXmssSignature> out_sig,
32 const SphincsTreeNode& root,
33 const SphincsSecretSeed& secret_seed,
34 Sphincs_Address& wots_addr,
35 Sphincs_Address& tree_addr,
36 std::optional<TreeNodeIndex> idx_leaf,
37 const Sphincs_Parameters& params,
38 Sphincs_Hash_Functions& hashes);
39
40/* Compute root node of the top-most subtree. */
41SphincsTreeNode xmss_gen_root(const Sphincs_Parameters& params,
42 const SphincsSecretSeed& secret_seed,
43 Sphincs_Hash_Functions& hashes);
44
45} // namespace Botan
46#endif
SphincsTreeNode xmss_sign_and_pkgen(StrongSpan< SphincsXmssSignature > out_sig, const SphincsTreeNode &root, 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)
Definition sp_xmss.cpp:19
Gf448Elem root(const Gf448Elem &elem)
Compute the root of elem in the field.
Strong< std::vector< uint8_t >, struct SphincsTreeNode_ > SphincsTreeNode
Either an XMSS or FORS tree node or leaf.
Definition sp_types.h:56
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:47