Skip to content

Commit 1a4643a

Browse files
committed
CRYPTO_CB_ONLY_SHA256: fix: guard Sha256FinalRaw under CB_ONLY_SHA256
1 parent 739c629 commit 1a4643a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

wolfcrypt/src/sha256.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data,
17931793

17941794
#if !defined(WOLFSSL_KCAPI_HASH)
17951795

1796-
#ifndef WOLFSSL_NO_HASH_RAW
1796+
#ifndef WOLF_CRYPTO_CB_ONLY_SHA256
17971797
int wc_Sha256FinalRaw(wc_Sha256* sha256, byte* hash)
17981798
{
17991799
#ifdef LITTLE_ENDIAN_ORDER
@@ -1817,7 +1817,7 @@ static WC_INLINE int Transform_Sha256_Len(wc_Sha256* sha256, const byte* data,
18171817

18181818
return 0;
18191819
}
1820-
#endif /* !WOLFSSL_NO_HASH_RAW */
1820+
#endif /* !WOLF_CRYPTO_CB_ONLY_SHA256 */
18211821

18221822
int wc_Sha256Final(wc_Sha256* sha256, byte* hash)
18231823
{

wolfssl/wolfcrypt/sha256.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ WOLFSSL_API int wc_InitSha256(wc_Sha256* sha);
262262
WOLFSSL_API int wc_InitSha256_ex(wc_Sha256* sha, void* heap, int devId);
263263
WOLFSSL_API int wc_Sha256Update(wc_Sha256* sha, const byte* data, word32 len);
264264

265-
#if !defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_AFALG_HASH)
265+
#if !defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_AFALG_HASH) && \
266+
!defined(WOLF_CRYPTO_CB_ONLY_SHA256)
266267
WOLFSSL_API int wc_Sha256FinalRaw(wc_Sha256* sha256, byte* hash);
267268
#endif
268269
WOLFSSL_API int wc_Sha256Final(wc_Sha256* sha256, byte* hash);

0 commit comments

Comments
 (0)