Struan Clark 2 лет назад
Родитель
Сommit
f2934bae7c
4 измененных файлов с 10 добавлено и 5 удалено
  1. 1 1
      flipbip39.c
  2. 1 0
      flipbip39.h
  3. 6 4
      scenes/flipbip39_scene_settings.c
  4. 2 0
      views/flipbip39_scene_1.c

+ 1 - 1
flipbip39.c

@@ -41,7 +41,7 @@ FlipBip39* flipbip39_app_alloc() {
     app->haptic = 1;
     app->speaker = 1;
     app->led = 1;
-    app->bip39_strength = 1; // 256 bits (24 words)
+    app->bip39_strength = 2; // 256 bits (24 words)
 
     view_dispatcher_add_view(app->view_dispatcher, FlipBip39ViewIdMenu, submenu_get_view(app->submenu));
     app->flipbip39_startscreen = flipbip39_startscreen_alloc();

+ 1 - 0
flipbip39.h

@@ -56,5 +56,6 @@ typedef enum {
 
 typedef enum {
     FlipBip39Strength128,
+    FlipBip39Strength192,
     FlipBip39Strength256,
 } FlipBip39StrengthState;

+ 6 - 4
scenes/flipbip39_scene_settings.c

@@ -35,12 +35,14 @@ const uint32_t led_value[2] = {
     FlipBip39LedOn,
 };
 
-const char* const bip39_strength_text[2] = {
+const char* const bip39_strength_text[3] = {
     "12",
+    "18",
     "24",
 };
-const uint32_t bip39_strength_value[2] = {
+const uint32_t bip39_strength_value[3] = {
     FlipBip39Strength128,
+    FlipBip39Strength192,
     FlipBip39Strength256,
 };
 
@@ -86,10 +88,10 @@ void flipbip39_scene_settings_on_enter(void* context) {
     item = variable_item_list_add(
         app->variable_item_list,
         "BIP39 Words:",
-        2,
+        3,
         flipbip39_scene_settings_set_bip39_strength,
         app);
-    value_index = value_index_uint32(app->bip39_strength, bip39_strength_value, 2);
+    value_index = value_index_uint32(app->bip39_strength, bip39_strength_value, 3);
     variable_item_set_current_value_index(item, value_index);
     variable_item_set_current_value_text(item, bip39_strength_text[value_index]);
 

+ 2 - 0
views/flipbip39_scene_1.c

@@ -211,6 +211,7 @@ void flipbip39_scene_1_enter(void* context) {
     int strength_setting = app->bip39_strength;
     int strength = 256;
     if (strength_setting == 0) strength = 128;
+    else if (strength_setting == 1) strength = 192;
 
     flipbip39_play_happy_bump(app);
     flipbip39_led_set_rgb(app, 255, 0, 0);
@@ -239,6 +240,7 @@ FlipBip39Scene1* flipbip39_scene_1_alloc() {
     // int strength_setting = app->bip39_strength;
     // int strength = 256;
     // if (strength_setting == 0) strength = 128;
+    // else if (strength_setting == 1) strength = 192;
 
     // with_view_model(
     //     instance->view,