call to bip39_mnemonic_from_bytes in libwally-core returns NULL
call to bip39_mnemonic_from_bytes in libwally-core returns NULL
what am I doing wrong? it always returns with error -2... I included libwallycore to my project and my IDE tells me it it is available after I also did include <wally_bib39.h>
I tried mainting a wordlist myself but then I run into even more mistakes so I guess I am missusing the API. Ca anyone help out pls?
static void display_mnemonic_word_list(void){
char **mnemonic_secret=NULL;
//wordlist_init(bip39_wordlist)
const unsigned char myArray[] = { 0x00, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x33 };
int ret = bip39_mnemonic_from_bytes(NULL,myArray,32,mnemonic_secret);
if (ret!=WALLY_OK){
printf("mnemonic did not work. error: %d",ret);
}
printf("HSM: your should remember / write down the following words do recover your funds!");
if (mnemonic_secret){
int i = 0;
while ( *mnemonic_secret )
printf( "%d. %s", ++i, *mnemonic_secret++ );
}
}
https://ift.tt/2LwQOnC
Comments
Post a Comment