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:
parent
69fa8e7ffe
commit
2310d96ee1
@ -20,7 +20,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "sha2.h"
|
#include "sha2.h"
|
||||||
#include "ripemd160.h"
|
|
||||||
#include "pbkdf2.h"
|
#include "pbkdf2.h"
|
||||||
#include "aes/aes.h"
|
#include "aes/aes.h"
|
||||||
#include "hmac.h"
|
#include "hmac.h"
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "bip39.h"
|
#include "bip39.h"
|
||||||
#include "ripemd160.h"
|
|
||||||
#include "curves.h"
|
#include "curves.h"
|
||||||
#include "secp256k1.h"
|
#include "secp256k1.h"
|
||||||
#include "ethereum.h"
|
#include "ethereum.h"
|
||||||
|
@ -566,7 +566,7 @@ bool storage_getRootNode(HDNode *node, const char *curve, bool usePassphrase)
|
|||||||
uint8_t secret[64];
|
uint8_t secret[64];
|
||||||
PBKDF2_HMAC_SHA512_CTX pctx;
|
PBKDF2_HMAC_SHA512_CTX pctx;
|
||||||
char oldTiny = usbTiny(1);
|
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);
|
get_root_node_callback(0, BIP39_PBKDF2_ROUNDS);
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
pbkdf2_hmac_sha512_Update(&pctx, BIP39_PBKDF2_ROUNDS / 8);
|
pbkdf2_hmac_sha512_Update(&pctx, BIP39_PBKDF2_ROUNDS / 8);
|
||||||
|
@ -134,8 +134,8 @@ bool compute_address(const CoinInfo *coin,
|
|||||||
}
|
}
|
||||||
raw[0] = 0; // push version
|
raw[0] = 0; // push version
|
||||||
raw[1] = 32; // push 32 bytes
|
raw[1] = 32; // push 32 bytes
|
||||||
memcpy(raw+2, digest, 32); // push hash
|
memcpy(raw + 2, digest, 32); // push hash
|
||||||
hasher_Raw(coin->curve->hasher_pubkey, raw, 34, digest);
|
hasher_Raw(coin->curve->hasher_multisig, raw, 34, digest);
|
||||||
prelen = address_prefix_bytes_len(coin->address_type_p2sh);
|
prelen = address_prefix_bytes_len(coin->address_type_p2sh);
|
||||||
address_write_prefix_bytes(coin->address_type_p2sh, raw);
|
address_write_prefix_bytes(coin->address_type_p2sh, raw);
|
||||||
ripemd160(digest, 32, raw + prelen);
|
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;
|
if (n < 1 || n > 15) return 0;
|
||||||
|
|
||||||
Hasher hasher;
|
Hasher hasher;
|
||||||
hasher_Init(&hasher, coin->curve->hasher_pubkey);
|
hasher_Init(&hasher, coin->curve->hasher_multisig);
|
||||||
|
|
||||||
uint8_t d[2];
|
uint8_t d[2];
|
||||||
d[0] = 0x50 + m; hasher_Update(&hasher, d, 1);
|
d[0] = 0x50 + m; hasher_Update(&hasher, d, 1);
|
||||||
|
2
vendor/trezor-crypto
vendored
2
vendor/trezor-crypto
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 3e8974ff8871263a70b7fbb9a27a1da5b0d810f7
|
Subproject commit f9caee2489aa1ca8a3380c9fc79465a83c848b7f
|
Loading…
Reference in New Issue
Block a user