Botan 3.14.1
Crypto and TLS for C&
xmss_verification_operation.h
Go to the documentation of this file.
1/*
2 * XMSS Verification 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_VERIFICATION_OPERATION_H_
9#define BOTAN_XMSS_VERIFICATION_OPERATION_H_
10
11#include <botan/pk_ops.h>
12#include <botan/xmss.h>
13#include <botan/internal/xmss_hash.h>
14#include <botan/internal/xmss_signature.h>
15
16namespace Botan {
17
18/**
19 * Provides signature verification capabilities for Extended Hash-Based
20 * Signatures (XMSS).
21 **/
23 public:
24 explicit XMSS_Verification_Operation(const XMSS_PublicKey& public_key);
25
26 bool is_valid_signature(std::span<const uint8_t> sign) override;
27
28 void update(std::span<const uint8_t> input) override;
29
30 std::string hash_function() const override { return m_hash.hash_function(); }
31
32 private:
33 /**
34 * Algorithm 14: "XMSS_verify"
35 * Verifies a XMSS signature using the corresponding XMSS public key.
36 *
37 * @param sig A XMSS signature.
38 * @param msg The message signed with sig.
39 * @param pub_key the public key
40 *
41 * @return true if signature sig is valid for msg, false otherwise.
42 **/
43 bool verify(const XMSS_Signature& sig, const secure_vector<uint8_t>& msg, const XMSS_PublicKey& pub_key);
44
45 const XMSS_PublicKey m_pub_key;
46 XMSS_Hash m_hash;
47 secure_vector<uint8_t> m_msg_buf;
48};
49
50} // namespace Botan
51
52#endif
bool is_valid_signature(std::span< const uint8_t > sign) override
XMSS_Verification_Operation(const XMSS_PublicKey &public_key)
void update(std::span< const uint8_t > input) override
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:128