Removed useless header include in shared_context.h

Could easily create a circular header dependency
This commit is contained in:
Alexandre Paillier
2022-02-15 14:09:43 +01:00
parent b3a36f9b11
commit 2e63a428b2
9 changed files with 11 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include "eth_plugin_internal.h"
#include "shared_context.h"
#include "network.h"
#include "ethUtils.h"
void eth_plugin_prepare_init(ethPluginInitContract_t *init, uint8_t *selector, uint32_t dataSize) {
memset((uint8_t *) init, 0, sizeof(ethPluginInitContract_t));

View File

@@ -10,7 +10,6 @@
#include "cx.h"
#include "os_io_seproxyhal.h"
#include "ethUstream.h"
#include "ethUtils.h"
#include "uint256.h"
#include "tokens.h"
#include "chainConfig.h"

View File

@@ -4,6 +4,7 @@
#include "stark_utils.h"
#include "ui_callbacks.h"
#include "utils.h"
#include "ethUtils.h"
static unsigned char const C_cx_Stark256_n[] = {
// n: 0x0800000000000010ffffffffffffffffb781126dcae7b2321e66a241adc64d2f
@@ -16,13 +17,13 @@ static unsigned char const STARK_DERIVE_BIAS[] = {
0x38, 0xa1, 0x3b, 0x4b, 0x92, 0x0e, 0x94, 0x11, 0xae, 0x6d, 0xa5, 0xf4, 0x0b, 0x03, 0x58, 0xb1};
void starkDerivePrivateKey(uint32_t *bip32Path, uint32_t bip32PathLength, uint8_t *privateKeyData) {
#if 0
// Sanity check
#if 0
// Sanity check
if (bip32Path[0] != STARK_BIP32_PATH_0) {
PRINTF("Invalid Stark derivation path %d\n", bip32Path[0]);
THROW(0x6a80);
}
os_perso_derive_node_bip32(CX_CURVE_256K1, bip32Path, bip32PathLength, privateKeyData, NULL);
os_perso_derive_node_bip32(CX_CURVE_256K1, bip32Path, bip32PathLength, privateKeyData, NULL);
PRINTF("Private key before processing %.*H\n", 32, privateKeyData);
// TODO - support additional schemes
cx_math_modm(privateKeyData, 32, C_cx_Stark256_n, 32);

View File

@@ -3,6 +3,7 @@
#include "ui_flow.h"
#include "feature_getPublicKey.h"
#include "ethUtils.h"
void handleGetPublicKey(uint8_t p1,
uint8_t p2,

View File

@@ -3,6 +3,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "ui_flow.h"
#include "ethUtils.h"
void handleStarkwareProvideQuantum(uint8_t p1,
__attribute__((unused)) uint8_t p2,

View File

@@ -6,6 +6,7 @@
#include "ui_flow.h"
#include "poorstream.h"
#include "ui_callbacks.h"
#include "ethUtils.h"
#define U8BE(buf, off) \
(uint64_t)((((uint64_t) U4BE(buf, off)) << 32) | (((uint64_t) U4BE(buf, off + 4)) & 0xFFFFFFFF))

View File

@@ -2,6 +2,7 @@
#include "shared_context.h"
#include "ui_callbacks.h"
#include "ethUtils.h"
unsigned int io_seproxyhal_touch_stark_ok(const bagl_element_t *e);

View File

@@ -3,6 +3,7 @@
#include "shared_context.h" // TODO : rewrite as independant code
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
#include "utils.h"
#include "ethUtils.h"
typedef enum {
COMPOUND_REDEEM_UNDERLYING = 0,

View File

@@ -4,6 +4,7 @@
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
#include "stark_utils.h"
#include "utils.h"
#include "ethUtils.h"
#ifdef HAVE_STARKWARE