by codeflo · 7y ago · 0 comments
> First check the remainder modulo 10, modulo 9 and modulo 24.
This makes zero sense already. First, 9=3 x 3, so checking for 3 is sufficient. (Checking for 9 might be easier in decimal, but why the hell would you do cryptography in decimal?) Then there’s the 24=2 x 2 x 2 x 3. Again, why not just use 6, but even worse, there’s no new factor here that’s not already covered by 10 and 9.
(And as you mentioned, even if this works, much better primality Tests are readily available.)
(Off-topic: Is there a good way to indicate multiplication on HN? I can’t figure out how to escape asterisks, and Unicode symbols seem to be simply filtered out, which is a bit crazy in 2019.)
Also, they are using the last digit of the number, that I translated to "modulo 10".
Another reason for the translation is that the mathematical structure is more clear in "modulo 10, modulo 9 and modulo 24" than in the version "last digit, nines rule and modulo 24".
In a computer is much more efficient to use modulo that transforming the number to a string and then operating with the digits, so I hope they have an efficient implementation but it is not clear from the pdf.
It isn't. The test is the same in both cases.