Espressif ESP32 Hardware Acceleration Update and Cleanup#5326
Merged
dgarske merged 7 commits intowolfSSL:masterfrom Jul 21, 2022
Merged
Espressif ESP32 Hardware Acceleration Update and Cleanup#5326dgarske merged 7 commits intowolfSSL:masterfrom
dgarske merged 7 commits intowolfSSL:masterfrom
Conversation
dgarske
requested changes
Jul 6, 2022
Contributor
dgarske
left a comment
There was a problem hiding this comment.
Note we are in release code freeze. Please coordinate with Jacob is you want this in the release... it might be possible.
| # | ||
| # Copyright (C) 2014-2022 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfSSH. |
Contributor
There was a problem hiding this comment.
wolfSSL. Use the license header from wolfSSL, not wolfSSH.
Contributor
Author
There was a problem hiding this comment.
good catch! updated.
| # | ||
| # Copyright (C) 2014-2022 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfSSH. |
|
|
||
| #define __ESP32_CRYPT_H__ | ||
|
|
||
| #ifdef WOLFSSL_USER_SETTINGS |
Contributor
There was a problem hiding this comment.
Please include wolfssl/wolfcrypt/settings.h always instead. It does this logic at top and ensures build options checks are done.
Contributor
Author
There was a problem hiding this comment.
that's good to know, thanks. fixed.
dgarske
approved these changes
Jul 21, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR updates the Espressif hardware acceleration code, mostly surrounding SHA2.
There's a new
ctx.lockDepththat keeps track of RTOS calls that lock the hardware for exclusive use. This was implemented as the Espressif lib does not properly trackref_counts[periph]in periph_ctrl.c, specifically periph_module_enable and periph_module_disable. If/when RTOS unexpected failures occur, there's a newesp_unroll_sha_module_enableto facilitate returning the peripheral to a known enabled state for the givenctxobject.The
esp_sha_hw_lockandesp_sha_hw_unlocknow take actxparameter.Instead of assuming exact location in memory space (e.g. for hardware support on newer chipsets that may rearrange things, particularly on architecture change between Xtensa and RISC-V) - there's now a
switchstatement with reference to HW memory macros instead of a hard-coded address parameter value. For example, seeesp_sha_start_processusingsha->sha_typeSome preliminary
CMakeFilechanges were implemented to address some of the breaking changes between ESP-IDF V4 and the new V5.x . Additional work is needed to fully support V5.Various other code cleanup, formatting, and commenting.
This is an interim PR with additional changes and additions planned with other hardware acceleration.
Fixes zd# (n/a)
Testing
Confirmed to be working with latest SSH to UART project. There should probably be more robust tests created in a future PR to actually compare HW & SW results and report success/failure.
Checklist