Cofactor flag in wolfcrypt test needed a guard.

This commit is contained in:
John Safranek
2021-05-06 11:45:40 -07:00
committed by Daniel Pouzzner
parent f53a4db4e7
commit b00b95ef6c
2 changed files with 6 additions and 2 deletions

View File

@@ -3487,10 +3487,10 @@ AS_CASE([$ENABLED_SELFTEST],
AS_CASE([$SELFTEST_VERSION], AS_CASE([$SELFTEST_VERSION],
["v2"],[ ["v2"],[
AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_SELFTEST_VERSION=2" AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_SELFTEST_VERSION=2 -DHAVE_PUBLIC_FFDHE"
], ],
["v1"],[ ["v1"],[
AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST" AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_PUBLIC_FFDHE"
]) ])

View File

@@ -21312,8 +21312,10 @@ static int ecc_test_cdh_vectors(WC_RNG* rng)
ret = wc_ecc_init_ex(priv_key, HEAP_HINT, devId); ret = wc_ecc_init_ex(priv_key, HEAP_HINT, devId);
if (ret != 0) if (ret != 0)
goto done; goto done;
#ifdef HAVE_ECC_CDH
wc_ecc_set_flags(pub_key, WC_ECC_FLAG_COFACTOR); wc_ecc_set_flags(pub_key, WC_ECC_FLAG_COFACTOR);
wc_ecc_set_flags(priv_key, WC_ECC_FLAG_COFACTOR); wc_ecc_set_flags(priv_key, WC_ECC_FLAG_COFACTOR);
#endif
ret = wc_ecc_import_raw(pub_key, QCAVSx, QCAVSy, NULL, "SECP256R1"); ret = wc_ecc_import_raw(pub_key, QCAVSx, QCAVSy, NULL, "SECP256R1");
if (ret != 0) if (ret != 0)
goto done; goto done;
@@ -21593,7 +21595,9 @@ static int ecc_test_make_pub(WC_RNG* rng)
/* make public key for shared secret */ /* make public key for shared secret */
wc_ecc_init_ex(pub, HEAP_HINT, devId); wc_ecc_init_ex(pub, HEAP_HINT, devId);
ret = wc_ecc_make_key(rng, ECC_KEYGEN_SIZE, pub); ret = wc_ecc_make_key(rng, ECC_KEYGEN_SIZE, pub);
#ifdef HAVE_ECC_CDH
wc_ecc_set_flags(key, WC_ECC_FLAG_COFACTOR); wc_ecc_set_flags(key, WC_ECC_FLAG_COFACTOR);
#endif
#if defined(WOLFSSL_ASYNC_CRYPT) #if defined(WOLFSSL_ASYNC_CRYPT)
ret = wc_AsyncWait(ret, &pub->asyncDev, WC_ASYNC_FLAG_NONE); ret = wc_AsyncWait(ret, &pub->asyncDev, WC_ASYNC_FLAG_NONE);
#endif #endif