Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
address_book.h File Reference
#include <stddef.h>
#include "os_types.h"
Include dependency graph for address_book.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FAMILY_AS_STR(x)
#define ADDRESS_BOOK_ALIAS_MAX_LINES   3
 Max number of lines (nbMaxLinesForValue) of a review value displayed as an ADDRESS_BOOK_ALIAS (contact or Ledger Account name in place of its address): cut with "..." beyond.
#define ADDRESS_BOOK_MAX_CHUNKED_PAYLOAD   (OS_IO_SEPH_BUFFER_SIZE - 3 - 5)

Enumerations

enum  blockchain_family_e {
  FAMILY_BITCOIN = 0x00 , FAMILY_ETHEREUM = 0x01 , FAMILY_SOLANA = 0x02 , FAMILY_POLKADOT = 0x03 ,
  FAMILY_COSMOS = 0x04 , FAMILY_CARDANO = 0x05 , FAMILY_TRON = 0x06 , FAMILY_COUNT
}

Functions

bolos_err_t addr_book_handle_apdu (uint8_t *buffer, size_t buffer_len, uint8_t p1, uint8_t p2)

Macro Definition Documentation

◆ ADDRESS_BOOK_ALIAS_MAX_LINES

#define ADDRESS_BOOK_ALIAS_MAX_LINES   3

Max number of lines (nbMaxLinesForValue) of a review value displayed as an ADDRESS_BOOK_ALIAS (contact or Ledger Account name in place of its address): cut with "..." beyond.

Definition at line 57 of file address_book.h.

◆ ADDRESS_BOOK_MAX_CHUNKED_PAYLOAD

#define ADDRESS_BOOK_MAX_CHUNKED_PAYLOAD   (OS_IO_SEPH_BUFFER_SIZE - 3 - 5)

Minimum IO APDU buffer size when HAVE_ADDRESS_BOOK is defined.

Worst case: CMD_EDIT_IDENTIFIER (P1=0x03), Ethereum, max path depth, max identifiers: 7 (extended header: CLA INS P1 P2 0x00 Lc_H Lc_L)

  • 3 (struct_type) + 3 (struct_version)
  • 66 (group_handle, 64 B)
  • 34 (contact_name, max 32 B)
  • 34 (scope, max 32 B)
  • 82 (new identifier, max 80 B)
  • 82 (old identifier, max 80 B)
  • 34 (hmac_proof, 32 B)
  • 34 (hmac_rest, 32 B)
  • 43 (derivation_path: depth(1) + 10×4 B)
  • 10 (chain_id, 8 B)
  • 3 (blockchain_family, 1 B) = 435 bytes; + 3 SEPH overhead = 438 B. A buffer of 448 B provides a 10-byte safety margin.

Note: Chunk mechanism allows splitting across several APDUs Maximum TLV payload the reassembly buffer must hold.

Mirrors the OS_IO_BUFFER_SIZE selection from os_io.h: prefer CUSTOM_IO_APDU_BUFFER_SIZE when an app defines it, otherwise fall back to OS_IO_SEPH_BUFFER_SIZE (set in Makefile.defines).

Subtract 8 = 3 B (SEPROXYHAL SPI framing) + 5 B (CLA INS P1 P2 Lc).

Definition at line 97 of file address_book.h.

◆ FAMILY_AS_STR

#define FAMILY_AS_STR ( x)
Value:
(x == FAMILY_BITCOIN ? "Bitcoin" \
: x == FAMILY_ETHEREUM ? "Ethereum" \
: x == FAMILY_SOLANA ? "Solana" \
: x == FAMILY_POLKADOT ? "Polkadot" \
: x == FAMILY_COSMOS ? "Cosmos" \
: x == FAMILY_CARDANO ? "Cardano" \
: x == FAMILY_TRON ? "Tron" \
: "Unknown")
@ FAMILY_COSMOS
@ FAMILY_SOLANA
@ FAMILY_CARDANO
@ FAMILY_BITCOIN
@ FAMILY_TRON
@ FAMILY_ETHEREUM
@ FAMILY_POLKADOT

Definition at line 35 of file address_book.h.

Enumeration Type Documentation

◆ blockchain_family_e

Enumerator
FAMILY_BITCOIN 
FAMILY_ETHEREUM 
FAMILY_SOLANA 
FAMILY_POLKADOT 
FAMILY_COSMOS 
FAMILY_CARDANO 
FAMILY_TRON 
FAMILY_COUNT 

Definition at line 24 of file address_book.h.

Function Documentation

◆ addr_book_handle_apdu()

bolos_err_t addr_book_handle_apdu ( uint8_t * buffer,
size_t buffer_len,
uint8_t p1,
uint8_t p2 )

Definition at line 74 of file address_book.c.