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

Feat/nova #60

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
fixed some bugs connected to blindsigning with nova
shufps committed Feb 9, 2024
commit 4c87bed45864527115d8dab62f44c384b6d76748
10 changes: 5 additions & 5 deletions src/api.c
Original file line number Diff line number Diff line change
@@ -256,7 +256,7 @@ uint32_t api_set_account(uint8_t app_mode, const uint8_t *data, uint32_t len)
THROW(SW_INCORRECT_LENGTH);
}

if ((app_mode & 0x7f) > APP_MODE_SHIMMER) {
if ((app_mode & 0x7f) > APP_MODE_SHIMMER_NOVA) {
THROW(SW_INCORRECT_P1P2);
}

@@ -554,9 +554,8 @@ uint32_t api_prepare_blindsigning(uint8_t num_hashes)
THROW(SW_COMMAND_NOT_ALLOWED);
}

// blindsigning only allowed with stardust protocol but not SMR claiming
if (api.protocol != PROTOCOL_STARDUST ||
api.app_mode == APP_MODE_SHIMMER_CLAIMING) {
// blindsigning not allowed on shimmer claiming
if (api.app_mode == APP_MODE_SHIMMER_CLAIMING) {
THROW(SW_COMMAND_NOT_ALLOWED);
}

@@ -572,7 +571,8 @@ uint32_t api_prepare_blindsigning(uint8_t num_hashes)
api.essence.blindsigning = 1;

// multiple of 32byte chunks
uint16_t signing_input_len = (uint16_t)num_hashes << 5;
// value of 0 is the same as 1 for compatibility
uint16_t signing_input_len = (uint16_t) (!num_hashes ? 1 : num_hashes) << 5;

// we allow to prepare without blindsigning enabled but the user will only
// get an error message that blindsigning is not enabled on the Nano when
2 changes: 1 addition & 1 deletion src/iota/constants.h
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@

#define SIGNING_INPUT_MAX_BYTES 64
#define SIGNING_INPUT_NOVA_32BYTE 32
#define SIGNING_INPUT_NOVA_64BYTE 32
#define SIGNING_INPUT_NOVA_64BYTE 64

// address type of ED25519 addresses
#define ADDRESS_TYPE_ED25519 0