Skip to content
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

Fix ESP32 HW ED25519 test #5997

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,26 @@ int esp_CryptHwMutexUnLock(wolfSSL_Mutex* mutex);
ESP32_SHA_INIT = 0,
ESP32_SHA_HW = 1,
ESP32_SHA_SW = 2,
ESP32_SHA_FAIL_NEED_UNROLL = -1
ESP32_SHA_FAIL_NEED_UNROLL = 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If -1 worked consider reverting this change.

} ESP32_MODE;

typedef struct {
byte isfirstblock;

/* NOTE:
**
** There's a known Espressif byte alignment issue. See:
** https://github.com/wolfSSL/wolfssl/issues/5948
**
** To avoid problems, list the largest types first.
*/
ESP32_MODE mode; /* typically 0 init, 1 HW, 2 SW */

/* we'll keep track of our own locks.
* actual enable/disable only occurs for ref_counts[periph] == 0 */
int lockDepth; /* see ref_counts[periph] in periph_ctrl.c */
/* see esp_rom/include/esp32/rom/sha.h */
enum SHA_TYPE sha_type; /* the Espressif type: SHA1, SHA256, etc.*/

enum SHA_TYPE sha_type;
/* we'll keep track of our own locks.
** actual enable/disable only occurs for ref_counts[periph] == 0 */
int lockDepth; /* see ref_counts[periph] in periph_ctrl.c */
byte isfirstblock; /* 0 is not first block; 1 = is first block */
} WC_ESP32SHA;

int esp_sha_try_hw_lock(WC_ESP32SHA* ctx);
Expand Down