From 53d67418e56acc6ffa105be01015ac02cee76705 Mon Sep 17 00:00:00 2001 From: TamtamHero <10632523+TamtamHero@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:19:32 +0100 Subject: [PATCH 1/7] Fix stark order signatures on LNS --- src/stark_utils.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/stark_utils.c b/src/stark_utils.c index 5344ba4..4df86e9 100644 --- a/src/stark_utils.c +++ b/src/stark_utils.c @@ -94,7 +94,6 @@ void pedersen(FieldElement res, /* out */ memcpy(res, hash + 1, FIELD_ELEMENT_SIZE); } -#ifdef TARGET_NANOX void shift_stark_hash(FieldElement hash) { uint256_t hash256, final_hash256; readu256BE(hash, &hash256); @@ -112,7 +111,6 @@ void shift_stark_hash(FieldElement hash) { THROW(0x6A80); } } -#endif // TARGET_NANOX int stark_sign(uint8_t *signature, /* out */ uint8_t *privateKeyData, @@ -137,9 +135,7 @@ int stark_sign(uint8_t *signature, /* out */ } pedersen(hash, hash, msg); PRINTF("Pedersen hash 2 %.*H\n", 32, hash); -#ifdef TARGET_NANOX shift_stark_hash(hash); -#endif cx_ecfp_init_private_key(CX_CURVE_Stark256, privateKeyData, 32, &privateKey); io_seproxyhal_io_heartbeat(); int signatureLength = cx_ecdsa_sign(&privateKey, From 24f4ecd6718b296ee080650c7b03db4c131c4a8e Mon Sep 17 00:00:00 2001 From: TamtamHero <10632523+TamtamHero@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:20:15 +0100 Subject: [PATCH 2/7] Bump version 1.9.14 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8748d1f..1a5efba 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'" APPVERSION_M=1 APPVERSION_N=9 -APPVERSION_P=13 +APPVERSION_P=14 APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION) From c8bf437424644f01aba21109bbced6973619ee59 Mon Sep 17 00:00:00 2001 From: Noel Moldvai Date: Tue, 14 Sep 2021 15:15:45 -0700 Subject: [PATCH 3/7] Add Shyft support --- Makefile | 8 ++++++-- icons/nanos_app_shyft.gif | Bin 0 -> 73 bytes icons/nanox_app_shyft.gif | Bin 0 -> 76 bytes src/chainConfig.h | 3 ++- src/main.c | 6 ++++++ src/tokens.c | 2 ++ src/tokens.h | 2 ++ 7 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 icons/nanos_app_shyft.gif create mode 100644 icons/nanox_app_shyft.gif diff --git a/Makefile b/Makefile index 1a5efba..1adad22 100755 --- a/Makefile +++ b/Makefile @@ -234,9 +234,13 @@ else ifeq ($(CHAIN),polygon) APP_LOAD_PARAMS += --path "44'/60'" DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137 APPNAME = "Polygon" +else ifeq ($(CHAIN),shyft) +APP_LOAD_PARAMS += --path "44'/7341'" +DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341 +APPNAME = "Shyft" else ifeq ($(filter clean,$(MAKECMDGOALS)),) -$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon) +$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon, shyft) endif endif @@ -407,4 +411,4 @@ include $(BOLOS_SDK)/Makefile.rules dep/%.d: %.c Makefile listvariants: - @echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon + @echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon shyft diff --git a/icons/nanos_app_shyft.gif b/icons/nanos_app_shyft.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a07de0390d9834ecf69cc6baa8979dea2b5a1ce GIT binary patch literal 73 zcmZ?wbhEHb6krfwXkcUjg8%>jEB<6*WHaWT}kb%J(0LNGssQ>@~ literal 0 HcmV?d00001 diff --git a/icons/nanox_app_shyft.gif b/icons/nanox_app_shyft.gif new file mode 100644 index 0000000000000000000000000000000000000000..fd1cb06d1ec317d5398e2ecaf7fd50cc67882983 GIT binary patch literal 76 zcmZ?wbh9u|6_GT#!5ilWa@>%GnPOHdq&g7EAXP WrH8ck{HR>?X{xNKtya1SgEau0$`q#n literal 0 HcmV?d00001 diff --git a/src/chainConfig.h b/src/chainConfig.h index 3a174a1..733a1a6 100644 --- a/src/chainConfig.h +++ b/src/chainConfig.h @@ -57,7 +57,8 @@ typedef enum chain_kind_e { CHAIN_KIND_FLARE, CHAIN_KIND_BSC, CHAIN_KIND_SONGBIRD, - CHAIN_KIND_POLYGON + CHAIN_KIND_POLYGON, + CHAIN_KIND_SHYFT } chain_kind_t; typedef struct chain_config_s { diff --git a/src/main.c b/src/main.c index 11358e7..999d1d9 100644 --- a/src/main.c +++ b/src/main.c @@ -266,6 +266,9 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_POLYGON: numTokens = NUM_TOKENS_POLYGON; break; + case CHAIN_KIND_SHYFT: + numTokens = NUM_TOKENS_SHYFT; + break; } for (i = 0; i < numTokens; i++) { switch (chainConfig->kind) { @@ -374,6 +377,9 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) { case CHAIN_KIND_POLYGON: currentToken = (tokenDefinition_t *) PIC(&TOKENS_POLYGON[i]); break; + case CHAIN_KIND_SHYFT: + currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHYFT[i]); + break; } if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) { return currentToken; diff --git a/src/tokens.c b/src/tokens.c index b6a9181..e1ddb5f 100644 --- a/src/tokens.c +++ b/src/tokens.c @@ -192,4 +192,6 @@ const tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER] = {}; const tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON] = {}; +const tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT] = {}; + #endif diff --git a/src/tokens.h b/src/tokens.h index 45c7460..4c3b2ee 100644 --- a/src/tokens.h +++ b/src/tokens.h @@ -101,6 +101,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = { #define NUM_TOKENS_SONGBIRD 0 #define NUM_TOKENS_MOONRIVER 0 #define NUM_TOKENS_POLYGON 0 +#define NUM_TOKENS_SHYFT 0 extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA]; extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM]; @@ -137,6 +138,7 @@ extern tokenDefinition_t const TOKENS_BSC[NUM_TOKENS_BSC]; extern tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD]; extern tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER]; extern tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON]; +extern tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT]; #endif /* HAVE_TOKENS_LIST */ From 5a1dcb0b028d887a07673a02e56724bcf5b88092 Mon Sep 17 00:00:00 2001 From: tjulien-ledger Date: Tue, 14 Dec 2021 17:05:06 +0100 Subject: [PATCH 4/7] adding ETH path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1adad22..a1317a2 100755 --- a/Makefile +++ b/Makefile @@ -235,7 +235,7 @@ APP_LOAD_PARAMS += --path "44'/60'" DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137 APPNAME = "Polygon" else ifeq ($(CHAIN),shyft) -APP_LOAD_PARAMS += --path "44'/7341'" +APP_LOAD_PARAMS += --path "44'/7341'" --path "44'/60'" DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341 APPNAME = "Shyft" else From abc66abc51642d0794da5e12a631c77442511032 Mon Sep 17 00:00:00 2001 From: tjulien-ledger Date: Tue, 14 Dec 2021 17:57:57 +0100 Subject: [PATCH 5/7] bump 1.9.14-shyft --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a1317a2..6453af6 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'" APPVERSION_M=1 APPVERSION_N=9 -APPVERSION_P=14 +APPVERSION_P=15-shyft APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION) From a096f48e1e3f58ad7201c61be1e54befbb96116c Mon Sep 17 00:00:00 2001 From: tjulien-ledger Date: Tue, 14 Dec 2021 18:15:14 +0100 Subject: [PATCH 6/7] Update version bump to 1.9.16 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6453af6..8e3d975 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'" APPVERSION_M=1 APPVERSION_N=9 -APPVERSION_P=15-shyft +APPVERSION_P=16 APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION) From 8055a65868298788eefb96fe65564ed9aa959265 Mon Sep 17 00:00:00 2001 From: tjulien-ledger Date: Wed, 12 Jan 2022 16:49:47 +0100 Subject: [PATCH 7/7] removed unnecessary derivation path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8e3d975..d65af42 100755 --- a/Makefile +++ b/Makefile @@ -235,7 +235,7 @@ APP_LOAD_PARAMS += --path "44'/60'" DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137 APPNAME = "Polygon" else ifeq ($(CHAIN),shyft) -APP_LOAD_PARAMS += --path "44'/7341'" --path "44'/60'" +APP_LOAD_PARAMS += --path "44'/60'" DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341 APPNAME = "Shyft" else