Skip to content

Commit ea1709b

Browse files
Completely remove old Starkware internal "plugin"
1 parent adbe34c commit ea1709b

40 files changed

+1
-2984
lines changed

makefile_conf/chain/ethereum.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
APP_LOAD_PARAMS += --path "44'/60'"
33
TICKER = "ETH"
44
CHAIN_ID = 1
5-
# Starkware integration
6-
APP_LOAD_PARAMS += --path "2645'/579218131'"
7-
DEFINES += HAVE_STARKWARE
8-
DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
95
# Allow to derive ETH 2 public keys
106
APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
117
DEFINES += HAVE_ETH2

makefile_conf/chain/goerli.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
APP_LOAD_PARAMS += --path "44'/60'"
22
TICKER = "ETH"
33
CHAIN_ID = 5
4-
# Starkware integration
5-
APP_LOAD_PARAMS += --path "2645'/579218131'"
6-
DEFINES += HAVE_STARKWARE
7-
# Keep for Starkware Goerli tests
8-
DEFINES += HAVE_TOKENS_EXTRA_LIST
9-
DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
104
# Allow to derive ETH 2 public keys
115
APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
126
DEFINES += HAVE_ETH2

makefile_conf/chain/ropsten.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
APP_LOAD_PARAMS += --path "44'/60'"
22
TICKER = "ETH"
33
CHAIN_ID = 3
4-
# Starkware integration
5-
APP_LOAD_PARAMS += --path "2645'/579218131'"
6-
DEFINES += HAVE_STARKWARE
7-
# Keep for Starkware Ropsten tests
8-
DEFINES += HAVE_TOKENS_EXTRA_LIST
9-
DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
104
# Allow to derive ETH 2 public keys
115
APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
126
DEFINES += HAVE_ETH2

src/apdu_constants.h

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
#define APP_FLAG_DATA_ALLOWED 0x01
77
#define APP_FLAG_EXTERNAL_TOKEN_NEEDED 0x02
8-
#define APP_FLAG_STARKWARE 0x04
9-
#define APP_FLAG_STARKWARE_V2 0x08
108

119
#define CLA 0xE0
1210
#define INS_GET_PUBLIC_KEY 0x02
@@ -47,26 +45,6 @@
4745
#define APDU_RESPONSE_CONDITION_NOT_SATISFIED 0x6985
4846
#define APDU_RESPONSE_REF_DATA_NOT_FOUND 0x6a88
4947

50-
#ifdef HAVE_STARKWARE
51-
52-
#define STARKWARE_CLA 0xF0
53-
#define STARKWARE_INS_GET_PUBLIC_KEY 0x02
54-
#define STARKWARE_INS_SIGN_MESSAGE 0x04
55-
#define STARKWARE_INS_PROVIDE_QUANTUM 0x08
56-
#define STARKWARE_INS_UNSAFE_SIGN 0x0A
57-
58-
#define P1_STARK_ORDER 0x01
59-
#define P1_STARK_TRANSFER 0x02
60-
#define P1_STARK_ORDER_V2 0x03
61-
#define P1_STARK_TRANSFER_V2 0x04
62-
#define P1_STARK_CONDITIONAL_TRANSFER 0x05
63-
64-
#define STARK_ORDER_TYPE 0
65-
#define STARK_TRANSFER_TYPE 1
66-
#define STARK_CONDITIONAL_TRANSFER_TYPE 2
67-
68-
#endif
69-
7048
enum { OFFSET_CLA = 0, OFFSET_INS, OFFSET_P1, OFFSET_P2, OFFSET_LC, OFFSET_CDATA };
7149

