remove all references to USE_PUBKEY_VALIDATE

pull/25/head
Pavol Rusnak 9 years ago
parent dc31cc50d2
commit cb9ccc5cf4

@ -27,7 +27,7 @@ CFLAGS += -Wno-sequence-point
# disable certain optimizations and features when small footprint is required
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
OBJS = bignum.o ecdsa.o secp256k1.o rand.o hmac.o bip32.o bip39.o pbkdf2.o base58.o

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

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

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

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

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

Loading…
Cancel
Save