aboutsummaryrefslogtreecommitdiff
path: root/src/device/device_ledger.hpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-04-01 17:35:11 +0200
committerRiccardo Spagni <ric@spagni.net>2019-04-01 17:35:12 +0200
commitb8ab510f238e5a4b9907ea09ed0f364b34ab1ae5 (patch)
tree25661fc3125132dff3f48a4f1aa19676f8e74c0e /src/device/device_ledger.hpp
parentMerge pull request #5349 (diff)
parentAdd get_tx_proof support, needed for new sanity check (diff)
downloadmonero-b8ab510f238e5a4b9907ea09ed0f364b34ab1ae5.tar.xz
Merge pull request #5332
7c440915 Add get_tx_proof support, needed for new sanity check (cslashm) 98fdcb2a Add support for V11 protocol with BulletProofV2 and short amount. New scheme key destination contrfol Fix dummy decryption in debug mode (cslashm) 3a981a33 Add application version compatibility check. (cslashm)
Diffstat (limited to 'src/device/device_ledger.hpp')
-rw-r--r--src/device/device_ledger.hpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp
index 252354e1c..d4d98ce4a 100644
--- a/src/device/device_ledger.hpp
+++ b/src/device/device_ledger.hpp
@@ -33,6 +33,7 @@
#include <cstddef>
#include <string>
#include "device.hpp"
+#include "log.hpp"
#include "device_io_hid.hpp"
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
@@ -41,6 +42,18 @@ namespace hw {
namespace ledger {
+ /* Minimal supported version */
+ #define MINIMAL_APP_VERSION_MAJOR 1
+ #define MINIMAL_APP_VERSION_MINOR 3
+ #define MINIMAL_APP_VERSION_MICRO 1
+
+ #define VERSION(M,m,u) ((M)<<16|(m)<<8|(u))
+ #define VERSION_MAJOR(v) (((v)>>16)&0xFF)
+ #define VERSION_MINOR(v) (((v)>>8)&0xFF)
+ #define VERSION_MICRO(v) (((v)>>0)&0xFF)
+
+ #define MINIMAL_APP_VERSION VERSION(MINIMAL_APP_VERSION_MAJOR, MINIMAL_APP_VERSION_MINOR, MINIMAL_APP_VERSION_MICRO)
+
void register_all(std::map<std::string, std::unique_ptr<device>> &registry);
#ifdef WITH_DEVICE_LEDGER
@@ -190,11 +203,16 @@ namespace hw {
/* ======================================================================= */
/* TRANSACTION */
/* ======================================================================= */
-
+ void generate_tx_proof(const crypto::hash &prefix_hash,
+ const crypto::public_key &R, const crypto::public_key &A, const boost::optional<crypto::public_key> &B, const crypto::public_key &D, const crypto::secret_key &r,
+ crypto::signature &sig) override;
+
bool open_tx(crypto::secret_key &tx_key) override;
bool encrypt_payment_id(crypto::hash8 &payment_id, const crypto::public_key &public_key, const crypto::secret_key &secret_key) override;
+ rct::key genCommitmentMask(const rct::key &amount_key) override;
+
bool ecdhEncode(rct::ecdhTuple & unmasked, const rct::key & sharedSec, bool short_format) override;
bool ecdhDecode(rct::ecdhTuple & masked, const rct::key & sharedSec, bool short_format) override;