Skip to content

Commit 885497b

Browse files
committed
add missing gate around Sha256_SetTransform() declaration in wolfcrypt/src/sha256.c;
remove stray definitions of XTRANSFORM*() in wolfcrypt/src/sha512.c; restore global intel_flags in the !WC_NO_INTERNAL_FUNCTION_POINTERS paths of sha256.c and sha512.c; disable test_wolfSSL_dtls_compare_stateless() in tests/api.c when DEBUG_VECTOR_REGISTER_ACCESS_FUZZING (it depends on a stable SHA512 hash of the in-memory struct WOLFSSL image).
1 parent 0566584 commit 885497b

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

tests/api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63548,7 +63548,8 @@ static int test_wolfSSL_dtls_AEAD_limit(void)
6354863548
#endif
6354963549

6355063550
#if defined(WOLFSSL_DTLS) && \
63551-
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(SINGLE_THREADED)
63551+
defined(HAVE_IO_TESTS_DEPENDENCIES) && !defined(SINGLE_THREADED) && \
63552+
!defined(DEBUG_VECTOR_REGISTER_ACCESS_FUZZING)
6355263553
static void test_wolfSSL_dtls_send_ch(WOLFSSL* ssl)
6355363554
{
6355463555
int fd, ret;

wolfcrypt/src/sha256.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,15 @@ on the specific device platform.
232232
(!defined(WOLFSSL_HAVE_PSA) || defined(WOLFSSL_PSA_NO_HASH)) && \
233233
!defined(WOLFSSL_RENESAS_RX64_HASH)
234234

235+
#if defined(WOLFSSL_X86_64_BUILD) && defined(USE_INTEL_SPEEDUP) && (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2))
235236
static void Sha256_SetTransform(
236237
#ifdef WC_C_DYNAMIC_FALLBACK
237238
int *sha_method
238239
#else
239240
void
240241
#endif
241242
);
243+
#endif
242244

243245
static int InitSha256(wc_Sha256* sha256)
244246
{
@@ -594,6 +596,8 @@ static int InitSha256(wc_Sha256* sha256)
594596
}
595597
#define XTRANSFORM_LEN(...) inline_XTRANSFORM_LEN(__VA_ARGS__)
596598

599+
static word32 intel_flags;
600+
597601
static void Sha256_SetTransform(void)
598602
{
599603

wolfcrypt/src/sha512.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ static int InitSha512_256(wc_Sha512* sha512)
574574
return ret;
575575
#undef SHA_METHOD
576576
}
577-
#define XTRANSFORM(...) inline_XTRANSFORM(__VA_ARGS__)
578577

579578
static WC_INLINE int Transform_Sha512_Len(wc_Sha512 *sha512, word32 len) {
580579
#ifdef WC_C_DYNAMIC_FALLBACK
@@ -607,7 +606,6 @@ static int InitSha512_256(wc_Sha512* sha512)
607606
return ret;
608607
#undef SHA_METHOD
609608
}
610-
#define XTRANSFORM_LEN(...) inline_XTRANSFORM_LEN(__VA_ARGS__)
611609

612610
#else /* !WC_NO_INTERNAL_FUNCTION_POINTERS */
613611

@@ -643,6 +641,8 @@ static int InitSha512_256(wc_Sha512* sha512)
643641
return ret;
644642
}
645643

644+
static word32 intel_flags;
645+
646646
static void Sha512_SetTransform(void)
647647
{
648648
if (transform_check)

0 commit comments

Comments
 (0)