Botan 3.6.1
Crypto and TLS for C&
sp_fors.h
Go to the documentation of this file.
1/*
2 * FORS - Forest of Random Subsets (FIPS 205, Section 8)
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 * @brief FIPS 205, Algorithm 16: fors_sign (with simultaneous FORS pk generation)
24 *
25 * Implements a domain specific wrapper for the few-times signature scheme
26 * FORS (Forest of Random Subsets). It is meant to be used inside SLH-DSA
27 * and does not aim to be applicable for other use cases.
28 */
29BOTAN_TEST_API SphincsTreeNode fors_sign_and_pkgen(StrongSpan<ForsSignature> sig_out,
30 const SphincsHashedMessage& hashed_message,
31 const SphincsSecretSeed& secret_seed,
32 const Sphincs_Address& address,
33 const Sphincs_Parameters& params,
34 Sphincs_Hash_Functions& hashes);
35
36/**
37 * @brief FIPS 205, Algorithm 17: fors_pkFromSig
38 *
39 * Reconstructs the FORS public key from a given FORS @p signature and
40 * @p message. This is tailored for the use case in the SLH-DSA implementation
41 * and is not meant for general usability.
42 */
44 StrongSpan<const ForsSignature> signature,
45 const Sphincs_Address& address,
46 const Sphincs_Parameters& params,
47 Sphincs_Hash_Functions& hash);
48
49} // namespace Botan
50
51#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:70
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)
FIPS 205, Algorithm 16: fors_sign (with simultaneous FORS pk generation)
Definition sp_fors.cpp:63
Strong< secure_vector< uint8_t >, struct SphincsSecretSeed_ > SphincsSecretSeed
Definition sp_types.h:61
Strong< std::vector< uint8_t >, struct SphincsHashedMessage_ > SphincsHashedMessage
Definition sp_types.h:59
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)
FIPS 205, Algorithm 17: fors_pkFromSig.
Definition sp_fors.cpp:129