Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

xmss_wots_addressed_publickey.h
Go to the documentation of this file.
1 /**
2 * XMSS WOTS Addressed Public Key
3 * (C) 2016 Matthias Gierlings
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 **/
7
8
9 #ifndef BOTAN_XMSS_WOTS_ADDRESSED_PUBLICKEY_H__
10 #define BOTAN_XMSS_WOTS_ADDRESSED_PUBLICKEY_H__
11
12 #include <botan/xmss_address.h>
13 #include <botan/xmss_wots_publickey.h>
14
15 namespace Botan {
16
17 /**
18 * Wrapper class to pair a XMSS_WOTS_PublicKey with an XMSS Address. Since
19 * the PK_Ops::Verification interface does not allow an extra address
20 * parameter to be passed to the sign(RandomNumberGenerator&), the address
21 * needs to be stored together with the key and passed to the
22 * XMSS_WOTS_Verification_Operation() on creation.
23 **/
24 class XMSS_WOTS_Addressed_PublicKey : public virtual Public_Key
25 {
26 public:
27 XMSS_WOTS_Addressed_PublicKey(const XMSS_WOTS_PublicKey& public_key)
28 : m_pub_key(public_key), m_adrs() {}
29
30 XMSS_WOTS_Addressed_PublicKey(const XMSS_WOTS_PublicKey& public_key,
31 const XMSS_Address& adrs)
32 : m_pub_key(public_key), m_adrs(adrs) {}
33
34 XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey&& public_key)
35 : m_pub_key(std::move(public_key)), m_adrs() {}
36
37 XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey&& public_key,
38 XMSS_Address&& adrs)
39 : m_pub_key(std::move(public_key)), m_adrs(std::move(adrs)) {}
40
41 const XMSS_WOTS_PublicKey& public_key() const { return m_pub_key; }
42 XMSS_WOTS_PublicKey& public_key() { return m_pub_key; }
43
44 const XMSS_Address& address() const { return m_adrs; }
45 XMSS_Address& address() { return m_adrs; }
46
47 virtual std::string algo_name() const override
48 {
49 return m_pub_key.algo_name();
50 }
51
52 virtual AlgorithmIdentifier algorithm_identifier() const override
53 {
54 return m_pub_key.algorithm_identifier();
55 }
56
57 virtual bool check_key(RandomNumberGenerator& rng,
58 bool strong) const override
59 {
60 return m_pub_key.check_key(rng, strong);
61 }
62
63 virtual std::unique_ptr<PK_Ops::Verification>
64 create_verification_op(const std::string& params,
65 const std::string& provider) const override
66 {
67 return m_pub_key.create_verification_op(params, provider);
68 }
69
70 virtual OID get_oid() const override
71 {
72 return m_pub_key.get_oid();
73 }
74
75 virtual size_t estimated_strength() const override
76 {
77 return m_pub_key.estimated_strength();
78 }
79
80 virtual size_t key_length() const override
81 {
82 return m_pub_key.estimated_strength();
83 }
84
85 virtual std::vector<uint8_t> public_key_bits() const override
86 {
87 return m_pub_key.public_key_bits();
88 }
89
90 protected:
91 XMSS_WOTS_PublicKey m_pub_key;
92 XMSS_Address m_adrs;
93 };
94
95 }
96
97 #endif
Botan::XMSS_WOTS_Addressed_PublicKey::estimated_strength
virtual size_t estimated_strength() const override
Definition: xmss_wots_addressed_publickey.h:75
Botan::XMSS_WOTS_Addressed_PublicKey::public_key
const XMSS_WOTS_PublicKey & public_key() const
Definition: xmss_wots_addressed_publickey.h:41
Botan::XMSS_WOTS_PublicKey::check_key
virtual bool check_key(RandomNumberGenerator &, bool) const override
Definition: xmss_wots_publickey.h:244
Botan::XMSS_WOTS_Addressed_PublicKey::create_verification_op
virtual std::unique_ptr< PK_Ops::Verification > create_verification_op(const std::string &params, const std::string &provider) const override
Definition: xmss_wots_addressed_publickey.h:64
Botan::RandomNumberGenerator
Definition: rng.h:25
Botan::XMSS_WOTS_Addressed_PublicKey::public_key_bits
virtual std::vector< uint8_t > public_key_bits() const override
Definition: xmss_wots_addressed_publickey.h:85
Botan::XMSS_WOTS_PublicKey::algorithm_identifier
virtual AlgorithmIdentifier algorithm_identifier() const override
Definition: xmss_wots_publickey.h:239
Botan::XMSS_WOTS_Addressed_PublicKey::XMSS_WOTS_Addressed_PublicKey
XMSS_WOTS_Addressed_PublicKey(const XMSS_WOTS_PublicKey &public_key)
Definition: xmss_wots_addressed_publickey.h:27
Botan::XMSS_Address
Definition: xmss_address.h:23
std
Definition: bigint.h:619
Botan::XMSS_WOTS_Addressed_PublicKey::key_length
virtual size_t key_length() const override
Definition: xmss_wots_addressed_publickey.h:80
Botan::XMSS_WOTS_Addressed_PublicKey::XMSS_WOTS_Addressed_PublicKey
XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey &&public_key, XMSS_Address &&adrs)
Definition: xmss_wots_addressed_publickey.h:37
Botan::XMSS_WOTS_Addressed_PublicKey::check_key
virtual bool check_key(RandomNumberGenerator &rng, bool strong) const override
Definition: xmss_wots_addressed_publickey.h:57
Botan::XMSS_WOTS_Addressed_PublicKey::m_adrs
XMSS_Address m_adrs
Definition: xmss_wots_addressed_publickey.h:92
Botan::Public_Key::get_oid
virtual OID get_oid() const
Definition: pk_keys.cpp:30
Botan::XMSS_WOTS_Addressed_PublicKey::get_oid
virtual OID get_oid() const override
Definition: xmss_wots_addressed_publickey.h:70
Botan::XMSS_WOTS_Addressed_PublicKey
Definition: xmss_wots_addressed_publickey.h:24
Botan::XMSS_WOTS_PublicKey::public_key_bits
virtual std::vector< uint8_t > public_key_bits() const override
Definition: xmss_wots_publickey.h:263
Botan::XMSS_WOTS_Addressed_PublicKey::algorithm_identifier
virtual AlgorithmIdentifier algorithm_identifier() const override
Definition: xmss_wots_addressed_publickey.h:52
Botan::XMSS_WOTS_Addressed_PublicKey::address
XMSS_Address & address()
Definition: xmss_wots_addressed_publickey.h:45
Botan::XMSS_WOTS_PublicKey::algo_name
virtual std::string algo_name() const override
Definition: xmss_wots_publickey.h:234
Botan::XMSS_WOTS_Addressed_PublicKey::algo_name
virtual std::string algo_name() const override
Definition: xmss_wots_addressed_publickey.h:47
Botan::XMSS_WOTS_Addressed_PublicKey::XMSS_WOTS_Addressed_PublicKey
XMSS_WOTS_Addressed_PublicKey(const XMSS_WOTS_PublicKey &public_key, const XMSS_Address &adrs)
Definition: xmss_wots_addressed_publickey.h:30
Botan
Definition: alg_id.cpp:13
Botan::XMSS_WOTS_Addressed_PublicKey::XMSS_WOTS_Addressed_PublicKey
XMSS_WOTS_Addressed_PublicKey(XMSS_WOTS_PublicKey &&public_key)
Definition: xmss_wots_addressed_publickey.h:34
Botan::XMSS_WOTS_Addressed_PublicKey::address
const XMSS_Address & address() const
Definition: xmss_wots_addressed_publickey.h:44
Botan::Public_Key
Definition: pk_keys.h:24
Botan::XMSS_WOTS_PublicKey::create_verification_op
virtual std::unique_ptr< PK_Ops::Verification > create_verification_op(const std::string &, const std::string &provider) const override
Definition: xmss_wots_publickey.cpp:68
Botan::XMSS_WOTS_PublicKey
Definition: xmss_wots_publickey.h:32
Botan::AlgorithmIdentifier
Definition: alg_id.h:20
Botan::OID
Definition: asn1_oid.h:20
Botan::XMSS_WOTS_Addressed_PublicKey::m_pub_key
XMSS_WOTS_PublicKey m_pub_key
Definition: xmss_wots_addressed_publickey.h:91
Botan::XMSS_WOTS_PublicKey::estimated_strength
virtual size_t estimated_strength() const override
Definition: xmss_wots_publickey.h:253
Botan::XMSS_WOTS_Addressed_PublicKey::public_key
XMSS_WOTS_PublicKey & public_key()
Definition: xmss_wots_addressed_publickey.h:42