-
Notifications
You must be signed in to change notification settings - Fork 923
Espressif ESP32 Hardware Acceleration Update and Cleanup #5326
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
Conversation
dgarske
left a comment
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.
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. |
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.
wolfSSL. Use the license header from wolfSSL, not wolfSSH.
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.
good catch! updated.
| # | ||
| # Copyright (C) 2014-2022 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfSSH. |
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.
wolfSSL license header.
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.
got it.
|
|
||
| #define __ESP32_CRYPT_H__ | ||
|
|
||
| #ifdef WOLFSSL_USER_SETTINGS |
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 include wolfssl/wolfcrypt/settings.h always instead. It does this logic at top and ensures build options checks are done.
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.
that's good to know, thanks. fixed.
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