Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #293 from ph4r05/xmr-total-2
Browse files Browse the repository at this point in the history
Monero support added
  • Loading branch information
tsusanka authored Oct 25, 2018
2 parents de7125f + 3ff40fd commit b4ca93e
Show file tree
Hide file tree
Showing 121 changed files with 9,889 additions and 761 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,22 @@ addons:
- python3.6-dev
- python3.6-venv

cache:
directories:
- $HOME/libsodium

before_install:
- python3.6 -m ensurepip --user
- python3.6 -m pip install --user pipenv
- python3.6 -m pip install --user "pipenv<2018.10"

install:
- curl -LO "https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip"
- unzip "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" -d protoc
- export PATH="$(pwd)/protoc/bin:$PATH"
- ./travis-install-libsodium.sh
- export PKG_CONFIG_PATH=$HOME/libsodium/lib/pkgconfig:$PKG_CONFIG_PATH
- export LD_LIBRARY_PATH=$HOME/libsodium/lib:$LD_LIBRARY_PATH
- pipenv run pip install pip==18.0
- pipenv install

before_script:
Expand All @@ -59,6 +67,7 @@ script:
- test "$GOAL" != "unix" || pipenv run make build_unix_noui
- test "$GOAL" != "unix" || pipenv run make test
- test "$GOAL" != "unix" || test "$TREZOR_MODEL" = "1" || pipenv run make test_emu
- test "$GOAL" != "unix" || test "$TREZOR_MODEL" = "1" || pipenv run make test_emu_monero

notifications:
webhooks:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ test: ## run unit tests
test_emu: ## run selected device tests from python-trezor
cd tests ; ./run_tests_device_emu.sh $(TESTOPTS)

test_emu_monero: ## run selected monero device tests from monero-agent
cd tests ; ./run_tests_device_emu_monero.sh $(TESTOPTS)

pylint: ## run pylint on application sources and tests
pylint -E $(shell find src tests -name *.py)

Expand Down
4 changes: 4 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ termcolor = ">=0.1.2"
Pillow = ">=5.2.0"
Mako = ">=1.0.7"

# monero
monero_agent = {version = ">=1.7.1", extras = ["tcry", "dev"]}
py_trezor_crypto_ph4 = {version = ">=0.1.1"}

[pipenv]
allow_prereleases = true
4 changes: 4 additions & 0 deletions SConscript.firmware
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CPPDEFINES_MOD += [
'RAND_PLATFORM_INDEPENDENT',
('USE_KECCAK', '1'),
('USE_ETHEREUM', '1'),
('USE_MONERO', '1'),
('USE_CARDANO', '1'),
('USE_NEM', '1'),
]
Expand Down Expand Up @@ -63,6 +64,9 @@ SOURCE_MOD += [
'vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c',
'vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c',
'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c',
'vendor/trezor-crypto/monero/base58.c',
'vendor/trezor-crypto/monero/serialize.c',
'vendor/trezor-crypto/monero/xmr.c',
'vendor/trezor-crypto/groestl.c',
'vendor/trezor-crypto/hasher.c',
'vendor/trezor-crypto/hmac.c',
Expand Down
4 changes: 4 additions & 0 deletions SConscript.unix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CPPDEFINES_MOD += [
'AES_192',
('USE_KECCAK', '1'),
('USE_ETHEREUM', '1'),
('USE_MONERO', '1'),
('USE_CARDANO', '1'),
('USE_NEM', '1'),
]
Expand Down Expand Up @@ -60,6 +61,9 @@ SOURCE_MOD += [
'vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c',
'vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c',
'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c',
'vendor/trezor-crypto/monero/base58.c',
'vendor/trezor-crypto/monero/serialize.c',
'vendor/trezor-crypto/monero/xmr.c',
'vendor/trezor-crypto/groestl.c',
'vendor/trezor-crypto/hasher.c',
'vendor/trezor-crypto/hmac.c',
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ enum AESMode {
CTR = 0x04,
};

/// package: trezorcrypto.__init__

/// class AES:
/// '''
/// AES context.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "memzero.h"
#include "nem.h"

/// package: trezorcrypto.bip32

/// class HDNode:
/// '''
/// BIP0032 HD node structure.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "bip39.h"

/// package: trezorcrypto.bip39

/// def find_word(prefix: str) -> Optional[str]:
/// '''
/// Return the first word from the wordlist starting with prefix.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-blake256.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "blake256.h"
#include "memzero.h"

/// package: trezorcrypto.__init__

/// class Blake256:
/// '''
/// Blake256 context.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2b.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "blake2b.h"
#include "memzero.h"

/// package: trezorcrypto.__init__

/// class Blake2b:
/// '''
/// Blake2b context.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-blake2s.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "blake2s.h"
#include "memzero.h"

/// package: trezorcrypto.__init__

/// class Blake2s:
/// '''
/// Blake2s context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "chacha20poly1305/rfc7539.h"
#include "memzero.h"

/// package: trezorcrypto.__init__

/// class ChaCha20Poly1305:
/// '''
/// ChaCha20Poly1305 context.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-curve25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "rand.h"

/// package: trezorcrypto.curve25519

/// def generate_secret() -> bytes:
/// '''
/// Generate secret key.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "rand.h"

/// package: trezorcrypto.ed25519

/// def generate_secret() -> bytes:
/// '''
/// Generate secret key.
Expand Down
2 changes: 2 additions & 0 deletions embed/extmod/modtrezorcrypto/modtrezorcrypto-groestl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define GROESTL512_DIGEST_LENGTH 64
#define GROESTL512_BLOCK_LENGTH 128

/// package: trezorcrypto.__init__

/// class Groestl512:
/// '''
/// GROESTL512 context.
Expand Down
Loading

0 comments on commit b4ca93e

Please sign in to comment.