Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Coverage for hpke.c test case HAVE_CURVE448 using test.c #7570

Merged
merged 3 commits into from
May 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27625,6 +27625,22 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void)
#endif
#endif

/* added this code to hit code coverage on lines 219-225 on hpke.c*/
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved
#if defined(HAVE_CURVE448) && \
(defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512))
/* have_curve448 */
ret = wc_HpkeInit(hpke, DHKEM_X448_HKDF_SHA512, HKDF_SHA512,
HPKE_AES_128_GCM, NULL);
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved
printf("ERROR RIGHT HERE %d\n",ret);
dgarske marked this conversation as resolved.
Show resolved Hide resolved
if (ret == 0)
return WC_TEST_RET_ENC_EC(ret);

ret = hpke_test_single(hpke);
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved

if (ret == 0)
return ret;
#endif

#if defined(HAVE_CURVE25519)
/* test with curve25519 and aes256 */
ret = wc_HpkeInit(hpke, DHKEM_X25519_HKDF_SHA256, HKDF_SHA256,
Expand Down