Skip to content

Commit

Permalink
xmr: step 05 review
Browse files Browse the repository at this point in the history
  • Loading branch information
tsusanka committed Oct 8, 2018
1 parent f02833c commit 4343940
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/apps/monero/protocol/signing/step_04_input_vini.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ async def input_vini(
"""
state.tx_prefix_hasher.buffer(vini_bin)

if state.use_simple_rct and not state.use_bulletproof: # TODO why not bulletproof?
# in monero version >= 8 pseudo outs were moved to a different place
# use_bulletproofs implies version >= 8
if state.use_simple_rct and not state.use_bulletproof:
_hash_vini_pseudo_out(state, pseudo_out, pseudo_out_hmac)

return MoneroTransactionInputViniAck()
Expand Down
11 changes: 5 additions & 6 deletions src/apps/monero/protocol/signing/step_05_all_in_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
All inputs set. Defining rsig parameters.
All inputs set. Defining range signature parameters.
If in the applicable offloading mode, generate commitment masks.
"""

from trezor import utils
Expand All @@ -10,12 +11,9 @@
from apps.monero.xmr import crypto


async def all_in_set(state: State, rsig_data): # todo: rsig_data not used?
"""
If in the applicable offloading mode, generate commitment masks.
"""
async def all_in_set(state: State):
state.mem_trace(0)
# state.state.input_all_done() todo check if needed?

await confirms.transaction_step(state.ctx, state.STEP_ALL_IN)

from trezor.messages.MoneroTransactionAllInputsSetAck import (
Expand All @@ -31,6 +29,7 @@ async def all_in_set(state: State, rsig_data): # todo: rsig_data not used?

# Simple range proof offloading
# Generate random commitment masks that sum to the input mask sum.
# TODO review together with step 6
tmp_buff = bytearray(32)
rsig_data.mask = bytearray(32 * state.output_count)
state.sumout = crypto.sc_init(0)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/monero/sign_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def sign_tx_dispatch(state, msg):
from apps.monero.protocol.signing import step_05_all_in_set

return (
await step_05_all_in_set.all_in_set(state, msg.rsig_data),
await step_05_all_in_set.all_in_set(state),
(MessageType.MoneroTransactionSetOutputRequest,),
)

Expand Down

0 comments on commit 4343940

Please sign in to comment.