-
Notifications
You must be signed in to change notification settings - Fork 834
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
Esp32s3 support #5950
Esp32s3 support #5950
Conversation
… spaces. Avoid confusing file/directory prompt for default_config_h file that doesn't have an extension.
* SHA acceleration: added guarded implementation, builds, passes some tests * AES acceleration: added guarded implementation, builds, untested * MP acceleration: added guarded implementation, builds, untested
…3 (and ESP32). * esp32-crypt.h - removed ets_sys.h include; not required for ESP32 and breaks ESP32s3 builds. * esp32_sha.c - update wc_esp_digest_state to skip reading digest for first block and correctly decode hash for SHA2_512. * esp32_mp.c fix mul, mulmod, exptmod to pass tests ESP32s3 * random.c - added missing include required to build on Espressif devices when not using hardware acceleration. * aes.c - return error code when setting Aes key if specific algorithms have been disabled (otherwise tests fail). * user_settings.h ** disable ED25519 as it fails test for ESP32 & ESP32s3 ** disable AES-192 as it is not supported on ESP32s3.
Can one of the admins verify this patch? |
When |
(cherry picked from commit c62e539)
Hi @PaulMartinsen I've confirmed your Contributor Agreement has been completed and accepted. I'll be reviewing this PR and #5964 soon. There's a minor conflict with |
Hi @PaulMartinsen I've taken a look at this PR. Several of the wolfssl tests are failing. Some are known to be bad even on the classic ESP32. These can be addressed by disabling SHA512/224 and SHA512/256 and not enabling SHA384:
There's also a problem with I believe the above problems are fixed in my ED25519_SHA2_fix branch. However, I'm seeing other AES192 errors on the ESP32-S3 with HW enabled:
Your help is definitely appreciated. Let me know if you'll be able to fix up the above items, otherwise I can address them in my For reference:
|
Resolved conflict with esp_random import.
Exclude Espressif backup files from git.
Thanks @gojimmypi . I was calling the test routine from a custom program and didn't quite get the
I think this is working now on this branch (that build-in-place really is nice!):
|
With ED25519_SHA2_fix having a number of changes relevant to this PR, would it be better for me to do a PR On that repository so the changes can be combined and incorporated together? |
Hi @PaulMartinsen - Glad to hear you are making good progress! Yes, I think it might be best if we incorporate your changes into the ED25519_SHA2_fix branch. As you noted there are quite a few changes there that fix many things including SHA512/244, SHA512/256 and SHA384. I'm happy to manually merge those changes if you'd like, or a PR works too. I'll take a look at AES as a separate exercise if it is not important for your project. In the case of SHA, more specifically the SHA512/224 that is not supported in hardware acceleration on the ESP32, I have an example of forcing it to software For reference, from docs.espressif: |
Hi @PaulMartinsen you have some very good changes in this PR! Thanks very much for all the time your spent on that. I've merged your changes into my ED25519_SHA2_fix branch. Some things like your aes and mp updates were trivial to add, as I did not have any changes to those. The esp32_sha.c updates were a bit more challenging, as my version is very different from the wolfSSL master branch at this point. I do believe I have everything working. I need to do a little bit of homework, as the SHA384 HW test was failing. For now I have it hard-coded to fall back to SW for the ESP32-S3. According to the screen snip (above) the SHA-384 should be implemented in the silicon. Note that I've updated my user_list.h to now have an
At some point, I'll need to revisit that and fall back to software, rather than just completely disable AES192. Heads up there are also some ESP32-S3 changes in @kareem-wolfssl 's #6146. |
Hi @PaulMartinsen - I think most (all?) of these changes have been implemented and are included in the latest release. Would yo please review and let me know if there's anything outstanding, or if this PR can be closed? Thanks. |
Hi @gojimmypi , I think there's lots of water under the bridge from this one so I think we'll call it complete. |
Description
Added basic support for ESP32s3 hardware acceleration. Addresses part of #5215 . Note: ESP32s3 doesn't support hardware acceleration of AES-192, so this is now disabled in
user_settings.h
.Testing
wolf_test_task();
on both ESP32s3 and ESP32. All tests passing.HAVE_ED25519
is commented out inuser_settings.h
.user_settings.h
have been tested plusWOLFSSL_KEY_GEN
,WOLFSSL_CERT_GEN
,WOLFSSL_CERT_REQ
.Checklist