feat(bignum): Add initial bignum hardware acceleration #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is still work in progress.
I've tried to port over most of the code from https://github.com/espressif/esp-idf/blob/b4268c874a4cf8fcf7c0c4153cffb76ad2ddda4e/components/mbedtls/port/bignum/esp_bignum.c
Using espressif's port of mbedtls, we can provide custom implementation for
mpi
operations, using the RSA hardware accelerator.I've only made it work for
esp32s3
with the examplescrypto_self_test
andsync_server
so far.I will fix the compilation for async and other targets and examples when I get this working.
What works:
What doesn't work:
When I use the sync_server example, the RSA verification fails, which I suspect might be something happening with bigger keys, since the self tests only use less than 2048 long keys, while the server uses longer keys.
mbedtls_mpi_mult_mpi_failover_mod_mult()
used to use mod multi for bigger keys seems to be broken too, as the assert fails. I've commented it out, to use the overlong, even if it takes more time, to isolate the issue mentioned above.Building and running
Libraries need to be need to be rebuilt, and the submodule refreshed on existing clones, since I've changed it to use espressif's custom fork.