Botan 3.11.0
Crypto and TLS for C&
xmss_signature_operation.h
Go to the documentation of this file.
1/*
2 * XMSS Signature Operation
3 * (C) 2016,2017,2018 Matthias Gierlings
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 **/
7
8#ifndef BOTAN_XMSS_SIGNATURE_OPERATION_H_
9#define BOTAN_XMSS_SIGNATURE_OPERATION_H_
10
11#include <botan/pk_ops.h>
12#include <botan/xmss.h>
13#include <botan/internal/xmss_address.h>
14#include <botan/internal/xmss_hash.h>
15#include <botan/internal/xmss_signature.h>
16#include <botan/internal/xmss_wots.h>
17
18namespace Botan {
19
20/**
21 * Signature generation operation for Extended Hash-Based Signatures (XMSS) as
22 * defined in:
23 *
24 * [1] XMSS: Extended Hash-Based Signatures,
25 * Request for Comments: 8391
26 * Release: May 2018.
27 * https://datatracker.ietf.org/doc/rfc8391/
28 **/
29class XMSS_Signature_Operation final : public virtual PK_Ops::Signature {
30 public:
31 explicit XMSS_Signature_Operation(const XMSS_PrivateKey& private_key);
32
33 /**
34 * Creates an XMSS signature for the message provided through call to
35 * update().
36 *
37 * @return serialized XMSS signature.
38 **/
39 std::vector<uint8_t> sign(RandomNumberGenerator& rng) override;
40
41 void update(std::span<const uint8_t> input) override;
42
43 size_t signature_length() const override;
44
46
47 std::string hash_function() const override { return m_hash.hash_function(); }
48
49 private:
50 void initialize();
51
52 XMSS_PrivateKey m_priv_key;
53 XMSS_Hash m_hash;
54 secure_vector<uint8_t> m_randomness;
55 uint32_t m_leaf_idx;
56 bool m_is_initialized;
57};
58
59} // namespace Botan
60
61#endif
XMSS_Signature_Operation(const XMSS_PrivateKey &private_key)
AlgorithmIdentifier algorithm_identifier() const override
std::string hash_function() const override
std::vector< uint8_t > sign(RandomNumberGenerator &rng) override
void update(std::span< const uint8_t > input) override
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:68