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.
xmr: aggregated bulletproofs + rsig offloading
xmr: change idx fix xmr: iface refactoring, integrated address (+5 squashed commits) xmr: layout pagination refactoring xmr: addr - integrated address pb: sync vendor: trezor-common version bump xmr: style fixes xmr: handle sweep tsx correctly - handle dummy change address correctly xmr: integrated address generation build: fix after trezor-crypto version bump xmr: new protocol dispatch handlers xmr: slip0010 [43cf4c3c] xmr: comment fix xmr: extmod pointer aritm fix xmr: _into api unified, result is the first parameter xmr: bp cleanup xmr: scalar nullity test fix xmr: msg registration improved - lite protocol optional - diag protocol optional xmr: unused imports (+33 squashed commits) [b4d045ae] xmr: bp - noqa flake8 false positive [2c79d4be] xmr: isort [8b9d2835] xmr: code cleanup [eb7496e9] xmr: iface - shorter timeouts for faster tests [59520b63] xmr: ringct comment [6b16088e] xmr: signer - comment fixes [a08958e2] xmr: simple and bulletproof condition fix [4e0289a9] vendor: trezor-common version bump [de472e5a] xmr: black [234d2249] xmr: lightening, fixes, KeccakXmrArchive - builder keys - unload mods before memory intensive operation [abdec665] xmr: sign_tx logging [989d8687] xmr: serialize lightening [7d61f056] xmr: tsx sign refactoring, lightening - wake_up state restore - minimize import weight [3a0daa8b] xmr: serialize thinning [65ad1d2e] xmr: serialize thinning [501221d5] xmr: bp - thinning [3d980377] xmr: bp - generalization with proof_v8 [10d11d60] xmr: extended rsig - offloading protocol [a8f5caa2] xmr: crypto - rsig params fix [f5e130b8] xmr: crypto - inv8 [dbc3f9d8] xmr: rsig pb sync [5748a13e] xmr: bp - data for bp4 fix (+18 squashed commits) Squashed commits: [5bcd54e3] xmr: bp - black [e93e97dd] xmr: bp refactoring, large memory optimizations - memoryview in __getitem__ requires new memory allocation so the refactored version uses to(), read() methods that can operate directly on buffers without need to create memory views. [c30745a] xmr: bp - black [f5c4069] xmr: bp - tests extended [8dae75d] xmr: bp - get_exponent optim [3e59ff8] xmr: bp - precomputations for 4 statements [d1d2e29] xmr: bp - gc.collect [1bb6b5b] xmr: bp - optimizations, streamlining [2a2b0cb] xmr: bp - verification in log(MN) memory for 1 proof - not allocating MN vectors - sequential multiexec added for memory efficient verification - bulletproofs: maintain -z4, -z5, and -y0 to avoid subtractions [8276d25] - bulletproofs: merge multiexps as per sarang's new python code [acd64d2b] [75aa7de] xmr: bp - memory optimization [a10d05a] xmr: bp - deterministic mask generation init [5060d6a] xmr: bp optimizations [dd69eb1] xmr: bp - black [19f0f64] xmr: bp - optimizations, power key vector [2ba63f8] xmr: bp - minor cleanup, optimizations, scalarmultH [31c9ca2] xmr: bp - mem clean [3fc2c79] xmr: bp - memory save [5b16c9c] bp: black [f1040c97] xmr: crypto - memory leak fix [ff863510] xmr: iface - flake [6ebf69c2] xmr: lite - flake8, black [eee55d62] xmr: bp - memory diag [2767009b] xmr: bulletproofs upgrade, mainnet version, cleaning [be6ebbd5] xmr: lite protocol [d603e96d] xmr: pb sync [5da15da9] vendor: trezor-common fix [0373b97e] xmr: iface - output confirmation split, subaddr fix [2cf32176] xmr: monero - subaddress fixed for index (0, 0) [3bb8f08b] xmr: enc.aescbc added - for lite protocol (+1 squashed commit) Squashed commits: [011dbaab] TMP: trezor-common on master, crypto on ph4 - trezor-crypto on ph4r04 fork as it has all required stuff - Lite protocol not merged in master, thus does not work in the PR
- Loading branch information
Showing
42 changed files
with
3,211 additions
and
1,417 deletions.
There are no files selected for viewing
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
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,61 +1,27 @@ | ||
import gc | ||
|
||
from trezor import log | ||
from trezor.messages.MessageType import ( | ||
DebugMoneroDiagRequest, | ||
MoneroGetAddress, | ||
MoneroGetWatchKey, | ||
MoneroKeyImageSyncRequest, | ||
MoneroTransactionSignRequest, | ||
) | ||
from trezor.wire import protobuf_workflow, register | ||
from trezor import wire | ||
from trezor.messages import MessageType | ||
|
||
|
||
# persistent state objects | ||
class Holder(object): | ||
def __init__(self): | ||
self.ctx_sign = None | ||
self.ctx_ki = None | ||
self.ctx_lite = None | ||
|
||
|
||
STATE = Holder() | ||
|
||
|
||
def dispatch_MoneroGetAddress(*args, **kwargs): | ||
from apps.monero.get_address import layout_monero_get_address | ||
|
||
return layout_monero_get_address(*args, **kwargs) | ||
|
||
|
||
def dispatch_MoneroGetWatchKey(*args, **kwargs): | ||
from apps.monero.get_watch_only import layout_monero_get_watch_only | ||
|
||
return layout_monero_get_watch_only(*args, **kwargs) | ||
|
||
|
||
def dispatch_MoneroTsxSign(*args, **kwargs): | ||
from apps.monero.sign_tx import layout_sign_tx | ||
|
||
return layout_sign_tx(STATE, *args, **kwargs) | ||
|
||
|
||
def dispatch_MoneroKeyImageSync(*args, **kwargs): | ||
from apps.monero.key_image_sync import layout_key_image_sync | ||
|
||
return layout_key_image_sync(STATE, *args, **kwargs) | ||
|
||
|
||
def dispatch_MoneroDiag(*args, **kwargs): | ||
log.debug(__name__, "----diagnostics") | ||
gc.collect() | ||
from apps.monero.diag import dispatch_diag | ||
|
||
return dispatch_diag(*args, **kwargs) | ||
def boot(): | ||
wire.add(MessageType.MoneroGetAddress, __name__, "get_address") | ||
wire.add(MessageType.MoneroGetWatchKey, __name__, "get_watch_only") | ||
wire.add(MessageType.MoneroTransactionSignRequest, __name__, "sign_tx", STATE) | ||
wire.add(MessageType.MoneroKeyImageSyncRequest, __name__, "key_image_sync", STATE) | ||
|
||
if hasattr(MessageType, "MoneroLiteInitRequest"): | ||
wire.add(MessageType.MoneroLiteInitRequest, "lite_protocol", STATE, 1) | ||
wire.add(MessageType.MoneroLiteRequest, "lite_protocol", STATE, 0) | ||
|
||
def boot(): | ||
register(MoneroGetAddress, protobuf_workflow, dispatch_MoneroGetAddress) | ||
register(MoneroGetWatchKey, protobuf_workflow, dispatch_MoneroGetWatchKey) | ||
register(MoneroTransactionSignRequest, protobuf_workflow, dispatch_MoneroTsxSign) | ||
register(MoneroKeyImageSyncRequest, protobuf_workflow, dispatch_MoneroKeyImageSync) | ||
register(DebugMoneroDiagRequest, protobuf_workflow, dispatch_MoneroDiag) | ||
if hasattr(MessageType, "DebugMoneroDiagRequest"): | ||
wire.add(MessageType.DebugMoneroDiagRequest, __name__, "diag") |
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.