1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 19:38:09 +00:00

remove all references to USE_PUBKEY_VALIDATE

This commit is contained in:
Pavol Rusnak 2015-03-12 15:53:41 +01:00
parent dc31cc50d2
commit cb9ccc5cf4
6 changed files with 2 additions and 13 deletions

View File

@ -27,7 +27,7 @@ CFLAGS += -Wno-sequence-point
# disable certain optimizations and features when small footprint is required # disable certain optimizations and features when small footprint is required
ifdef SMALL ifdef SMALL
CFLAGS += -DUSE_PRECOMPUTED_IV=0 -DUSE_PRECOMPUTED_CP=0 -DUSE_PUBKEY_VALIDATE=0 CFLAGS += -DUSE_PRECOMPUTED_IV=0 -DUSE_PRECOMPUTED_CP=0
endif endif
OBJS = bignum.o ecdsa.o secp256k1.o rand.o hmac.o bip32.o bip39.o pbkdf2.o base58.o OBJS = bignum.o ecdsa.o secp256k1.o rand.o hmac.o bip32.o bip39.o pbkdf2.o base58.o

View File

@ -162,11 +162,9 @@ int hdnode_public_ckd(HDNode *inout, uint32_t i)
scalar_multiply(&c, &b); // b = c * G scalar_multiply(&c, &b); // b = c * G
point_add(&a, &b); // b = a + b point_add(&a, &b); // b = a + b
#if USE_PUBKEY_VALIDATE
if (!ecdsa_validate_pubkey(&b)) { if (!ecdsa_validate_pubkey(&b)) {
return 0; return 0;
} }
#endif
inout->public_key[0] = 0x02 | (b.y.val[0] & 0x01); inout->public_key[0] = 0x02 | (b.y.val[0] & 0x01);
bn_write_be(&b.x, inout->public_key + 1); bn_write_be(&b.x, inout->public_key + 1);

View File

@ -48,11 +48,6 @@
#define USE_RFC6979 1 #define USE_RFC6979 1
#endif #endif
// check public key for validity
#ifndef USE_PUBKEY_VALIDATE
#define USE_PUBKEY_VALIDATE 1
#endif
// implement BIP32 caching // implement BIP32 caching
#ifndef USE_BIP32_CACHE #ifndef USE_BIP32_CACHE
#define USE_BIP32_CACHE 1 #define USE_BIP32_CACHE 1

View File

@ -19,7 +19,7 @@ srcs = [
extensions = [ extensions = [
Extension('TrezorCrypto', Extension('TrezorCrypto',
sources = ['TrezorCrypto.pyx', 'c.pxd'] + [ x + '.c' for x in srcs ], sources = ['TrezorCrypto.pyx', 'c.pxd'] + [ x + '.c' for x in srcs ],
extra_compile_args = ['-DUSE_PUBKEY_VALIDATE=0'], extra_compile_args = [],
) )
] ]

View File

@ -1060,7 +1060,6 @@ START_TEST(test_pubkey_validity)
res = ecdsa_read_pubkey(pub_key, &pub); res = ecdsa_read_pubkey(pub_key, &pub);
ck_assert_int_eq(res, 1); ck_assert_int_eq(res, 1);
#if USE_PUBKEY_VALIDATE
memcpy(pub_key, fromhex("04f80490839af36d13701ec3f9eebdac901b51c362119d74553a3c537faff31b17e2a59ebddbdac9e87b816307a7ed5b826b8f40b92719086238e1bebf00000000"), 65); memcpy(pub_key, fromhex("04f80490839af36d13701ec3f9eebdac901b51c362119d74553a3c537faff31b17e2a59ebddbdac9e87b816307a7ed5b826b8f40b92719086238e1bebf00000000"), 65);
res = ecdsa_read_pubkey(pub_key, &pub); res = ecdsa_read_pubkey(pub_key, &pub);
ck_assert_int_eq(res, 0); ck_assert_int_eq(res, 0);
@ -1068,7 +1067,6 @@ START_TEST(test_pubkey_validity)
memcpy(pub_key, fromhex("04f80490839af36d13701ec3f9eebdac901b51c362119d74553a3c537faff31b17e2a59ebddbdac9e87b816307a7ed5b8211111111111111111111111111111111"), 65); memcpy(pub_key, fromhex("04f80490839af36d13701ec3f9eebdac901b51c362119d74553a3c537faff31b17e2a59ebddbdac9e87b816307a7ed5b8211111111111111111111111111111111"), 65);
res = ecdsa_read_pubkey(pub_key, &pub); res = ecdsa_read_pubkey(pub_key, &pub);
ck_assert_int_eq(res, 0); ck_assert_int_eq(res, 0);
#endif
memcpy(pub_key, fromhex("00"), 1); memcpy(pub_key, fromhex("00"), 1);
res = ecdsa_read_pubkey(pub_key, &pub); res = ecdsa_read_pubkey(pub_key, &pub);

View File

@ -23,8 +23,6 @@ CFLAGS += $(OPTFLAGS) \
-Werror \ -Werror \
-I.. -I..
CFLAGS += -DUSE_PUBKEY_VALIDATE=0
all: xpubaddrgen all: xpubaddrgen
OBJS = ../bip32.o ../ecdsa.o ../sha2.o ../bignum.o ../base58.o ../secp256k1.o ../ripemd160.o ../hmac.o ../rand.o OBJS = ../bip32.o ../ecdsa.o ../sha2.o ../bignum.o ../base58.o ../secp256k1.o ../ripemd160.o ../hmac.o ../rand.o