Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for newer SDK #215

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ CURVE_APP_LOAD_PARAMS = secp256k1

# Application allowed derivation paths.
PATH_APP_LOAD_PARAMS = ""
APP_LOAD_PARAMS += --path_slip21 "LEDGER-Wallet policy"

# Allowed SLIP21 paths
PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy"

# Application version
APPVERSION_M = 2
APPVERSION_N = 1
APPVERSION_P = 3
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

APP_STACK_SIZE = 3072

# Setting to allow building variant applications
VARIANT_PARAM = COIN
VARIANT_VALUES = bitcoin_testnet bitcoin
Expand Down
8 changes: 5 additions & 3 deletions src/common/merkle.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "cx_ram.h"
#include "debug-helpers/debug.h"

#include "ledger_assert.h"

void merkle_compute_element_hash(const uint8_t *in, size_t in_len, uint8_t out[static 32]) {
cx_sha256_t hash;
cx_sha256_init(&hash);
Expand Down Expand Up @@ -63,10 +65,10 @@ void merkle_combine_hashes(const uint8_t left[static 32],
cx_sha256_init_no_throw(&G_cx.sha256);

uint8_t prefix = 0x01;
cx_sha256_update(&G_cx.sha256, &prefix, 1);
LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, &prefix, 1) == CX_OK, "It never fails");

cx_sha256_update(&G_cx.sha256, left, 32);
cx_sha256_update(&G_cx.sha256, right, 32);
LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, left, 32) == CX_OK, "It never fails");
LEDGER_ASSERT(cx_sha256_update(&G_cx.sha256, right, 32) == CX_OK, "It never fails");

cx_sha256_final(&G_cx.sha256, out);
explicit_bzero(&G_cx.sha256, sizeof(cx_sha256_t));
Expand Down
Loading