Skip to content

Commit

Permalink
reorganizing code, marking WIP seed code
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Mar 2, 2023
1 parent 0443a1e commit 2a09d28
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions views/flipbip39_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ static void flipbip39_scene_1_model_init(FlipBip39Scene1Model* const model, cons
// Generate a random mnemonic using trezor-crypto
model->strength = strength;
const char* mnemonic = mnemonic_generate(model->strength);

// Generate a seed from the mnemonic
uint8_t seed[64];
// WIP / TODO
//mnemonic_to_seed(mnemonic, "", seed, 0);
model->seed = (char *)seed;

// Delineate 6 sections of the mnemonic
// Delineate sections of the mnemonic every 4 words
char *str = malloc(strlen(mnemonic) + 1);
strcpy(str, mnemonic);
int word = 0;
Expand All @@ -79,13 +85,8 @@ static void flipbip39_scene_1_model_init(FlipBip39Scene1Model* const model, cons
}
}

// Generate a seed from the mnemonic
uint8_t seed[64];
//mnemonic_to_seed(mnemonic, "", seed, 0);
model->seed = (char *)seed;

// Split the mnemonic into parts
char *ptr = strtok (str, ",");
char *ptr = strtok(str, ",");
int partnum = 0;
while(ptr != NULL)
{
Expand Down

0 comments on commit 2a09d28

Please sign in to comment.