Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and speed up detection algorithm #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcan
Copy link

@marcan marcan commented Oct 23, 2017

Proof of equivalence:
https://gist.github.com/marcan/bbbc229f27ad4de0a43a2df175d5c8c4

The above code tests all possible residues for all primes in the original implementation against the new one. The only discrepancies are for the class of moduli with small prime factors (residue=0). These would be previously reported as not vulnerable (although they are obviously trivially factorizable and completely broken), while the new code will report them as vulnerable if they have a small prime factor not present in the new test list but also have the residues expected of an Infineon-generated modulus. This is obviously a good thing, as such keys are even more broken and trivially factorizable.

Passes unit tests.

Proof of equivalence:
https://gist.github.com/marcan/bbbc229f27ad4de0a43a2df175d5c8c4

Discrepancies at residue=0 are expected; these only potentially
alter the result for moduli with small prime factors from negative
(safe) to positive (unsafe), which is fine since those keys are
unsafe anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant