From 53d6e79f89651a77d2e63f4a0fe73ac03b38ce03 Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Mon, 30 Jan 2023 16:58:57 -0800 Subject: [PATCH] ESP32 SHA384 fixes --- wolfcrypt/src/port/Espressif/esp32_sha.c | 3 +-- wolfcrypt/src/sha512.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/port/Espressif/esp32_sha.c b/wolfcrypt/src/port/Espressif/esp32_sha.c index 7a51fc6c25..257a715287 100644 --- a/wolfcrypt/src/port/Espressif/esp32_sha.c +++ b/wolfcrypt/src/port/Espressif/esp32_sha.c @@ -507,8 +507,7 @@ int wc_esp_digest_state(WC_ESP32SHA* ctx, byte* hash) #if defined(WOLFSSL_SHA384) case SHA2_384: - SHA_LOAD_REG = SHA_384_LOAD_REG; - SHA_BUSY_REG = SHA_384_BUSY_REG; + DPORT_REG_WRITE(SHA_384_LOAD_REG, 1); break; #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index b62fbc1bb7..118a82bfab 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -1306,7 +1306,7 @@ static int InitSha384(wc_Sha384* sha384) sha384->ctx.isfirstblock = 1; if(sha384->ctx.mode == ESP32_SHA_HW) { /* release hw */ - esp_sha_hw_unlock(&(sha512->ctx)); + esp_sha_hw_unlock(&(sha384->ctx)); } /* always set mode as INIT * whether using HW or SW is determined at first call of update()