Move ECJPAKE_TEST_SET_PASSWORD into ssl_helpers.h

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
diff --git a/tests/include/test/ssl_helpers.h b/tests/include/test/ssl_helpers.h
index fecfad9..eb89d19 100644
--- a/tests/include/test/ssl_helpers.h
+++ b/tests/include/test/ssl_helpers.h
@@ -523,6 +523,22 @@
     unsigned char *buf, unsigned char **end, int tweak,
     int *expected_result, mbedtls_ssl_chk_buf_ptr_args *args);
 #endif /* MBEDTLS_TEST_HOOKS */
+
+#define ECJPAKE_TEST_PWD        "bla"
+
+#if defined(MBEDTLS_USE_PSA_CRYPTO)
+#define ECJPAKE_TEST_SET_PASSWORD(exp_ret_val)                            \
+    ret = (use_opaque_arg) ?                                              \
+          mbedtls_ssl_set_hs_ecjpake_password_opaque(&ssl, pwd_slot) :    \
+          mbedtls_ssl_set_hs_ecjpake_password(&ssl, pwd_string, pwd_len); \
+    TEST_EQUAL(ret, exp_ret_val)
+#else
+#define ECJPAKE_TEST_SET_PASSWORD(exp_ret_val)                            \
+    ret = mbedtls_ssl_set_hs_ecjpake_password(&ssl,                       \
+                                              pwd_string, pwd_len);       \
+    TEST_EQUAL(ret, exp_ret_val)
+#endif /* MBEDTLS_USE_PSA_CRYPTO */
+
 #endif /* MBEDTLS_SSL_TLS_C */
 
 #endif /* SSL_HELPERS_H */
diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function
index 7edfb27..2babbc6 100644
--- a/tests/suites/test_suite_ssl.function
+++ b/tests/suites/test_suite_ssl.function
@@ -31,21 +31,6 @@
 #undef MBEDTLS_SSL_TLS1_3_LABEL
 };
 
-#define ECJPAKE_TEST_PWD        "bla"
-
-#if defined(MBEDTLS_USE_PSA_CRYPTO)
-#define ECJPAKE_TEST_SET_PASSWORD(exp_ret_val)                          \
-    ret = (use_opaque_arg) ?                                            \
-          mbedtls_ssl_set_hs_ecjpake_password_opaque(&ssl, pwd_slot) :    \
-          mbedtls_ssl_set_hs_ecjpake_password(&ssl, pwd_string, pwd_len); \
-    TEST_EQUAL(ret, exp_ret_val)
-#else
-#define ECJPAKE_TEST_SET_PASSWORD(exp_ret_val)                \
-    ret = mbedtls_ssl_set_hs_ecjpake_password(&ssl,            \
-                                              pwd_string, pwd_len);  \
-    TEST_EQUAL(ret, exp_ret_val)
-#endif
-
 #define TEST_AVAILABLE_ECC(tls_id_, group_id_, psa_family_, psa_bits_)   \
     TEST_EQUAL(mbedtls_ssl_get_ecp_group_id_from_tls_id(tls_id_),       \
                group_id_);                                           \