forked from trezor/trezor-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
289 additions
and
314 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
from trezor.messages.MoneroGetWatchKey import MoneroGetWatchKey | ||
from trezor.messages.MoneroWatchKey import MoneroWatchKey | ||
|
||
from apps.monero.controller import misc | ||
from apps.monero import misc | ||
from apps.monero.layout import confirms | ||
from apps.monero.xmr import crypto | ||
|
||
|
||
async def get_watch_only(ctx, msg: MoneroGetWatchKey): | ||
address_n = msg.address_n or () | ||
await confirms.require_confirm_watchkey(ctx) | ||
creds = await misc.monero_get_creds(ctx, address_n, msg.network_type) | ||
return MoneroWatchKey( | ||
watch_key=crypto.encodeint(creds.view_key_private), address=creds.address | ||
) | ||
|
||
creds = await misc.get_creds(ctx, msg.address_n, msg.network_type) | ||
address = creds.address | ||
watch_key = crypto.encodeint(creds.view_key_private) | ||
|
||
return MoneroWatchKey(watch_key=watch_key, address=address) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
async def get_creds(ctx, address_n=None, network_type=None): | ||
from apps.common import seed | ||
from apps.monero.xmr import crypto, monero | ||
from apps.monero.xmr.credentials import AccountCreds | ||
|
||
use_slip0010 = 0 not in address_n # If path contains 0 it is not SLIP-0010 | ||
|
||
if use_slip0010: | ||
curve = "ed25519" | ||
else: | ||
curve = "secp256k1" | ||
node = await seed.derive_node(ctx, address_n, curve) | ||
|
||
if use_slip0010: | ||
key_seed = node.private_key() | ||
else: | ||
key_seed = crypto.cn_fast_hash(node.private_key()) | ||
spend_sec, _, view_sec, _ = monero.generate_monero_keys(key_seed) | ||
|
||
creds = AccountCreds.new_wallet(view_sec, spend_sec, network_type) | ||
return creds |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.