Skip to content
Open
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
2 changes: 1 addition & 1 deletion scripts/prepare-devenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

if [ -d clang-arm-fropi -a -d gcc-arm-none-eabi-5_3-2016q1 -a -d nanos-secure-sdk-f9e1c7b8904df2eee0ae7e603f552b876c169334 ]; then
echo "Devend is already prepared. Exiting."
echo "Devenv is already prepared. Exiting."
exit
fi

Expand Down
13 changes: 6 additions & 7 deletions src/signMessage.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "signMessage.h"
#include "os.h"
#include "utils.h"
#include "blake2b.h"

static char message[0xFC];
static uint32_t accountNumber;
static uint8_t *data;
static uint32_t dataLength;

static const char SIGN_MAGIC[] = "æternity Signed Message:\n";
static const char SIGN_MAGIC[] = "aeternity Signed Message:\n";

static unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e) {
uint8_t message[0xFC + sizeof(SIGN_MAGIC) - 1 + 2];
Expand All @@ -26,12 +27,10 @@ static unsigned int io_seproxyhal_touch_signMessage_ok(const bagl_element_t *e)
os_memmove(message + messageLength, data, dataLength);
messageLength += dataLength;

sign(
accountNumber,
message,
messageLength,
G_io_apdu_buffer
);
uint8_t hash[32];
blake2b(&hash, 32, message, messageLength);

sign(accountNumber, hash, 32, G_io_apdu_buffer);
sendResponse(64, true);
return 0; // do not redraw the widget
}
Expand Down
2 changes: 1 addition & 1 deletion src/signTransaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static char payload[80];
static uint32_t accountNumber;
static uint32_t remainTransactionLength;
static char networkId[NETWORK_ID_MAX_LENGTH + 1];
cx_blake2b_t hash;
static cx_blake2b_t hash;
static txType transactionType;

static void singAndSend() {
Expand Down