@@ -1140,19 +1140,23 @@ def __init__(self, arg_derivationpath: Optional[List[str]] = None, loading: bool
1140
1140
1141
1141
self ._path_indexes .append (current_path_indexes )
1142
1142
1143
+ def _get_pps_divisor (self ) -> float :
1144
+ return 1.0
1145
+
1143
1146
def passwords_per_seconds (self , seconds : float ) -> int :
1144
1147
if not self ._passwords_per_second :
1145
1148
scalar_multiplies = 0
1146
- for i in self ._path_indexes [0 ]: # Just use the first derivation path for this...
1147
- if i < 2147483648 : # if it's a normal child key
1149
+ for i in self ._path_indexes [0 ]: # Just use the first derivation path for this...
1150
+ if i < 2147483648 : # if it's a normal child key
1148
1151
scalar_multiplies += 1 # then it requires a scalar multiply
1149
1152
if not self ._chaincode :
1150
1153
scalar_multiplies += self ._addrs_to_generate + 1 # each addr. to generate req. a scalar multiply
1151
1154
self ._passwords_per_second = \
1152
1155
calc_passwords_per_second (self ._checksum_ratio , self ._kdf_overhead , scalar_multiplies )
1153
1156
passwords_per_second = max (int (round (self ._passwords_per_second * seconds )), 1 )
1154
1157
# Divide the speed by however many passphrases we are testing for each seed (Otherwise the benchmarking step takes ages)
1155
- return int (passwords_per_second / len (self ._derivation_salts ))
1158
+ divisor = len (self ._derivation_salts ) * self ._get_pps_divisor ()
1159
+ return int (passwords_per_second / divisor ) if divisor else passwords_per_second
1156
1160
1157
1161
1158
1162
@@ -2375,19 +2379,8 @@ def create_from_params(cls, *args, **kwargs):
2375
2379
self = super (WalletCardano , cls ).create_from_params (* args , ** kwargs )
2376
2380
return self
2377
2381
2378
- def passwords_per_seconds (self , seconds ):
2379
- if not self ._passwords_per_second :
2380
- scalar_multiplies = 0
2381
- for i in self ._path_indexes [0 ]: # Just use the first derivation path for this...
2382
- if i < 2147483648 : # if it's a normal child key
2383
- scalar_multiplies += 1 # then it requires a scalar multiply
2384
- if not self ._chaincode :
2385
- scalar_multiplies += self ._addrs_to_generate + 1 # each addr. to generate req. a scalar multiply
2386
- self ._passwords_per_second = \
2387
- calc_passwords_per_second (self ._checksum_ratio , self ._kdf_overhead , scalar_multiplies )
2388
- passwords_per_second = max (int (round (self ._passwords_per_second * seconds )), 1 )
2389
- # Divide the speed by however many passphrases we are testing for each seed (Otherwise the benchmarking step takes ages)
2390
- return passwords_per_second / len (self ._derivation_salts ) / 5
2382
+ def _get_pps_divisor (self ) -> float :
2383
+ return 5.0
2391
2384
2392
2385
@staticmethod
2393
2386
def _addresses_to_hash160s (addresses ):
@@ -2620,22 +2613,13 @@ def create_from_params(cls, *args, **kwargs):
2620
2613
self = super (WalletPyCryptoHDWallet , cls ).create_from_params (* args , ** kwargs )
2621
2614
return self
2622
2615
2623
- def passwords_per_seconds (self , seconds ):
2616
+ def _get_pps_divisor (self ) -> float :
2617
+ return 10.0
2618
+
2619
+ def passwords_per_seconds (self , seconds : float ) -> int :
2624
2620
if self .opencl :
2625
2621
exit ("Error: Wallet Type does not support OpenCL acceleration" )
2626
-
2627
- if not self ._passwords_per_second :
2628
- scalar_multiplies = 0
2629
- for i in self ._path_indexes [0 ]: # Just use the first derivation path for this...
2630
- if i < 2147483648 : # if it's a normal child key
2631
- scalar_multiplies += 1 # then it requires a scalar multiply
2632
- if not self ._chaincode :
2633
- scalar_multiplies += self ._addrs_to_generate + 1 # each addr. to generate req. a scalar multiply
2634
- self ._passwords_per_second = \
2635
- calc_passwords_per_second (self ._checksum_ratio , self ._kdf_overhead , scalar_multiplies )
2636
- passwords_per_second = max (int (round (self ._passwords_per_second * seconds )), 1 )
2637
- # Divide the speed by however many passphrases we are testing for each seed (Otherwise the benchmarking step takes ages)
2638
- return passwords_per_second / len (self ._derivation_salts ) / 10
2622
+ return super ().passwords_per_seconds (seconds )
2639
2623
2640
2624
# Default method for adding addresses, doesn't worry about validating the addresses
2641
2625
@staticmethod
0 commit comments