-
Notifications
You must be signed in to change notification settings - Fork 216
Remove support for 8-bit (MP_8BIT) #349
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the general sentiment here. 8 bit needs way too many special cases.
I think the comments mention 7 bits at some places too. We should probably also remove MP_31BIT which is special. But if we do that we should probably discuss the pros and cons a bit.
If the algorithms work at different bit lenghts, we can trust them a bit more and it is ensured that no bit length dependent constants sneaked in. Then there is also the case with microcontrollers. Is ltm used there with MP_8BIT? If we focus on more powerful platforms, why keep MP_16BIT? Only keep 64 and 32?
|
Hmm, what I would prefer even more than removing support is, if we could get rid of the MP_8BIT special casing and all the algorithms would just work for each size. But this might be fantasy ;) |
|
I'd say we deprecate it for 1.2.0 as proposed by a warning sign only and then merge this after 1.2.0 is released. |
Not much of a problem, more or less only with the comba multiplier.
Yes, we could do it. A lot of work but doable. But we get into one large problem here: the Lucas-Selfridge algorithm does not work with 8-bit, that's why the prime-test uses Frobenius-Underwood in that case. The BPSW algorithm is well analysed (and tested) with Lucas-Selfridge but not with Frobenius-Underwood. The intersection is quite large (that's why it is an alternative in this PR instead of using both. I even thought about removing F-U completely) but I'm very conservative in regards to cryptographic code and always prefer the well tested. Also: yes, we can use the fixed/min width types from But as said in another PR: I try to get my hands on hardware and ask in the forums. Forums
A lot of the 16-bit MCUs (and old CPUs) have enough memory (Flash and RAM) to run a stripped down LTM; some can even run a full version of LTM. Support of 16-bit is also no problem in contrast to 8-bit which is a real pain in the behind (
Yepp, sounds good to me. |
cdbdeed to
5cb1e2e
Compare
|
@minad flagging does not cause an email to me (or I misconfigured something here), it is quicker if you just |
5cb1e2e to
b5a39fe
Compare
|
lulz sorry @czurnieden I force-pushed over your rebase :) |
Your mean that I could have got me another coffee instead of fiddling with the merge conflicts? |
yep :-) |
Removed, not only deprecated, removed support for 8-bit (MP_8BIT).
Deprecating was not really possible besides a simple
at the top of
tommath.h.I went through it with a fine comb but still might have missed some, please check.
If that is OK with you: there is also need for an "Issue" to announce it a bit more official and an entry in the Wiki. Both can only be done after the merge, of course, but should not be forgotten.