From d2120d6da1a93dcdb443d0b13a9a3817363db320 Mon Sep 17 00:00:00 2001 From: Josh Billings Date: Mon, 6 Jul 2015 12:43:30 -0400 Subject: [PATCH] two bugfixes: 1. nist256p1.c was not included in setup.py, causing import errors when using TrezorCrypto.so in Python. 2. if you attempted a hardened derivation in python using the compiled TrezorCrypto module, an IntegerOverflowError would occur because Python ints are always signed. one-line fix by changing int to unsigned int in the pyx file --- TrezorCrypto.pyx | 3 +-- setup.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TrezorCrypto.pyx b/TrezorCrypto.pyx index 64903ff383..2babddb324 100644 --- a/TrezorCrypto.pyx +++ b/TrezorCrypto.pyx @@ -1,6 +1,5 @@ cimport c cimport cython - cdef class HDNode: cdef c.HDNode node @@ -34,7 +33,7 @@ cdef class HDNode: c.hdnode_public_ckd(cython.address(x.node), i) return x - def private_ckd(self, int i): + def private_ckd(self, unsigned int i): x = HDNode(copyfrom=self) c.hdnode_private_ckd(cython.address(x.node), i) return x diff --git a/setup.py b/setup.py index 106171681e..0aadea8e2c 100755 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ from Cython.Build import cythonize from Cython.Distutils import build_ext srcs = [ + 'nist256p1', 'base58', 'bignum', 'bip32',