Skip to content

Commit

Permalink
xmr: step 01 cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsusanka authored and ph4r05 committed Oct 2, 2018
1 parent 8f7a778 commit d0d1f05
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 134 deletions.
4 changes: 4 additions & 0 deletions src/apps/monero/controller/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class TrezorChangeAddressError(TrezorError):
pass


class TrezorNotEnoughOutputs(TrezorError):
pass


def compute_tx_key(spend_key_private, tx_prefix_hash, salt=None, rand_mult=None):
from apps.monero.xmr import crypto

Expand Down
27 changes: 23 additions & 4 deletions src/apps/monero/protocol/signing/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,31 @@ class State:

def __init__(self, ctx):
self.ctx = ctx

"""
Account credentials
type: AccountCreds
- view private/public key
- spend private/public key
- and its corresponding address
"""
self.creds = None
self.key_master = None

"""
Encryption keys
"""
self.key_hmac = None
self.key_enc = None

self.tx_priv = None # txkey
"""
Transaction keys
- also denoted as r/R
- tx_priv is a random number
- tx_pub is equal to `r*G` or `r*D` for subaddresses
- for subaddresses the `r` is commonly denoted as `s`, however it is still just a random number
- the keys are used to derive the one time address and its keys (P = H(A*r)*G + B)
"""
self.tx_priv = None
self.tx_pub = None

self.multi_sig = False
Expand Down Expand Up @@ -60,8 +79,8 @@ def __init__(self, ctx):
self.output_pk_masks = [] # commitments
self.output_amounts = []
self.output_masks = []
self.rsig_type = 0
self.rsig_grp = []

self.rsig_grouping = []
self.rsig_offload = 0
self.sumout = crypto.sc_0()
self.sumpouts_alphas = crypto.sc_0()
Expand Down
Loading

0 comments on commit d0d1f05

Please sign in to comment.