From 438668992a62cd834aa4ce9d8fcb17672d906fd9 Mon Sep 17 00:00:00 2001 From: keepkeyjon Date: Mon, 25 Nov 2019 10:24:59 -0700 Subject: [PATCH 1/2] Rearrange TokenType members for space savings --- include/keepkey/firmware/ethereum_tokens.h | 4 ++-- lib/firmware/ethereum_tokens.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/keepkey/firmware/ethereum_tokens.h b/include/keepkey/firmware/ethereum_tokens.h index 7e19b572e..5b7143d14 100644 --- a/include/keepkey/firmware/ethereum_tokens.h +++ b/include/keepkey/firmware/ethereum_tokens.h @@ -36,10 +36,10 @@ enum { #define TOKENS_COUNT ((int)TokenIndexLast-(int)TokenIndexFirst) typedef struct _TokenType { - uint8_t chain_id; const char * const address; const char * const ticker; - int decimals; + uint8_t chain_id; + uint8_t decimals; } TokenType; typedef struct _CoinType CoinType; diff --git a/lib/firmware/ethereum_tokens.c b/lib/firmware/ethereum_tokens.c index 16e4e61bb..8c2b822b7 100644 --- a/lib/firmware/ethereum_tokens.c +++ b/lib/firmware/ethereum_tokens.c @@ -6,7 +6,7 @@ const TokenType tokens[] = { #define X(CHAIN_ID, CONTRACT_ADDR, TICKER, DECIMALS) \ - { (CHAIN_ID), (CONTRACT_ADDR), (TICKER), (DECIMALS) }, + { (CONTRACT_ADDR), (TICKER), (CHAIN_ID), (DECIMALS) }, #include "keepkey/firmware/ethereum_tokens.def" }; From 9121a3b432967cda0fab3111a18ed6b3d6bed8e1 Mon Sep 17 00:00:00 2001 From: keepkeyjon Date: Mon, 25 Nov 2019 12:18:34 -0700 Subject: [PATCH 2/2] Don't build things from trezor-crypto that we don't need --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d125ff3e..887c174b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,9 +58,14 @@ add_definitions(-DED25519_CUSTOMRANDOM=1) add_definitions(-DED25519_NO_INLINE_ASM) add_definitions(-DED25519_FORCE_32BIT=1) +add_definitions(-DUSE_PRECOMPUTED_CP=0) + add_definitions(-DUSE_ETHEREUM=1) +add_definitions(-DUSE_KECCAK=1) +add_definitions(-DUSE_GRAPHENE=0) add_definitions(-DUSE_CARDANO=0) add_definitions(-DUSE_MONERO=0) +add_definitions(-DUSE_NEM=0) add_definitions(-DUSE_NANO=1) add_definitions(-DRAND_PLATFORM_INDEPENDENT=0)