-
Notifications
You must be signed in to change notification settings - Fork 404
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
Update LibTomMath to 1.2.0 #84
Conversation
Thanks. I'll investigate the memory leak found at https://travis-ci.org/mkj/dropbear/jobs/602889758#L21324 before merging. |
Has libtommath changed how mp_init allocates memory? It's now leaking the allocation from That's fine for it to exit, but I don't see why it didn't leak previously. I'll dig into it later, but just in case you have any immediate thoughts.
|
after you said |
@mkj thanks. |
@minad maybe you can give some more advice on size optimization of ltm? |
I am unsure as to the reasons of the size changes. Does dropbear use a custom configuration? Generally the optimal size can be achieved by using an amalgamated build with everything unused disabled. This is at least what I did, but it requires quite a bit of effort. |
...also all functions should be marked static in the amalgamated build in order for the optimizer to do its best. But lto or thin-lto with function sections will get you almost there too. |
well, sorry, I did compare ltm 1.2.0 with 2019.78 release state, not with previous state (1.1.0). btw, libtommath uses own rand routines inside mp_rand, maybe hook it into dropbear's genrandom() and disable s_mp_rand_platform() as well? output from https://git.busybox.net/busybox/tree/scripts/bloat-o-meter script:
|
@minad thanks, LTO is likely worthwhile. Also trying Setting |
Enabling @czurnieden we discussed whether it would make sense to provide a second table in |
A short summary for those here who are not familiar with the algorithm: The default test (strong BPSW) uses M-R rounds with bases 2 and 3 at the beginning and one round with a random base at the end if If
The numbers themself are FIPS 186.4 compliant. The correctness of those numbers can be proven if necessary. I think it should be noted that the table is for RSA only, DSA needs much lower errors. I would recommend to use BPSW and additionally set
One cannot be too paranoid with the implementation of cryptography. Borderline clinical is still OK. |
Title says it all