7250
#define ERR_APDU_EMPTY 0x6982
@@ -151,35 +129,6 @@ void handleSetEth2WinthdrawalIndex(uint8_t p1,
151129

152130
#endif
153131

154-
#ifdef HAVE_STARKWARE
155-
156-
void handleStarkwareGetPublicKey(uint8_t p1,
157-
uint8_t p2,
158-
const uint8_t *dataBuffer,
159-
uint8_t dataLength,
160-
unsigned int *flags,
161-
unsigned int *tx);
162-
void handleStarkwareSignMessage(uint8_t p1,
163-
uint8_t p2,
164-
uint8_t *dataBuffer,
165-
uint8_t dataLength,
166-
unsigned int *flags,
167-
unsigned int *tx);
168-
void handleStarkwareProvideQuantum(uint8_t p1,
169-
uint8_t p2,
170-
const uint8_t *dataBuffer,
171-
uint8_t dataLength,
172-
unsigned int *flags,
173-
unsigned int *tx);
174-
void handleStarkwareUnsafeSign(uint8_t p1,
175-
uint8_t p2,
176-
const uint8_t *dataBuffer,
177-
uint8_t dataLength,
178-
unsigned int *flags,
179-
unsigned int *tx);
180-
181-
#endif
182-
183132
extern uint16_t apdu_response_code;
184133

185134
#endif // _APDU_CONSTANTS_H_

src/common_ui.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ void ui_display_privacy_public_key(void);
1111
void ui_display_privacy_shared_secret(void);
1212
void ui_display_public_key(const uint64_t *chain_id);
1313
void ui_sign_712_v0(void);
14-
void ui_display_stark_public(void);
1514
void ui_confirm_selector(void);
1615
void ui_confirm_parameter(void);
17-
void ui_stark_limit_order(void);
18-
void ui_stark_unsafe_sign(void);
19-
void ui_stark_transfer(bool selfTransfer, bool conditional);
2016

2117
// EIP-191
2218
void ui_191_start(void);

src/eth_plugin_internal.c

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
#include "eth_plugin_internal.h"
33
#include "plugin_utils.h"
44

5-
bool erc20_plugin_available_check(void);
6-
75
void erc20_plugin_call(int message, void* parameters);
86

9-
#ifdef HAVE_STARKWARE
10-
void starkware_plugin_call(int message, void* parameters);
11-
#endif
127
#ifdef HAVE_ETH2
138
void eth2_plugin_call(int message, void* parameters);
149
#endif
@@ -27,83 +22,15 @@ const uint8_t* const ETH2_SELECTORS[NUM_ETH2_SELECTORS] = {ETH2_DEPOSIT_SELECTOR
2722

2823
#endif
2924

30-
#ifdef HAVE_STARKWARE
31-
32-
static const uint8_t STARKWARE_REGISTER_ID[SELECTOR_SIZE] = {0xdd, 0x24, 0x14, 0xd4};
33-
static const uint8_t STARKWARE_DEPOSIT_TOKEN_ID[SELECTOR_SIZE] = {0x25, 0x05, 0xc3, 0xd9};
34-
static const uint8_t STARKWARE_DEPOSIT_ETH_ID[SELECTOR_SIZE] = {0x00, 0xae, 0xef, 0x8a};
35-
static const uint8_t STARKWARE_DEPOSIT_CANCEL_ID[SELECTOR_SIZE] = {0x7d, 0xf7, 0xdc, 0x04};
36-
static const uint8_t STARKWARE_DEPOSIT_RECLAIM_ID[SELECTOR_SIZE] = {0xae, 0x87, 0x38, 0x16};
37-
static const uint8_t STARKWARE_WITHDRAW_ID[SELECTOR_SIZE] = {0x44, 0x1a, 0x3e, 0x70};
38-
static const uint8_t STARKWARE_FULL_WITHDRAWAL_ID[SELECTOR_SIZE] = {0xa9, 0x33, 0x10, 0xc4};
39-
static const uint8_t STARKWARE_FREEZE_ID[SELECTOR_SIZE] = {0x93, 0xc1, 0xe4, 0x66};
40-
static const uint8_t STARKWARE_ESCAPE_ID[SELECTOR_SIZE] = {0x9e, 0x3a, 0xda, 0xc4};
41-
static const uint8_t STARKWARE_VERIFY_ESCAPE_ID[SELECTOR_SIZE] = {0x2d, 0xd5, 0x30, 0x06};
42-
43-
static const uint8_t STARKWARE_WITHDRAW_TO_ID[SELECTOR_SIZE] = {0x14, 0xcd, 0x70, 0xe4};
44-
static const uint8_t STARKWARE_DEPOSIT_NFT_ID[SELECTOR_SIZE] = {0xae, 0x1c, 0xdd, 0xe6};
45-
static const uint8_t STARKWARE_DEPOSIT_NFT_RECLAIM_ID[SELECTOR_SIZE] = {0xfc, 0xb0, 0x58, 0x22};
46-
static const uint8_t STARKWARE_WITHDRAW_AND_MINT_ID[SELECTOR_SIZE] = {0xd9, 0x14, 0x43, 0xb7};
47-
static const uint8_t STARKWARE_WITHDRAW_NFT_ID[SELECTOR_SIZE] = {0x01, 0x9b, 0x41, 0x7a};
48-
static const uint8_t STARKWARE_WITHDRAW_NFT_TO_ID[SELECTOR_SIZE] = {0xeb, 0xef, 0x0f, 0xd0};
49-
static const uint8_t STARKWARE_REGISTER_AND_DEPOSIT_TOKEN_ID[SELECTOR_SIZE] = {0x10,
50-
0x82,
51-
0x08,
52-
0xcf};
53-
static const uint8_t STARKWARE_REGISTER_AND_DEPOSIT_ETH_ID[SELECTOR_SIZE] = {0xa7,
54-
0x78,
55-
0xc0,
56-
0xc3};
57-
static const uint8_t STARKWARE_PROXY_DEPOSIT_TOKEN_ID[SELECTOR_SIZE] = {0xdc, 0xca, 0xd5, 0x24};
58-
static const uint8_t STARKWARE_PROXY_DEPOSIT_ETH_ID[SELECTOR_SIZE] = {0x6c, 0xe5, 0xd9, 0x57};
59-
60-
const uint8_t* const STARKWARE_SELECTORS[NUM_STARKWARE_SELECTORS] = {
61-
STARKWARE_REGISTER_ID,
62-
STARKWARE_DEPOSIT_TOKEN_ID,
63-
STARKWARE_DEPOSIT_ETH_ID,
64-
STARKWARE_DEPOSIT_CANCEL_ID,
65-
STARKWARE_DEPOSIT_RECLAIM_ID,
66-
STARKWARE_WITHDRAW_ID,
67-
STARKWARE_FULL_WITHDRAWAL_ID,
68-
STARKWARE_FREEZE_ID,
69-
STARKWARE_ESCAPE_ID,
70-
STARKWARE_VERIFY_ESCAPE_ID,
71-
STARKWARE_WITHDRAW_TO_ID,
72-
STARKWARE_DEPOSIT_NFT_ID,
73-
STARKWARE_DEPOSIT_NFT_RECLAIM_ID,
74-
STARKWARE_WITHDRAW_AND_MINT_ID,
75-
STARKWARE_WITHDRAW_NFT_ID,
76-
STARKWARE_WITHDRAW_NFT_TO_ID,
77-
STARKWARE_REGISTER_AND_DEPOSIT_TOKEN_ID,
78-
STARKWARE_REGISTER_AND_DEPOSIT_ETH_ID,
79-
STARKWARE_PROXY_DEPOSIT_TOKEN_ID,
80-
STARKWARE_PROXY_DEPOSIT_ETH_ID};
81-
82-
#endif
83-
8425
// All internal alias names start with 'minus'
8526

8627
const internalEthPlugin_t INTERNAL_ETH_PLUGINS[] = {
87-
{erc20_plugin_available_check,
88-
(const uint8_t**) ERC20_SELECTORS,
89-
NUM_ERC20_SELECTORS,
90-
"-erc20",
91-
erc20_plugin_call},
28+
{NULL, (const uint8_t**) ERC20_SELECTORS, NUM_ERC20_SELECTORS, "-erc20", erc20_plugin_call},
9229

9330
#ifdef HAVE_ETH2
9431

9532
{NULL, (const uint8_t**) ETH2_SELECTORS, NUM_ETH2_SELECTORS, "-eth2", eth2_plugin_call},
9633

97-
#endif
98-
99-
#ifdef HAVE_STARKWARE
100-
101-
{NULL,
102-
(const uint8_t**) STARKWARE_SELECTORS,
103-
NUM_STARKWARE_SELECTORS,
104-
"-strk",
105-
starkware_plugin_call},
106-
10734
#endif
10835

10936
{NULL, NULL, 0, "", NULL}};

src/eth_plugin_internal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,4 @@ extern const uint8_t* const ETH2_SELECTORS[NUM_ETH2_SELECTORS];
2929

3030
#endif
3131

32-
#ifdef HAVE_STARKWARE
33-
34-
#define NUM_STARKWARE_SELECTORS 20
35-
extern const uint8_t* const STARKWARE_SELECTORS[NUM_STARKWARE_SELECTORS];
36-
37-
#endif
38-
3932
extern internalEthPlugin_t const INTERNAL_ETH_PLUGINS[];

src/main.c

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
#include "challenge.h"
3333
#include "domain_name.h"
3434

35-
#ifdef HAVE_STARKWARE
36-
#include "stark_crypto.h"
37-
#endif
38-
3935
unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B];
4036

4137
void ui_idle(void);
@@ -55,9 +51,6 @@ uint16_t apdu_response_code;
5551
bool G_called_from_swap;
5652
bool G_swap_response_ready;
5753
pluginType_t pluginType;
58-
#ifdef HAVE_STARKWARE
59-
bool quantumSet;
60-
#endif
6154

6255
#ifdef HAVE_ETH2
6356
uint32_t eth2WithdrawalIndex;
@@ -81,9 +74,6 @@ void reset_app_context() {
8174
G_called_from_swap = false;
8275
G_swap_response_ready = false;
8376
pluginType = OLD_INTERNAL;
84-
#ifdef HAVE_STARKWARE
85-
quantumSet = false;
86-
#endif
8777
#ifdef HAVE_ETH2
8878
eth2WithdrawalIndex = 0;
8979
#endif
@@ -232,52 +222,6 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
232222

233223
#endif // HAVE_WALLET_ID_SDK
234224

235-
#ifdef HAVE_STARKWARE
236-
237-
if (G_io_apdu_buffer[OFFSET_CLA] == STARKWARE_CLA) {
238-
switch (G_io_apdu_buffer[OFFSET_INS]) {
239-
case STARKWARE_INS_GET_PUBLIC_KEY:
240-
handleStarkwareGetPublicKey(G_io_apdu_buffer[OFFSET_P1],
241-
G_io_apdu_buffer[OFFSET_P2],
242-
G_io_apdu_buffer + OFFSET_CDATA,
243-
G_io_apdu_buffer[OFFSET_LC],
244-
flags,
245-
tx);
246-
break;
247-
case STARKWARE_INS_SIGN_MESSAGE:
248-
handleStarkwareSignMessage(G_io_apdu_buffer[OFFSET_P1],
249-
G_io_apdu_buffer[OFFSET_P2],
250-
G_io_apdu_buffer + OFFSET_CDATA,
251-
G_io_apdu_buffer[OFFSET_LC],
252-
flags,
253-
tx);
254-
break;
255-
case STARKWARE_INS_PROVIDE_QUANTUM:
256-
handleStarkwareProvideQuantum(G_io_apdu_buffer[OFFSET_P1],
257-
G_io_apdu_buffer[OFFSET_P2],
258-
G_io_apdu_buffer + OFFSET_CDATA,
259-
G_io_apdu_buffer[OFFSET_LC],
260-
flags,
261-
tx);
262-
break;
263-
case STARKWARE_INS_UNSAFE_SIGN:
264-
handleStarkwareUnsafeSign(G_io_apdu_buffer[OFFSET_P1],
265-
G_io_apdu_buffer[OFFSET_P2],
266-
G_io_apdu_buffer + OFFSET_CDATA,
267-
G_io_apdu_buffer[OFFSET_LC],
268-
flags,
269-
tx);
270-
break;
271-
default:
272-
THROW(0x6D00);
273-
break;
274-
}
275-
CLOSE_TRY;
276-
return;
277-
}
278-
279-
#endif
280-
281225
if (G_io_apdu_buffer[OFFSET_CLA] != CLA) {
282226
THROW(0x6E00);
283227
}

src/poorstream.c

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/poorstream.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)