Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
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)
 

Enumerations

enum  blockchain_family_e {
  FAMILY_BITCOIN = 0x00 , FAMILY_ETHEREUM = 0x01 , FAMILY_SOLANA = 0x02 , FAMILY_POLKADOT = 0x03 ,
  FAMILY_COSMOS = 0x04 , FAMILY_CARDANO = 0x05 , 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

◆ 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" \
: "Unknown")
@ FAMILY_COSMOS
@ FAMILY_SOLANA
@ FAMILY_CARDANO
@ FAMILY_BITCOIN
@ FAMILY_ETHEREUM
@ FAMILY_POLKADOT

Definition at line 34 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_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 
)

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