fix typo, add macro guard, remove dead code path

This commit is contained in:
Jacob Barthelmeh
2022-03-04 10:49:11 -07:00
parent d1212f9247
commit a4a4bdc20f
2 changed files with 7 additions and 7 deletions

View File

@ -6454,11 +6454,7 @@ int wc_ecc_gen_deterministic_k(const byte* hash, word32 hashSz,
if (ret == 0) {
int sz;
sz = (qLen - xSz < VSz) ? qLen-xSz : VSz;
if (xSz + sz > qLen) {
ret = BUFFER_E;
break;
}
sz = MIN(qLen - xSz, VSz);
XMEMCPY(x + xSz, V, sz);
xSz += sz;
}

View File

@ -20875,6 +20875,7 @@ done:
}
#ifdef WOLFSSL_PUBLIC_MP
#if defined(HAVE_ECC384)
/* KAT from RFC6979 */
static int ecc384_test_deterministic_k(WC_RNG* rng)
{
@ -20945,10 +20946,11 @@ done:
wc_ecc_free(&key);
return ret;
}
#endif /* HAVE_ECC384 */
#if defined(HAVE_ECC521)
/* KAT from RFC6979 */
static int ecc512_test_deterministic_k(WC_RNG* rng)
static int ecc521_test_deterministic_k(WC_RNG* rng)
{
int ret;
ecc_key key;
@ -23965,13 +23967,15 @@ WOLFSSL_TEST_SUBROUTINE int ecc_test(void)
goto done;
}
#ifdef WOLFSSL_PUBLIC_MP
#if defined(HAVE_ECC384)
ret = ecc384_test_deterministic_k(&rng);
if (ret != 0) {
printf("ecc384_test_deterministic_k failed! %d\n", ret);
goto done;
}
#endif
#if defined(HAVE_ECC521)
ret = ecc512_test_deterministic_k(&rng);
ret = ecc521_test_deterministic_k(&rng);
if (ret != 0) {
printf("ecc512_test_deterministic_k failed! %d\n", ret);
goto done;