1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-17 11:58:13 +00:00

vendor: update trezor-crypto

This commit is contained in:
Pavol Rusnak 2018-09-05 17:40:43 +02:00
parent 69fa8e7ffe
commit 2310d96ee1
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
5 changed files with 5 additions and 7 deletions

View File

@ -20,7 +20,6 @@
#include <string.h>
#include "crypto.h"
#include "sha2.h"
#include "ripemd160.h"
#include "pbkdf2.h"
#include "aes/aes.h"
#include "hmac.h"

View File

@ -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"

View File

@ -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);

View File

@ -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);

@ -1 +1 @@
Subproject commit 3e8974ff8871263a70b7fbb9a27a1da5b0d810f7
Subproject commit f9caee2489aa1ca8a3380c9fc79465a83c848b7f