Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
osiastedian committed Oct 26, 2023
1 parent 61af977 commit 55816e6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
18 changes: 0 additions & 18 deletions src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,26 +266,8 @@ uint32_t crypto_get_key_fingerprint(const uint8_t pub_key[static 33]) {
return read_u32_be(key_rip, 0);
}

void crypto_get_master_fingerprint_path(bip32_path_t *path) {
path->length = 0;
if (BIP32_PUBKEY_VERSION == BIP32_PUBKEY_VERSION_MAINNET) { // mainnet
// Mainnet fingerprint bip32 path m/44'/57' in HWI
path->path[0] = 0x8000002c;
path->path[1] = 0x80000039;
path->length = 2;
} else if (BIP32_PUBKEY_VERSION == BIP32_PUBKEY_VERSION_TESTNET) { // testnet
// Testnet fingerprint bip32 path m/0'/1' in HWI
path->path[0] = 0x8000002c;
path->path[1] = 0x80000001;
path->length = 2;
}
}

uint32_t crypto_get_master_key_fingerprint() {
uint8_t master_pub_key[33];
bip32_path_t path;
// crypto_get_master_fingerprint_path(&path);
// crypto_get_compressed_pubkey_at_path(path.path, path.length, master_pub_key, NULL);
uint32_t bip32_path[] = {};
crypto_get_compressed_pubkey_at_path(bip32_path, 0, master_pub_key, NULL);
return crypto_get_key_fingerprint(master_pub_key);
Expand Down
8 changes: 0 additions & 8 deletions src/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,6 @@ bool crypto_get_compressed_pubkey_at_path(const uint32_t bip32_path[],
*/
uint32_t crypto_get_key_fingerprint(const uint8_t pub_key[static 33]);

/**
* Computes the master fingerprint path as per BIP32.
*
* @param[out] path
* Master fingerprint path.
*/
void crypto_get_master_fingerprint_path(bip32_path_t *path);

/**
* Computes the fingerprint of the master key as per BIP32.
*
Expand Down
6 changes: 0 additions & 6 deletions src/handler/get_master_fingerprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ void handler_get_master_fingerprint(dispatcher_context_t *dc, uint8_t protocol_v
}

uint8_t master_pubkey[33];
// bip32_path_t path;
// crypto_get_master_fingerprint_path(&path);
// if (!crypto_get_compressed_pubkey_at_path(path.path, path.length, master_pubkey, NULL)) {
// SEND_SW(dc, SW_BAD_STATE); // should never happen
// return;
// }
if (!crypto_get_compressed_pubkey_at_path((uint32_t[]){}, 0, master_pubkey, NULL)) {
SEND_SW(dc, SW_BAD_STATE); // should never happen
return;
Expand Down

0 comments on commit 55816e6

Please sign in to comment.