Botan 3.4.0
Crypto and TLS for C&
sp_fors.h
Go to the documentation of this file.
1/*
2 * FORS - Forest of Random Subsets
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_SPHINCS_PLUS_FORS_H_
12#define BOTAN_SPHINCS_PLUS_FORS_H_
13
14#include <botan/internal/sp_types.h>
15
16namespace Botan {
17
18class Sphincs_Address;
19class Sphincs_Hash_Functions;
20class Sphincs_Parameters;
21
22/**
23 * Implements a domain specific wrapper for the few-times signature scheme
24 * FORS (Forest of Random Subsets). It is meant to be used inside SPHINCS+
25 * and does not aim to be applicable for other use cases.
26 */
27BOTAN_TEST_API SphincsTreeNode fors_sign_and_pkgen(StrongSpan<ForsSignature> sig_out,
28 const SphincsHashedMessage& hashed_message,
29 const SphincsSecretSeed& secret_seed,
30 const Sphincs_Address& address,
31 const Sphincs_Parameters& params,
32 Sphincs_Hash_Functions& hashes);
33
34/**
35 * Reconstructs the FORS public key from a given FORS @p signature and
36 * @p message. This is tailored for the use case in the SPHINCS+ implementation
37 * and is not meant for general usability.
38 */
40 StrongSpan<const ForsSignature> signature,
41 const Sphincs_Address& address,
42 const Sphincs_Parameters& params,
43 Sphincs_Hash_Functions& hash);
44
45} // namespace Botan
46
47#endif
#define BOTAN_TEST_API
Definition compiler.h:51
Strong< std::vector< uint8_t >, struct SphincsTreeNode_ > SphincsTreeNode
Either an XMSS or FORS tree node or leaf.
Definition sp_types.h:56
SphincsTreeNode fors_sign_and_pkgen(StrongSpan< ForsSignature > sig_out, const SphincsHashedMessage &hashed_message, const SphincsSecretSeed &secret_seed, const Sphincs_Address &address, const Sphincs_Parameters &params, Sphincs_Hash_Functions &hashes)
Definition sp_fors.cpp:46
SphincsTreeNode fors_public_key_from_signature(const SphincsHashedMessage &hashed_message, StrongSpan< const ForsSignature > signature, const Sphincs_Address &address, const Sphincs_Parameters &params, Sphincs_Hash_Functions &hashes)
Definition sp_fors.cpp:112
Strong< secure_vector< uint8_t >, struct SphincsSecretSeed_ > SphincsSecretSeed
Definition sp_types.h:47
Strong< std::vector< uint8_t >, struct SphincsHashedMessage_ > SphincsHashedMessage
Definition sp_types.h:45