1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

speed up public ckd (used in multisig)

This commit is contained in:
Pavol Rusnak 2015-02-15 20:47:53 +01:00
parent 07c8c4963a
commit 94531f264e
5 changed files with 18 additions and 5 deletions

View File

@ -50,6 +50,7 @@ include ../Makefile.include
CFLAGS += -Wno-sequence-point CFLAGS += -Wno-sequence-point
CFLAGS += -Iprotob -DPB_FIELD_16BIT=1 CFLAGS += -Iprotob -DPB_FIELD_16BIT=1
CFLAGS += -DQR_MAX_VERSION=0 CFLAGS += -DQR_MAX_VERSION=0
CFLAGS += -DUSE_PUBKEY_VALIDATE=0
CFLAGS += -DDEBUG_LINK=0 CFLAGS += -DDEBUG_LINK=0
CFLAGS += -DDEBUG_LOG=0 CFLAGS += -DDEBUG_LOG=0
CFLAGS += -DSCM_REVISION='"$(shell git rev-parse HEAD | sed 's:\(..\):\\x\1:g')"' CFLAGS += -DSCM_REVISION='"$(shell git rev-parse HEAD | sed 's:\(..\):\\x\1:g')"'

View File

@ -301,11 +301,11 @@ int cryptoMultisigPubkeyIndex(const MultisigRedeemScriptType *multisig, const ui
int cryptoMultisigFingerprint(const MultisigRedeemScriptType *multisig, uint8_t *hash) int cryptoMultisigFingerprint(const MultisigRedeemScriptType *multisig, uint8_t *hash)
{ {
static const HDNodePathType *ptr[15], *swap;
const uint32_t n = multisig->pubkeys_count; const uint32_t n = multisig->pubkeys_count;
if (n > 15) { if (n > 15) {
return 0; return 0;
} }
const HDNodePathType *ptr[n], *swap;
uint32_t i, j; uint32_t i, j;
// check sanity // check sanity
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {

View File

@ -1,6 +1,6 @@
#include "fonts.h" #include "fonts.h"
const uint8_t *font_data[256] = { const uint8_t * const font_data[256] = {
/* 0x00 _ */ (uint8_t *)"\x01\x00", /* 0x00 _ */ (uint8_t *)"\x01\x00",
/* 0x01 _ */ (uint8_t *)"\x01\x00", /* 0x01 _ */ (uint8_t *)"\x01\x00",
/* 0x02 _ */ (uint8_t *)"\x01\x00", /* 0x02 _ */ (uint8_t *)"\x01\x00",

View File

@ -5,7 +5,7 @@
#define FONT_HEIGHT 8 #define FONT_HEIGHT 8
extern const uint8_t *font_data[256]; extern const uint8_t * const font_data[256];
int fontCharWidth(char c); int fontCharWidth(char c);
const uint8_t *fontCharData(char c); const uint8_t *fontCharData(char c);

View File

@ -82,8 +82,20 @@ void layoutDialog(LayoutDialogIcon icon, const char *btnNo, const char *btnYes,
void layoutProgressUpdate(bool refresh) void layoutProgressUpdate(bool refresh)
{ {
static uint8_t step = 0; static uint8_t step = 0;
const BITMAP *bmp_gears[4] = { &bmp_gears0, &bmp_gears1, &bmp_gears2, &bmp_gears3 }; switch (step) {
oledDrawBitmap(40, 0, bmp_gears[step]); case 0:
oledDrawBitmap(40, 0, &bmp_gears0);
break;
case 1:
oledDrawBitmap(40, 0, &bmp_gears1);
break;
case 2:
oledDrawBitmap(40, 0, &bmp_gears2);
break;
case 3:
oledDrawBitmap(40, 0, &bmp_gears3);
break;
}
step = (step + 1) % 4; step = (step + 1) % 4;
if (refresh) { if (refresh) {
oledRefresh(); oledRefresh();