-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Move all SSL constants into PROGMEM, free 1.2KB #6162
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
Move all SSL constants into PROGMEM, free 1.2KB #6162
Conversation
Rewrite all the integer math operations with const input parameters to use PROGMEM properly (pgm_read_xx or memcpy_P), and move all the EC order and generators and SHA OIDs to PROGMEM. This frees around 1.2KB of heap for any SSL applications. Also delete unneeded objects from the bearssl.a library to shrink the GIT repo size.
No problems so far using HTTPS updater. |
@TD-er, did you give this PR a test with your app? Anything to report? |
@earlephilhower Nope, haven't tested it, since we currently have no SSL code in use. So I cannot say it will break previous implementations, since we simply have none (yet). |
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.
Nothing jumps out at me.
Undo the BearSSL RODATA->PROGMEM changes because there are some bad performance regressions in EC server operations which can result in timeouts and WDTs. Keep the shrunked bearssl.a library as that is orthogonal to the PROGMEM changes.
Undo the BearSSL RODATA->PROGMEM changes because there are some bad performance regressions in EC server operations which can result in timeouts and WDTs. Keep the shrunked bearssl.a library as that is orthogonal to the PROGMEM changes.
Rewrite all the integer math operations with const input parameters to
use PROGMEM properly (pgm_read_xx or memcpy_P), and move all the EC
order and generators and SHA OIDs to PROGMEM.
This frees around 1.2KB of heap for any SSL applications with no
perceptible speed impact.
Also delete unneeded objects from the bearssl.a library to shrink the
GIT repo size.
This runs everything I've tried without incident, but needs community testing to validate I've covered all the constant use cases