@@ -587,26 +587,43 @@ def do_split_seed(self, arg):
587587            maximum = 16 ,
588588        )
589589        passphrase  =  b"" 
590+         # Max possible combos is 12,870 (with 8-of-16) 
591+         testing_limit  =  12870 
590592        if  self .ADVANCED_MODE :
591593            add_passphrase  =  _get_bool (
592594                "Do you want to add a passphrase?" , default = False 
593595            )
594596            if  add_passphrase :
595597                passphrase  =  _get_confirmed_pw ().encode ("ascii" )
598+             if  _get_bool (
599+                 "Do you want to limit how many of these shares you test (for faster results)?" ,
600+                 default = False ,
601+             ):
602+                 testing_limit  =  _get_int (
603+                     "How many combinations would you like to test?" ,
604+                     default = 1000 ,
605+                     minimum = k ,
606+                     maximum = testing_limit ,
607+                 )
596608        shares  =  ShareSet .generate_shares (mnemonic , k , n , passphrase = passphrase )
597609        # test the shares (cap at 1000 combinations) 
598-         print ( "testing combinations..." ) 
599-         iterations   =   0 
600-         for   combo   in   combinations ( shares ,  k ): 
601-              iterations   +=   1 
602-             if  iterations  >  1000 :
610+         print_yellow ( 
611+              "Testing share combinations to be certain they will recover your seed phrase" 
612+         ) 
613+         for   cnt ,  combo   in   enumerate ( combinations ( shares ,  k )): 
614+             if  cnt  >  testing_limit :
603615                break 
604-             elif  iterations  %  10 :
605-                 print ("." , end = "" , flush = True )
606616            calculated  =  ShareSet .recover_mnemonic (combo , passphrase )
607617            if  calculated  !=  mnemonic :
608618                # we should never reach this line 
609619                raise  RuntimeError (f"Bad shares { calculated } { mnemonic }  )
620+             if  cnt  %  10  ==  0 :
621+                 print ("." , end = "" , flush = True )
622+ 
623+         print_yellow (
624+             f"\n Succesfully tested { 'ALL '  if  testing_limit  ==  12870  else  '' } { cnt }  
625+         )
626+ 
610627        print ("\n " )
611628        share_mnemonics  =  "\n \n " .join (shares )
612629        if  passphrase :
0 commit comments