Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 ***/
28 class XMSS_WOTS_Signature_Operation : public virtual PK_Ops::Signature,
29 public XMSS_WOTS_Common_Ops
30 {
31 public:
32 XMSS_WOTS_Signature_Operation(
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 **/
46 secure_vector<uint8_t> sign(RandomNumberGenerator&) override;
47
48 void update(const uint8_t msg[], size_t msg_len) override;
49
50 private:
51 wots_keysig_t sign(const secure_vector<uint8_t>& msg,
52 const wots_keysig_t& priv_key,
53 XMSS_Address& adrs,
54 const secure_vector<uint8_t>& seed);
55 XMSS_WOTS_Addressed_PrivateKey m_priv_key;
56 secure_vector<uint8_t> m_msg_buf;
57 };
58
59 }
60
61 #endif
62
Botan::XMSS_WOTS_Addressed_PrivateKey
Definition: xmss_wots_addressed_privatekey.h:24
Botan::RandomNumberGenerator
Definition: rng.h:25
Botan::XMSS_WOTS_Signature_Operation::~XMSS_WOTS_Signature_Operation
virtual ~XMSS_WOTS_Signature_Operation()=default
Botan::XMSS_Address
Definition: xmss_address.h:23
Botan::PK_Ops::Signature
Definition: pk_ops.h:86
Botan::XMSS_WOTS_Common_Ops
Definition: xmss_wots_common_ops.h:23
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::XMSS_WOTS_Signature_Operation::XMSS_WOTS_Signature_Operation
XMSS_WOTS_Signature_Operation(const XMSS_WOTS_Addressed_PrivateKey &private_key)
Definition: xmss_wots_signature_operation.cpp:18
Botan
Definition: alg_id.cpp:13
Botan::wots_keysig_t
std::vector< secure_vector< uint8_t > > wots_keysig_t
Definition: xmss_common_ops.h:20
Botan::XMSS_WOTS_Signature_Operation::sign
secure_vector< uint8_t > sign(RandomNumberGenerator &) override
Definition: xmss_wots_signature_operation.cpp:41
Botan::XMSS_WOTS_Signature_Operation
Definition: xmss_wots_signature_operation.h:28
Botan::XMSS_WOTS_Signature_Operation::update
void update(const uint8_t msg[], size_t msg_len) override
Definition: xmss_wots_signature_operation.cpp:29