aboutsummaryrefslogtreecommitdiff
path: root/src/device/device.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/device/device.hpp')
-rw-r--r--src/device/device.hpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/device/device.hpp b/src/device/device.hpp
index 9df0cb39d..d14b8848c 100644
--- a/src/device/device.hpp
+++ b/src/device/device.hpp
@@ -125,7 +125,7 @@ namespace hw {
/* ======================================================================= */
virtual bool get_public_address(cryptonote::account_public_address &pubkey) = 0;
virtual bool get_secret_keys(crypto::secret_key &viewkey , crypto::secret_key &spendkey) = 0;
- virtual bool generate_chacha_key(const cryptonote::account_keys &keys, crypto::chacha_key &key) = 0;
+ virtual bool generate_chacha_key(const cryptonote::account_keys &keys, crypto::chacha_key &key, uint64_t kdf_rounds) = 0;
/* ======================================================================= */
/* SUB ADDRESS */
@@ -202,6 +202,17 @@ namespace hw {
~reset_mode() { hwref.set_mode(hw::device::NONE);}
};
- device& get_device(const std::string device_descriptor) ;
+ class device_registry {
+ private:
+ std::map<std::string, std::unique_ptr<device>> registry;
+
+ public:
+ device_registry();
+ bool register_device(const std::string & device_name, device * hw_device);
+ device& get_device(const std::string & device_descriptor);
+ };
+
+ device& get_device(const std::string & device_descriptor);
+ bool register_device(const std::string & device_name, device * hw_device);
}