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 all commits
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
18 changes: 16 additions & 2 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27625,10 +27625,24 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t hpke_test(void)
#endif
#endif

/* Test coverage for wc_HpkeInit with Curve448, even though it is not supported */
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved
#if defined(HAVE_CURVE448) && \
(defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512))
/* test with_curve448 */
ret = wc_HpkeInit(hpke, DHKEM_X448_HKDF_SHA512, HKDF_SHA512,
HPKE_AES_256_GCM, NULL);
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved

dgarske marked this conversation as resolved.
Show resolved Hide resolved
if (ret != BAD_FUNC_ARG) /* Curve448 is not supported yet */
ret = WC_TEST_RET_ENC_EC(ret);
else
ret = 0;
jackctj117 marked this conversation as resolved.
Show resolved Hide resolved
#endif

#if defined(HAVE_CURVE25519)
/* test with curve25519 and aes256 */
ret = wc_HpkeInit(hpke, DHKEM_X25519_HKDF_SHA256, HKDF_SHA256,
HPKE_AES_256_GCM, NULL);
if (ret == 0)
ret = wc_HpkeInit(hpke, DHKEM_X25519_HKDF_SHA256, HKDF_SHA256,
HPKE_AES_256_GCM, NULL);

if (ret != 0)
return WC_TEST_RET_ENC_EC(ret);
Expand Down