test.c:ecc_test_curve_size(): use a macro, not a static const size_t, for size of exportBuf, to make MS Visual Studio happy.

This commit is contained in:
Daniel Pouzzner
2020-11-26 01:59:17 -06:00
parent 89e6b1eebc
commit f7bf0a78fb

View File

@ -19935,8 +19935,8 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
DECLARE_VAR(sharedB, byte, ECC_SHARED_SIZE, HEAP_HINT);
#endif
#ifdef HAVE_ECC_KEY_EXPORT
static const size_t exportBufSize = MAX_ECC_BYTES * 2 + 32;
DECLARE_VAR(exportBuf, byte, exportBufSize, HEAP_HINT);
#define ECC_KEY_EXPORT_BUF_SIZE (MAX_ECC_BYTES * 2 + 32)
DECLARE_VAR(exportBuf, byte, ECC_KEY_EXPORT_BUF_SIZE, HEAP_HINT);
#endif
word32 x = 0;
#if (defined(HAVE_ECC_DHE) || defined(HAVE_ECC_CDH)) && \
@ -20142,7 +20142,7 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
#endif /* WOLFSSL_ATECC508A */
#ifdef HAVE_ECC_KEY_EXPORT
x = exportBufSize;
x = ECC_KEY_EXPORT_BUF_SIZE;
ret = wc_ecc_export_x963_ex(userA, exportBuf, &x, 0);
if (ret != 0)
goto done;
@ -20178,7 +20178,7 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
#ifdef HAVE_COMP_KEY
/* try compressed export / import too */
x = exportBufSize;
x = ECC_KEY_EXPORT_BUF_SIZE;
ret = wc_ecc_export_x963_ex(userA, exportBuf, &x, 1);
if (ret != 0)
goto done;
@ -20301,7 +20301,7 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
#if defined(HAVE_ECC_KEY_EXPORT) && !defined(WOLFSSL_ATECC508) && \
!defined(WOLFSSL_ATECC608A)
x = exportBufSize;
x = ECC_KEY_EXPORT_BUF_SIZE;
ret = wc_ecc_export_private_only(userA, exportBuf, &x);
if (ret != 0)
goto done;