From e070c379da6a5d0ccf70118066512a279c2edddf Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Thu, 12 May 2022 17:27:51 +0200 Subject: [PATCH] Removed old code main function & apdu handling function --- src_features/signMessageEIP712/entrypoint.c | 49 --------------------- 1 file changed, 49 deletions(-) diff --git a/src_features/signMessageEIP712/entrypoint.c b/src_features/signMessageEIP712/entrypoint.c index 6cb7504..269f2e9 100644 --- a/src_features/signMessageEIP712/entrypoint.c +++ b/src_features/signMessageEIP712/entrypoint.c @@ -406,52 +406,3 @@ bool handle_apdu(const uint8_t *const data) } return true; } - -#if 0 -int main(void) -{ - uint8_t buf[260]; // 4 bytes APDU header + 256 bytes payload - uint16_t idx; - int state; - uint8_t payload_size = 0; - - init_eip712_context(); - - state = OFFSET_CLA; - idx = 0; - while (fread(&buf[idx], sizeof(buf[idx]), 1, stdin) > 0) - { - switch (state) - { - case OFFSET_CLA: - case OFFSET_INS: - case OFFSET_P1: - case OFFSET_P2: - state += 1; - idx += 1; - break; - case OFFSET_LC: - payload_size = buf[idx]; - state = OFFSET_DATA; - idx += 1; - break; - case OFFSET_DATA: - if (--payload_size == 0) - { - if (!handle_apdu(buf)) return false; - state = OFFSET_CLA; - idx = 0; - } - else idx += 1; - break; - default: - PRINTF("Unexpected APDU state!\n"); - return EXIT_FAILURE; - } - } -#ifdef DEBUG - PRINTF("%lu bytes used in RAM\n", (mem_max + 1)); -#endif - return EXIT_SUCCESS; -} -#endif