Botan  2.1.0
Crypto and TLS for C++11
xmss_wots_signature_operation.h
Go to the documentation of this file.
1 /**
2  * XMSS WOTS Signature Operation
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_SIGNATURE_OPERATION_H__
9 #define BOTAN_XMSS_WOTS_SIGNATURE_OPERATION_H__
10 
11 #include <cstddef>
12 #include <iterator>
13 #include <botan/assert.h>
14 #include <botan/types.h>
15 #include <botan/pk_ops.h>
16 #include <botan/internal/xmss_wots_addressed_privatekey.h>
17 #include <botan/internal/xmss_wots_common_ops.h>
18 
19 namespace Botan {
20 
21 /**
22  * Signature generation operation for Winternitz One Time Signatures for use
23  * in Extended Hash-Based Signatures (XMSS).
24  *
25  * This operation is not intended for stand-alone use and thus not registered
26  * in the Botan algorithm registry.
27  ***/
30  {
31  public:
33  const XMSS_WOTS_Addressed_PrivateKey& private_key);
34 
35  virtual ~XMSS_WOTS_Signature_Operation() = default;
36 
37  /**
38  * Creates a XMSS WOTS signature for the message provided through call
39  * to update(). XMSS wots only supports one message part and a fixed
40  * message size of "n" bytes where "n" equals the element size of
41  * the chosen XMSS WOTS signature method. The random number generator
42  * argument is supplied for interface compatibility and remains unused.
43  *
44  * @return serialized Winternitz One Time Signature.
45  **/
47 
48  void update(const uint8_t msg[], size_t msg_len) override;
49 
50  private:
52  const wots_keysig_t& priv_key,
53  XMSS_Address& adrs,
54  const secure_vector<uint8_t>& seed);
56  secure_vector<uint8_t> m_msg_buf;
57  };
58 
59 }
60 
61 #endif
62 
virtual ~XMSS_WOTS_Signature_Operation()=default
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
XMSS_WOTS_Signature_Operation(const XMSS_WOTS_Addressed_PrivateKey &private_key)
Definition: alg_id.cpp:13
std::vector< secure_vector< uint8_t > > wots_keysig_t
secure_vector< uint8_t > sign(RandomNumberGenerator &) override
void update(const uint8_t msg[], size_t msg_len) override