Tilde Friends
BIP39

Functions

bool tf_bip39_bytes_to_words (const uint8_t *bytes, size_t bytes_size, char *out_words, size_t words_size)
 
bool tf_bip39_words_to_bytes (const char *words, uint8_t *out_bytes, size_t bytes_size)
 

Detailed Description

Convert between raw bytes and BIP39 Word list. See: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki.

Function Documentation

◆ tf_bip39_bytes_to_words()

bool tf_bip39_bytes_to_words ( const uint8_t *  bytes,
size_t  bytes_size,
char *  out_words,
size_t  words_size 
)

Convert a key from bytes to words.

Parameters
bytesA raw binary representation of a key.
bytes_sizeThe size of bytes.
[out]out_wordsA human-readable English word representation of a key.
words_sizeThe size of the out_words buffer.
Returns
True if the key was successfully converted.

◆ tf_bip39_words_to_bytes()

bool tf_bip39_words_to_bytes ( const char *  words,
uint8_t *  out_bytes,
size_t  bytes_size 
)

Convert a key from words to bytes.

Parameters
wordsA space-separated list of English words forming a key.
[out]out_bytesA buffer to receive the raw binary form of the key.
bytes_sizeThe size of the out_bytes buffer.
Returns
True if the key was successfully converted.