diff options
author | Jack Lloyd <[email protected]> | 2016-11-26 05:27:25 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-11-26 05:27:25 -0500 |
commit | cc010f7c233949b908db6139bb3ccedb34372996 (patch) | |
tree | 691edf9c7c19afdfd5b356236c95d74c2d079bc8 /src/lib/pubkey/xmss/xmss_wots_publickey.h | |
parent | 3813764fd602f5db564b4bfdd1d33fcb27e376f8 (diff) | |
parent | cd888d1f437945808284694664d95f273309a536 (diff) |
Merge GH #718 Add XMSS WOTS scheme
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_wots_publickey.h')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_wots_publickey.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/lib/pubkey/xmss/xmss_wots_publickey.h b/src/lib/pubkey/xmss/xmss_wots_publickey.h index 394824d0a..afb0ac847 100644 --- a/src/lib/pubkey/xmss/xmss_wots_publickey.h +++ b/src/lib/pubkey/xmss/xmss_wots_publickey.h @@ -14,6 +14,7 @@ #include <botan/alg_id.h> #include <botan/asn1_oid.h> #include <botan/assert.h> +#include <botan/exceptn.h> #include <botan/pk_keys.h> #include <botan/types.h> #include <botan/xmss_wots_parameters.h> @@ -199,22 +200,28 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key operator wots_keysig_t& () { return m_key; } const secure_vector<byte>& public_seed() const { return m_public_seed; } + secure_vector<byte>& public_seed() { return m_public_seed; } + void set_public_seed(const secure_vector<byte>& public_seed) { m_public_seed = public_seed; } + void set_public_seed(secure_vector<byte>&& public_seed) { m_public_seed = std::move(public_seed); } const wots_keysig_t& key_data() const { return m_key; } + wots_keysig_t& key_data() { return m_key; } + void set_key_data(const wots_keysig_t& key_data) { m_key = key_data; } + void set_key_data(wots_keysig_t&& key_data) { m_key = std::move(key_data); @@ -232,20 +239,17 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key virtual AlgorithmIdentifier algorithm_identifier() const override { - BOTAN_ASSERT(false, "No AlgorithmIdentifier available for XMSS-WOTS."); + throw Not_Implemented("No AlgorithmIdentifier available for XMSS-WOTS."); } virtual bool check_key(RandomNumberGenerator&, bool) const override { - BOTAN_ASSERT(false, "No key strength check implemented for XMSS-WOTS."); + return true; } virtual std::unique_ptr<PK_Ops::Verification> create_verification_op(const std::string&, - const std::string&) const override - { - BOTAN_ASSERT(false, "XMSS_WOTS_Verification_Operation not available."); - } + const std::string& provider) const override; virtual size_t estimated_strength() const override { @@ -257,19 +261,9 @@ class BOTAN_DLL XMSS_WOTS_PublicKey : virtual public Public_Key return m_wots_params.estimated_strength(); } - virtual size_t message_part_size() const override - { - return m_wots_params.element_size(); - } - - virtual size_t message_parts() const override - { - return 1; - } - virtual std::vector<byte> x509_subject_public_key() const override { - BOTAN_ASSERT(false, "No x509 key format defined for XMSS-WOTS."); + throw Not_Implemented("No x509 key format defined for XMSS-WOTS."); } bool operator==(const XMSS_WOTS_PublicKey& key) |