aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorcslashm <cslashm@gmail.com>2020-04-03 22:56:55 +0200
committercslashm <cslashm@gmail.com>2020-04-08 11:12:32 +0200
commit688a3e87e712123d182ae6715610c461988f9e74 (patch)
tree8c1a262441b36a20d665a9f3c5076182be6c5308 /src/crypto
parentMerge pull request #6336 (diff)
downloadmonero-688a3e87e712123d182ae6715610c461988f9e74.tar.xz
Add timelock verification on device
Diffstat (limited to '')
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp14
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.h2
-rw-r--r--src/cryptonote_core/cryptonote_tx_utils.cpp2
3 files changed, 17 insertions, 1 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
index 651d61b06..f0b395f43 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
+++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -128,6 +128,20 @@ namespace cryptonote
namespace cryptonote
{
//---------------------------------------------------------------
+ void get_transaction_prefix_hash(const transaction_prefix& tx, crypto::hash& h, hw::device &hwdev)
+ {
+ hwdev.get_transaction_prefix_hash(tx,h);
+ }
+
+ //---------------------------------------------------------------
+ crypto::hash get_transaction_prefix_hash(const transaction_prefix& tx, hw::device &hwdev)
+ {
+ crypto::hash h = null_hash;
+ get_transaction_prefix_hash(tx, h, hwdev);
+ return h;
+ }
+
+ //---------------------------------------------------------------
void get_transaction_prefix_hash(const transaction_prefix& tx, crypto::hash& h)
{
std::ostringstream s;
diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h
index 8ed3b0b43..d1b24d950 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.h
+++ b/src/cryptonote_basic/cryptonote_format_utils.h
@@ -48,6 +48,8 @@ namespace epee
namespace cryptonote
{
//---------------------------------------------------------------
+ void get_transaction_prefix_hash(const transaction_prefix& tx, crypto::hash& h, hw::device &hwdev);
+ crypto::hash get_transaction_prefix_hash(const transaction_prefix& tx, hw::device &hwdev);
void get_transaction_prefix_hash(const transaction_prefix& tx, crypto::hash& h);
crypto::hash get_transaction_prefix_hash(const transaction_prefix& tx);
bool parse_and_validate_tx_prefix_from_blob(const blobdata& tx_blob, transaction_prefix& tx);
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp
index f50fc61a5..eb16fb297 100644
--- a/src/cryptonote_core/cryptonote_tx_utils.cpp
+++ b/src/cryptonote_core/cryptonote_tx_utils.cpp
@@ -590,7 +590,7 @@ namespace cryptonote
tx.vout[i].amount = 0;
crypto::hash tx_prefix_hash;
- get_transaction_prefix_hash(tx, tx_prefix_hash);
+ get_transaction_prefix_hash(tx, tx_prefix_hash, hwdev);
rct::ctkeyV outSk;
if (use_simple_rct)
tx.rct_signatures = rct::genRctSimple(rct::hash2rct(tx_prefix_hash), inSk, destinations, inamounts, outamounts, amount_in - amount_out, mixRing, amount_keys, msout ? &kLRki : NULL, msout, index, outSk, rct_config, hwdev);