Skip to content

Simplify and speed up detection algorithm#40

Open
marcan wants to merge 1 commit intocrocs-muni:masterfrom
marcan:master
Open

Simplify and speed up detection algorithm#40
marcan wants to merge 1 commit intocrocs-muni:masterfrom
marcan:master

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.

1 participant