Botan  2.1.0
Crypto and TLS for C++11
xmss_wots_common_ops.h
Go to the documentation of this file.
1 /**
2  * XMSS WOTS Common Operations
3  * (C) 2016 Matthias Gierlings
4  *
5  * Botan is released under the Simplified BSD License (see license.txt)
6  **/
7 
8 #ifndef BOTAN_XMSS_WOTS_COMMON_OPS_H__
9 #define BOTAN_XMSS_WOTS_COMMON_OPS_H__
10 
11 #include <cstddef>
12 #include <botan/types.h>
13 #include <botan/xmss_wots_parameters.h>
14 #include <botan/xmss_address.h>
15 #include <botan/xmss_hash.h>
16 
17 namespace Botan {
18 
19 /**
20  * Operations shared by XMSS WOTS signature generation and verification
21  * operations.
22  **/
24  {
25  public:
27  : m_wots_params(oid), m_hash(m_wots_params.hash_function_name()) {}
28 
29 
30  protected:
31  /**
32  * Algorithm 2: Chaining Function.
33  *
34  * @param[out] result Contains the n-byte input string "x" upon call to chain(),
35  * that will be replaced with the value obtained by iterating
36  * the cryptographic hash function "F" steps times on the
37  * input x using the outputs of the PRNG "G".
38  * @param[in] start_idx The start index.
39  * @param[in] steps A number of steps.
40  * @param[in] adrs An OTS Hash Address.
41  * @param[in] seed A Seed.
42  **/
43  void chain(secure_vector<uint8_t>& result,
44  size_t start_idx,
45  size_t steps,
46  XMSS_Address& adrs,
47  const secure_vector<uint8_t>& seed);
48 
51  };
52 
53 }
54 
55 #endif
void chain(secure_vector< uint8_t > &result, size_t start_idx, size_t steps, XMSS_Address &adrs, const secure_vector< uint8_t > &seed)
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
XMSS_WOTS_Parameters m_wots_params
Definition: alg_id.cpp:13
XMSS_WOTS_Common_Ops(XMSS_WOTS_Parameters::ots_algorithm_t oid)