Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
coderofstuff committed Sep 14, 2023
1 parent 4eaad70 commit bdc548f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
12 changes: 6 additions & 6 deletions src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ bool crypto_validate_public_key(const uint32_t *bip32_path,
uint8_t chain_code[32] = {0};

int error = bip32_derive_get_pubkey_256(CX_CURVE_256K1,
bip32_path,
bip32_path_len,
raw_pubkey,
chain_code,
CX_SHA512);
bip32_path,
bip32_path_len,
raw_pubkey,
chain_code,
CX_SHA512);

if (error != CX_OK) {
return false;
Expand Down Expand Up @@ -95,7 +95,7 @@ int crypto_sign_message(void) {
txin,
public_key.W + 1,
G_context.tx_info.sighash);

size_t sig_len = sizeof(G_context.tx_info.signature);
error = cx_ecschnorr_sign_no_throw(&private_key,
CX_ECSCHNORR_BIP0340 | CX_RND_TRNG,
Expand Down
12 changes: 6 additions & 6 deletions src/handler/get_public_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ int handler_get_public_key(buffer_t *cdata, bool display) {
}

int error = bip32_derive_get_pubkey_256(CX_CURVE_256K1,
G_context.bip32_path,
G_context.bip32_path_len,
raw_pubkey,
G_context.pk_info.chain_code,
CX_SHA512);
G_context.bip32_path,
G_context.bip32_path_len,
raw_pubkey,
G_context.pk_info.chain_code,
CX_SHA512);

if (error != CX_OK) {
return io_send_sw(error);
}
Expand Down
9 changes: 5 additions & 4 deletions src/handler/get_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ int handler_get_version() {
_Static_assert(PATCH_VERSION >= 0 && PATCH_VERSION <= UINT8_MAX,
"PATCH version must be between 0 and 255!");

return io_send_response_pointer(
(uint8_t[APPVERSION_LEN]){(uint8_t) MAJOR_VERSION, (uint8_t) MINOR_VERSION, (uint8_t) PATCH_VERSION},
APPVERSION_LEN,
SW_OK);
return io_send_response_pointer((uint8_t[APPVERSION_LEN]){(uint8_t) MAJOR_VERSION,
(uint8_t) MINOR_VERSION,
(uint8_t) PATCH_VERSION},
APPVERSION_LEN,
SW_OK);
}
6 changes: 3 additions & 3 deletions src/ui/bagl_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ int ui_display_transaction() {
memset(g_amount, 0, sizeof(g_amount));
char amount[30] = {0};
if (!format_fpu64_trimmed(amount,
sizeof(amount),
G_context.tx_info.transaction.tx_outputs[0].value,
EXPONENT_SMALLEST_UNIT)) {
sizeof(amount),
G_context.tx_info.transaction.tx_outputs[0].value,
EXPONENT_SMALLEST_UNIT)) {
return io_send_sw(SW_DISPLAY_AMOUNT_FAIL);
}
snprintf(g_amount, sizeof(g_amount), "KAS %.*s", sizeof(amount), amount);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/nbgl_display_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ int ui_display_transaction() {
memset(g_amount, 0, sizeof(g_amount));
char amount[30] = {0};
if (!format_fpu64_trimmed(amount,
sizeof(amount),
G_context.tx_info.transaction.tx_outputs[0].value,
EXPONENT_SMALLEST_UNIT)) {
sizeof(amount),
G_context.tx_info.transaction.tx_outputs[0].value,
EXPONENT_SMALLEST_UNIT)) {
return io_send_sw(SW_DISPLAY_AMOUNT_FAIL);
}
snprintf(g_amount, sizeof(g_amount), "KAS %.*s", sizeof(amount), amount);
Expand Down

0 comments on commit bdc548f

Please sign in to comment.