Skip to content

Commit

Permalink
Merge pull request #2 from Zondax/dev
Browse files Browse the repository at this point in the history
Change SpendingKey generation
  • Loading branch information
ftheirs authored Mar 19, 2024
2 parents e8c705c + 9f33495 commit 3061362
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=0
# This is the minor version
APPVERSION_N=0
# This is the patch version
APPVERSION_P=1
APPVERSION_P=2
5 changes: 1 addition & 4 deletions app/src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ zxerr_t crypto_generateSaplingKeys(uint8_t *output, uint16_t outputLen) {
MEMZERO(output, outputLen);

// Generate spending key
cx_ecfp_private_key_t cx_privateKey = {0};
uint8_t privateKeyData[SK_LEN_25519] = {0};
CATCH_CXERROR(os_derive_bip32_with_seed_no_throw(HDW_NORMAL,
CX_CURVE_Ed25519,
hdPath,
HDPATH_LEN_DEFAULT,
privateKeyData,
NULL, NULL, 0));
CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_Ed25519, privateKeyData, 32, &cx_privateKey));

keys_t saplingKeys = {0};
memcpy(saplingKeys.spendingKey, cx_privateKey.d, KEY_LENGTH);
memcpy(saplingKeys.spendingKey, privateKeyData, KEY_LENGTH);
error = computeKeys(&saplingKeys);

// Copy keys
Expand All @@ -87,7 +85,6 @@ zxerr_t crypto_generateSaplingKeys(uint8_t *output, uint16_t outputLen) {
}

catch_cx_error:
MEMZERO(&cx_privateKey, sizeof(cx_privateKey));
MEMZERO(privateKeyData, sizeof(privateKeyData));
MEMZERO(&saplingKeys, sizeof(saplingKeys));

Expand Down
Binary file modified tests_zemu/snapshots/s-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sp-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/x-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3061362

Please sign in to comment.