Skip to content

Optimize unfactor scripts in case of repeating factors #6

@Googulator

Description

@Googulator

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions