diff --git a/firmware/crypto.c b/firmware/crypto.c index e538aeb608..3254b23b36 100644 --- a/firmware/crypto.c +++ b/firmware/crypto.c @@ -20,7 +20,6 @@ #include #include "crypto.h" #include "sha2.h" -#include "ripemd160.h" #include "pbkdf2.h" #include "aes/aes.h" #include "hmac.h" diff --git a/firmware/fsm.c b/firmware/fsm.c index ab60788273..1a142817f0 100644 --- a/firmware/fsm.c +++ b/firmware/fsm.c @@ -47,7 +47,6 @@ #include "crypto.h" #include "base58.h" #include "bip39.h" -#include "ripemd160.h" #include "curves.h" #include "secp256k1.h" #include "ethereum.h" diff --git a/firmware/storage.c b/firmware/storage.c index 429a82e93f..95b7d2ba42 100644 --- a/firmware/storage.c +++ b/firmware/storage.c @@ -566,7 +566,7 @@ bool storage_getRootNode(HDNode *node, const char *curve, bool usePassphrase) uint8_t secret[64]; PBKDF2_HMAC_SHA512_CTX pctx; char oldTiny = usbTiny(1); - pbkdf2_hmac_sha512_Init(&pctx, (const uint8_t *)sessionPassphrase, strlen(sessionPassphrase), (const uint8_t *)"TREZORHD", 8); + pbkdf2_hmac_sha512_Init(&pctx, (const uint8_t *)sessionPassphrase, strlen(sessionPassphrase), (const uint8_t *)"TREZORHD", 8, 1); get_root_node_callback(0, BIP39_PBKDF2_ROUNDS); for (int i = 0; i < 8; i++) { pbkdf2_hmac_sha512_Update(&pctx, BIP39_PBKDF2_ROUNDS / 8); diff --git a/firmware/transaction.c b/firmware/transaction.c index 122e9632a2..4e16f55730 100644 --- a/firmware/transaction.c +++ b/firmware/transaction.c @@ -134,8 +134,8 @@ bool compute_address(const CoinInfo *coin, } raw[0] = 0; // push version raw[1] = 32; // push 32 bytes - memcpy(raw+2, digest, 32); // push hash - hasher_Raw(coin->curve->hasher_pubkey, raw, 34, digest); + memcpy(raw + 2, digest, 32); // push hash + hasher_Raw(coin->curve->hasher_multisig, raw, 34, digest); prelen = address_prefix_bytes_len(coin->address_type_p2sh); address_write_prefix_bytes(coin->address_type_p2sh, raw); ripemd160(digest, 32, raw + prelen); @@ -364,7 +364,7 @@ uint32_t compile_script_multisig_hash(const CoinInfo *coin, const MultisigRedeem if (n < 1 || n > 15) return 0; Hasher hasher; - hasher_Init(&hasher, coin->curve->hasher_pubkey); + hasher_Init(&hasher, coin->curve->hasher_multisig); uint8_t d[2]; d[0] = 0x50 + m; hasher_Update(&hasher, d, 1); diff --git a/vendor/trezor-crypto b/vendor/trezor-crypto index 3e8974ff88..f9caee2489 160000 --- a/vendor/trezor-crypto +++ b/vendor/trezor-crypto @@ -1 +1 @@ -Subproject commit 3e8974ff8871263a70b7fbb9a27a1da5b0d810f7 +Subproject commit f9caee2489aa1ca8a3380c9fc79465a83c848b7f