Skip to content

Commit

Permalink
xmr: step7 - manual hashing of Extra
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Oct 2, 2018
1 parent d8a0928 commit 9a194fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/apps/monero/protocol/signing/step_07_all_out1_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def _set_tx_extra(state: State):
def _set_tx_prefix(state: State):
from apps.monero.xmr.serialize.message_types import BlobType

state.tx_prefix_hasher.message_field(state.tx, ("extra", BlobType)) # extra
# Serializing "extra" type as BlobType.
# uvarint(len(extra)) || extra
state.tx_prefix_hasher.keep()
state.tx_prefix_hasher.uvarint(len(state.tx.extra))
state.tx_prefix_hasher.buffer(state.tx.extra)
state.tx_prefix_hasher.release()

state.tx_prefix_hash = state.tx_prefix_hasher.get_digest()
state.tx_prefix_hasher = None
Expand Down

0 comments on commit 9a194fa

Please sign in to comment.