-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Memory optimization #4107
Memory optimization #4107
Conversation
My suggestion is
I don't have a strong opinion on blake256, as it only saves a few hundred bytes. I'm not sure if it is worth diverging from the original implementation. What do you think @andrewkozlik , @matejcik ? |
|
+1 for keeping blake2s speed optimized, at least on F4 based models. |
agreed
let's keep the original then. please go ahead and modify the PR accordingly. |
There are two things I'm considering:
Any opinion, @andrewkozlik ? |
|
Any update on ripemd160? |
I didn't succeed in optimizing it myself. However a found this implementation which is 1792 B in size and has decent speed. I added all the values to the table above. |
I am slightly in favor of replacing the RIPEMD implementation too with the one you found. |
fc11dfa
to
799320e
Compare
As I mentioned earlier, I think it would be good have the That means we will need to add
|
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.
Please set OPTIMIZE_SIZE_BLAKE2S
to 0 somewhere for the FW build.
Other than that, high level ACK and blake2s/blake2b ACK from me.
I haven't reviewed the details the Groestl refactor and the new RIPEMD implementation. @M1nd3r please have a look at groestl.c and ripemd160.c.
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 have reviewed groestl and ripemd160, looks good.
7b9d676
to
a3e1281
Compare
Solves #4079.
In this pull request, I optimized the implementations of blak256, blake2s, blake2b, groestl and AES in terms of flash size.
It's strange that it is possible to reduce the size of AES by half with only minimal impact on its speed.
There are still two places that would make sense to optimize, but I haven't addressed them yet:
EDITED: I fixed the "Size before" of AES, which should have been 20480 B higher.