1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 21:22:10 +00:00

legacy(chore): Remove duplicate constants.

This commit is contained in:
Andrew Kozlik 2023-01-04 16:59:14 +01:00 committed by matejcik
parent c082eb5430
commit a3149bcf97
2 changed files with 4 additions and 7 deletions

View File

@ -36,6 +36,8 @@
#define PATH_UNHARDEN_MASK 0x7fffffff
#define PATH_MAX_ACCOUNT 100
#define PATH_MAX_CHANGE 1
// The maximum allowed change address. This should be large enough for normal
// use and still allow to quickly brute-force the correct bip32 path.
#define PATH_MAX_ADDRESS_INDEX 1000000
#define PATH_SLIP25_PURPOSE (PATH_HARDENED | 10025)

View File

@ -166,11 +166,6 @@ static Hasher coinjoin_request_hasher;
/* A marker for in_address_n_count to indicate a mismatch in bip32 paths in
input */
#define BIP32_NOCHANGEALLOWED 1
/* The chain id used for change */
#define BIP32_CHANGE_CHAIN 1
/* The maximum allowed change address. This should be large enough for normal
use and still allow to quickly brute-force the correct bip32 path. */
#define BIP32_MAX_LAST_ELEMENT 1000000
/* transaction header size: 4 byte version */
#define TXSIZE_HEADER 4
@ -1031,8 +1026,8 @@ bool check_change_bip32_path(const TxInfo *tx_info,
return (count >= BIP32_WALLET_DEPTH && count == tx_info->in_address_n_count &&
0 == memcmp(tx_info->in_address_n, toutput->address_n,
(count - BIP32_WALLET_DEPTH) * sizeof(uint32_t)) &&
toutput->address_n[count - 2] <= BIP32_CHANGE_CHAIN &&
toutput->address_n[count - 1] <= BIP32_MAX_LAST_ELEMENT);
toutput->address_n[count - 2] <= PATH_MAX_CHANGE &&
toutput->address_n[count - 1] <= PATH_MAX_ADDRESS_INDEX);
}
static bool fill_input_script_sig(TxInputType *tinput) {