From a403e52ec2ccd00c7826a0c5cd4f59a0c609f772 Mon Sep 17 00:00:00 2001 From: Dusan Klinec Date: Fri, 27 Jul 2018 20:27:10 +0200 Subject: [PATCH] xmr: key image sync hash computation optimized --- src/apps/monero/xmr/key_image.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/monero/xmr/key_image.py b/src/apps/monero/xmr/key_image.py index 21293534e..347fca6ea 100644 --- a/src/apps/monero/xmr/key_image.py +++ b/src/apps/monero/xmr/key_image.py @@ -13,14 +13,14 @@ def compute_hash(rr): :type rr: TransferDetails :return: """ - buff = b"" - buff += rr.out_key - buff += rr.tx_pub_key + kck = crypto.get_keccak() + kck.update(rr.out_key) + kck.update(rr.tx_pub_key) if rr.additional_tx_pub_keys: - buff += b"".join(rr.additional_tx_pub_keys) - buff += dump_uvarint_b(rr.internal_output_index) - - return crypto.cn_fast_hash(buff) + for x in rr.additional_tx_pub_keys: + kck.update(x) + kck.update(dump_uvarint_b(rr.internal_output_index)) + return kck.digest() async def export_key_image(creds, subaddresses, td):