Introduce LTC_NOP_TEST()

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel 2026-04-24 13:37:01 +02:00 committed by Karel Miko
parent 45f95768da
commit 811b1a6c14
25 changed files with 28 additions and 116 deletions

View file

@ -76,10 +76,5 @@ int argon2_test(void)
}
#else
int argon2_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(argon2_test)
#endif

View file

@ -136,11 +136,5 @@ int bcrypt_test(void)
}
#else
int bcrypt_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(bcrypt_test)
#endif

View file

@ -9,6 +9,8 @@
Steffen Jaeckel
*/
LTC_NOP_TEST(nop_test)
void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm)
{
if (res != CRYPT_OK) {

View file

@ -50,6 +50,9 @@ typedef void (*dir_cleanup_cb)(void* ctx);
int test_process_dir(const char *path, void *ctx, dir_iter_cb iter, dir_fiter_cb fiter, dir_cleanup_cb cleanup, const char *test);
#endif
int ltc_test_nop(void);
#define LTC_NOP_TEST(n) int n(void) { return CRYPT_NOP; }
void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm);
void print_hex(const char* what, const void* v, const unsigned long l);

View file

@ -3,12 +3,7 @@
#include <tomcrypt_test.h>
#if !defined(LTC_DER)
int der_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(der_test)
#else
#include <wchar.h>

View file

@ -397,10 +397,5 @@ int dh_test(void)
}
#else
int dh_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(dh_test)
#endif

View file

@ -385,10 +385,5 @@ int dsa_test(void)
}
#else
int dsa_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(dsa_test)
#endif

View file

@ -2459,8 +2459,5 @@ int ecc_test(void)
return CRYPT_OK;
}
#else
int ecc_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(ecc_test)
#endif

View file

@ -468,10 +468,5 @@ int ed25519_test(void)
}
#else
int ed25519_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(ed25519_test)
#endif

View file

@ -476,10 +476,5 @@ int ed448_test(void)
}
#else
int ed448_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(ed448_test)
#endif

View file

@ -137,8 +137,5 @@ int mpi_test(void)
return s_radix_to_bin_test();
}
#else
int mpi_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(mpi_test)
#endif

View file

@ -202,10 +202,5 @@ int pem_test(void)
}
#else
int pem_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pem_test)
#endif

View file

@ -59,11 +59,6 @@ int pkcs_1_eme_test(void)
}
#else
int pkcs_1_eme_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pkcs_1_eme_test)
#endif

View file

@ -56,11 +56,6 @@ int pkcs_1_emsa_test(void)
}
#else
int pkcs_1_emsa_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pkcs_1_emsa_test)
#endif

View file

@ -62,11 +62,6 @@ int pkcs_1_oaep_test(void)
}
#else
int pkcs_1_oaep_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pkcs_1_oaep_test)
#endif

View file

@ -66,11 +66,6 @@ int pkcs_1_pss_test(void)
}
#else
int pkcs_1_pss_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pkcs_1_pss_test)
#endif

View file

@ -79,11 +79,6 @@ int pkcs_1_test(void)
}
#else
int pkcs_1_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(pkcs_1_test)
#endif

View file

@ -879,10 +879,5 @@ print_hex("q", tmp, len);
}
#else
int rsa_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(rsa_test)
#endif

View file

@ -97,10 +97,5 @@ int scrypt_test(void)
}
#else
int scrypt_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(scrypt_test)
#endif

View file

@ -95,5 +95,5 @@ int siv_wycheproof_test(void)
}
#else
int siv_wycheproof_test(void) { return CRYPT_NOP; }
LTC_NOP_TEST(siv_wycheproof_test)
#endif

View file

@ -347,10 +347,7 @@ int ssh_test(void)
#else
int ssh_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(ssh_test)
#endif

View file

@ -40,6 +40,7 @@ static const test_function test_functions[] =
LTC_TEST_FN(multi_test),
LTC_TEST_FN(pem_test),
LTC_TEST_FN(deprecated_test),
LTC_TEST_FN(nop_test),
/* keep the prng_test always at the end as
* it has to be handled specially when
* testing with LTC_PTHREAD enabled

View file

@ -51,6 +51,7 @@ int scrypt_test(void);
int no_null_termination_check_test(void);
int pk_oid_test(void);
int deprecated_test(void);
int nop_test(void);
#ifdef LTC_PKCS_1
struct ltc_prng_descriptor* no_prng_desc_get(void);

View file

@ -248,10 +248,5 @@ int x25519_test(void)
}
#else
int x25519_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(x25519_test)
#endif

View file

@ -240,10 +240,5 @@ int x448_test(void)
}
#else
int x448_test(void)
{
return CRYPT_NOP;
}
LTC_NOP_TEST(x448_test)
#endif