diff --git a/wolfcrypt/src/md5.c b/wolfcrypt/src/md5.c index 5adce43d4..ad0ea18f7 100644 --- a/wolfcrypt/src/md5.c +++ b/wolfcrypt/src/md5.c @@ -255,6 +255,9 @@ static int _InitMd5(wc_Md5* md5) md5->buffLen = 0; md5->loLen = 0; md5->hiLen = 0; +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + md5->flags = 0; +#endif return ret; } diff --git a/wolfcrypt/src/port/arm/armv8-sha512.c b/wolfcrypt/src/port/arm/armv8-sha512.c index a272d466e..eab85863d 100644 --- a/wolfcrypt/src/port/arm/armv8-sha512.c +++ b/wolfcrypt/src/port/arm/armv8-sha512.c @@ -61,6 +61,9 @@ static int InitSha512(wc_Sha512* sha512) sha512->buffLen = 0; sha512->loLen = 0; sha512->hiLen = 0; +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha512->flags = 0; +#endif return 0; } @@ -501,6 +504,9 @@ static int InitSha384(wc_Sha384* sha384) sha384->buffLen = 0; sha384->loLen = 0; sha384->hiLen = 0; +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha384->flags = 0; +#endif return 0; } diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index 7e2be2576..e35253b1d 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -298,6 +298,9 @@ sha->buffLen = 0; sha->loLen = 0; sha->hiLen = 0; + #if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha->flags = 0; + #endif return ret; } diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 059f224a7..ea43f43c0 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -184,6 +184,9 @@ static int InitSha256(wc_Sha256* sha256) sha256->buffLen = 0; sha256->loLen = 0; sha256->hiLen = 0; +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha256->flags = 0; +#endif return ret; } @@ -1198,6 +1201,9 @@ static int InitSha256(wc_Sha256* sha256) /* choose best Transform function under this runtime environment */ Sha256_SetTransform(); #endif + #if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha224->flags = 0; + #endif return ret; } diff --git a/wolfcrypt/src/sha3.c b/wolfcrypt/src/sha3.c index 3737411a8..9f045426c 100644 --- a/wolfcrypt/src/sha3.c +++ b/wolfcrypt/src/sha3.c @@ -570,6 +570,9 @@ static int InitSha3(wc_Sha3* sha3) for (i = 0; i < 25; i++) sha3->s[i] = 0; sha3->i = 0; +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha3->flags = 0; +#endif return 0; } diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index f327df978..885200cff 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -224,6 +224,9 @@ static int InitSha512(wc_Sha512* sha512) * whether using HW or SW is detemined at first call of update() */ sha512->ctx.mode = ESP32_SHA_INIT; +#endif +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha512->flags = 0; #endif return 0; } @@ -934,6 +937,9 @@ static int InitSha384(wc_Sha384* sha384) */ sha384->ctx.mode = ESP32_SHA_INIT; +#endif +#if defined(WOLFSSL_HASH_FLAGS) || defined(WOLF_CRYPTO_CB) + sha384->flags = 0; #endif return 0;