device/trezor: trezor support added

This commit is contained in:
Dusan Klinec 2018-08-23 23:50:53 +02:00
parent 963d247154
commit 29ffb6bba8
No known key found for this signature in database
GPG key ID: 6337E118CCBCE103
35 changed files with 4591 additions and 39 deletions

View file

@ -47,6 +47,7 @@
#include "crypto/crypto.h"
#include "crypto/chacha.h"
#include "ringct/rctTypes.h"
#include "cryptonote_config.h"
#ifndef USE_DEVICE_LEDGER
@ -99,10 +100,17 @@ namespace hw {
enum device_type
{
SOFTWARE = 0,
LEDGER = 1
LEDGER = 1,
TREZOR = 2
};
enum device_protocol_t {
PROTOCOL_DEFAULT,
PROTOCOL_PROXY, // Originally defined by Ledger
PROTOCOL_COLD, // Originally defined by Trezor
};
/* ======================================================================= */
/* SETUP/TEARDOWN */
/* ======================================================================= */
@ -120,6 +128,7 @@ namespace hw {
virtual device_type get_type() const = 0;
virtual device_protocol_t device_protocol() const { return PROTOCOL_DEFAULT; };
/* ======================================================================= */
/* LOCKER */
@ -204,6 +213,11 @@ namespace hw {
virtual bool close_tx(void) = 0;
virtual bool has_ki_cold_sync(void) const { return false; }
virtual bool has_tx_cold_sign(void) const { return false; }
virtual void set_network_type(cryptonote::network_type network_type) { }
protected:
device_mode mode;
} ;