Skip to content

Commit

Permalink
New constants
Browse files Browse the repository at this point in the history
  • Loading branch information
neithanmo committed Nov 25, 2024
1 parent 79487c3 commit 382c41f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 13 additions & 0 deletions app/src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
********************************************************************************/
#define U128_STR_MAX_LEN 40

// raw address len before encoding
#define ADDRESS_LEN_BYTES 80

// Common BECH32m constants
#define CHECKSUM_LENGTH 8
#define BECH32_BITS_PER_CHAR 5
Expand All @@ -39,3 +42,13 @@
#define ENCODED_ADDR_LEN (ADDR_HRP_LENGTH + SEPARATOR_LENGTH + ENCODED_DATA_LENGTH)

#define ENCODED_ADDR_BUFFER_SIZE (ENCODED_ADDR_LEN + 2)


// MEMO transaction constants
#dfine MEMO_CIPHERTEXT_LEN_BYTES 528

// This is the `MEMO_CIPHERTEXT_LEN_BYTES` - MAC size (16 bytes).
#define MEMO_LEN_BYTES 512

// This is the largest text length we can support
#define MAX_TEXT_LEN MEMO_LEN_BYTES - ADDRESS_LEN_BYTES
3 changes: 0 additions & 3 deletions app/src/keys_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ extern "C" {
#define INCOMING_VIEWING_KEY_LEN KEY_LEN // Assuming modulo r size
#define ADDR_MAX_ENC_LEN 150 // The maximun length of the encoded address

// raw address len before encoding
#define ADDRESS_LEN_BYTES 80

/// Number of bits in the address short form divided by the number of bits per Bech32m character
#define ADDRESS_NUM_CHARS_SHORT_FORM 24

Expand Down

0 comments on commit 382c41f

Please sign in to comment.