From 1aba175d7dca2d87e884aa28f5d958b25d8654cc Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 12 Dec 2017 22:00:15 +0100 Subject: [PATCH] build: adapt to new trezor-crypto changes --- SConscript.boardloader | 5 +++++ SConscript.bootloader | 5 +++++ SConscript.firmware | 11 +++++++++++ SConscript.unix | 11 +++++++++++ embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h | 2 +- 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/SConscript.boardloader b/SConscript.boardloader index f3b27f9616..25e875d848 100644 --- a/SConscript.boardloader +++ b/SConscript.boardloader @@ -22,7 +22,12 @@ CPPDEFINES_MOD += [ ] SOURCE_MOD += [ 'vendor/trezor-crypto/blake2s.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c', 'vendor/trezor-crypto/ed25519-donna/ed25519.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c', + 'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c', 'vendor/trezor-crypto/sha2.c', ] diff --git a/SConscript.bootloader b/SConscript.bootloader index 3e4b28c762..f4e56ec071 100644 --- a/SConscript.bootloader +++ b/SConscript.bootloader @@ -22,7 +22,12 @@ CPPDEFINES_MOD += [ ] SOURCE_MOD += [ 'vendor/trezor-crypto/blake2s.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c', 'vendor/trezor-crypto/ed25519-donna/ed25519.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c', + 'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c', 'vendor/trezor-crypto/sha2.c', ] diff --git a/SConscript.firmware b/SConscript.firmware index 1704b9b8f4..b6e99c4d81 100644 --- a/SConscript.firmware +++ b/SConscript.firmware @@ -39,11 +39,22 @@ SOURCE_MOD += [ 'vendor/trezor-crypto/bignum.c', 'vendor/trezor-crypto/bip32.c', 'vendor/trezor-crypto/bip39.c', + 'vendor/trezor-crypto/blake256.c', 'vendor/trezor-crypto/blake2b.c', 'vendor/trezor-crypto/blake2s.c', 'vendor/trezor-crypto/curves.c', 'vendor/trezor-crypto/ecdsa.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.c', 'vendor/trezor-crypto/ed25519-donna/ed25519.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c', + 'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c', + 'vendor/trezor-crypto/hasher.c', 'vendor/trezor-crypto/hmac.c', 'vendor/trezor-crypto/nist256p1.c', 'vendor/trezor-crypto/pbkdf2.c', diff --git a/SConscript.unix b/SConscript.unix index b42b7a3e41..84bb334932 100644 --- a/SConscript.unix +++ b/SConscript.unix @@ -40,11 +40,22 @@ SOURCE_MOD += [ 'vendor/trezor-crypto/bignum.c', 'vendor/trezor-crypto/bip32.c', 'vendor/trezor-crypto/bip39.c', + 'vendor/trezor-crypto/blake256.c', 'vendor/trezor-crypto/blake2b.c', 'vendor/trezor-crypto/blake2s.c', 'vendor/trezor-crypto/curves.c', 'vendor/trezor-crypto/ecdsa.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.c', + 'vendor/trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.c', 'vendor/trezor-crypto/ed25519-donna/ed25519.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-keccak.c', + 'vendor/trezor-crypto/ed25519-donna/ed25519-sha3.c', + 'vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.c', + 'vendor/trezor-crypto/hasher.c', 'vendor/trezor-crypto/hmac.c', 'vendor/trezor-crypto/nist256p1.c', 'vendor/trezor-crypto/pbkdf2.c', diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h index 1143cf44c7..83b19e16c3 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h @@ -336,7 +336,7 @@ STATIC mp_obj_t mod_trezorcrypto_bip32_deserialize(mp_obj_t value, mp_obj_t vers uint32_t vpriv = mp_obj_get_int_truncated(version_private); HDNode hdnode; uint32_t fingerprint; - if (hdnode_deserialize(valueb.buf, vpub, vpriv, &hdnode, &fingerprint) < 0) { + if (hdnode_deserialize(valueb.buf, vpub, vpriv, SECP256K1_NAME, &hdnode, &fingerprint) < 0) { mp_raise_ValueError("Failed to deserialize"); }