TeslaCrack icon indicating copy to clipboard operation
TeslaCrack copied to clipboard

Optimize unfactor scripts in case of repeating factors

Open Googulator opened this issue 9 years ago • 0 comments

For non-squarefree keys (ones with the same factor multiple times), the unfactor scripts waste resources by trying the same key multiple times.

E.g. having "2 2 2" on the command line, there are only 4 possible combinations (1, 2, 4, 8), but unfactor.py will treat each factor as different, and will try (1, 2, 2, 2, 4, 4, 4, 8) as possible keys, and it only gets worse with more repetitions.

Unfactor-ecdsa.py already has some optimization (it will do the EC math only once for each real key candidate), but things can still slow down significantly if the key is e.g. a power of 3.

Googulator avatar Dec 26 '15 23:12 Googulator