Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

save a byte in the lnurl data that is unused #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions lnPoSTdisplay/lnPoSTdisplay.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1574,14 +1574,13 @@ int xor_encrypt(uint8_t *output, size_t outlen, uint8_t *key, size_t keylen, uin
memcpy(output + cur, nonce, nonce_len);
cur += nonce_len;

// payload, unxored first - <pin><currency byte><amount>
int payload_len = lenVarInt(pin) + 1 + lenVarInt(amount_in_cents);
// payload, unxored first - <pin><amount>
int payload_len = lenVarInt(pin) + lenVarInt(amount_in_cents);
output[cur] = (uint8_t)payload_len;
cur++;
uint8_t *payload = output + cur; // pointer to the start of the payload
cur += writeVarInt(pin, output + cur, outlen - cur); // pin code
cur += writeVarInt(amount_in_cents, output + cur, outlen - cur); // amount
cur++;

// xor it with round key
uint8_t hmacresult[32];
Expand Down