Co-dfns / mystika

High-end Cryptographic Library
GNU Affero General Public License v3.0
43 stars 26 forks source link

dot, out, and red added #53

Closed Tikhon03 closed 7 years ago

Tikhon03 commented 7 years ago

I made a slight change in the behavior of add and sub because it seemed more natural in my implementation of red. That is to say that the bias is toward complete carrying: red is implemented so that partial carrying is done everywhere except possibly in the last step.

arcfide commented 7 years ago

I fixed a bit of whitespace and I'm looking over the tests. I can't accept this PR at the moment because red is incorrect. In fact, none of red, out, or dot appear to be correct. In particular, they should not work on noble or matrix bignum arrays. Furthermore, I'm confused as to why dot works at all, and don't believe that partial carrying is being properly preserved here.

Tikhon03 commented 7 years ago

I have revised dot in a way that I expect to run faster on your compiler. It turns out the original implementation worked correctly even for -.×, but it is slower. You will see that I added two new tests to check for -.×.