diff --git a/.cirrus.yml b/.cirrus.yml index aabfea226fbcc..258bfab6884a6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -40,8 +40,8 @@ cat_logs_snippet: &CAT_LOGS - cat noverify_tests.log || true cat_exhaustive_tests_log_script: - cat exhaustive_tests.log || true - cat_valgrind_ctime_test_log_script: - - cat valgrind_ctime_test.log || true + cat_ctime_tests_log_script: + - cat ctime_tests.log || true cat_bench_log_script: - cat bench.log || true cat_config_log_script: diff --git a/.gitignore b/.gitignore index c68645b9dfa4b..6ef3e2df1f222 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ tests exhaustive_tests precompute_ecmult_gen precompute_ecmult -valgrind_ctime_test +ctime_tests ecdh_example ecdsa_example schnorr_example diff --git a/Makefile.am b/Makefile.am index b592523573617..b7500bc0119a2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -120,10 +120,10 @@ noverify_tests_CPPFLAGS = $(SECP_INCLUDES) $(SECP_TEST_INCLUDES) $(SECP_CONFIG_D noverify_tests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB) noverify_tests_LDFLAGS = -static if VALGRIND_ENABLED -noinst_PROGRAMS += valgrind_ctime_test -valgrind_ctime_test_SOURCES = src/valgrind_ctime_test.c -valgrind_ctime_test_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB) -valgrind_ctime_test_CPPFLAGS = $(SECP_CONFIG_DEFINES) +noinst_PROGRAMS += ctime_tests +ctime_tests_SOURCES = src/ctime_tests.c +ctime_tests_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB) +ctime_tests_CPPFLAGS = $(SECP_CONFIG_DEFINES) endif if !ENABLE_COVERAGE TESTS += tests diff --git a/ci/cirrus.sh b/ci/cirrus.sh index 80ce8f27f2b28..814c4c937940e 100755 --- a/ci/cirrus.sh +++ b/ci/cirrus.sh @@ -95,7 +95,7 @@ fi if [ "$CTIMETEST" = "yes" ] then - ./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1 + ./libtool --mode=execute valgrind --error-exitcode=42 ./ctime_tests > ctime_tests.log 2>&1 fi # Rebuild precomputed files (if not cross-compiling). diff --git a/doc/safegcd_implementation.md b/doc/safegcd_implementation.md index 063aa8efae05a..5216231e53a87 100644 --- a/doc/safegcd_implementation.md +++ b/doc/safegcd_implementation.md @@ -410,7 +410,7 @@ sufficient even. Given that every loop iteration performs *N* divsteps, it will To deal with the branches in `divsteps_n_matrix` we will replace them with constant-time bitwise operations (and hope the C compiler isn't smart enough to turn them back into branches; see -`valgrind_ctime_test.c` for automated tests that this isn't the case). To do so, observe that a +`ctime_tests.c` for automated tests that this isn't the case). To do so, observe that a divstep can be written instead as (compare to the inner loop of `gcd` in section 1). ```python diff --git a/src/valgrind_ctime_test.c b/src/ctime_tests.c similarity index 99% rename from src/valgrind_ctime_test.c rename to src/ctime_tests.c index aad02b6b72206..2b29568676fad 100644 --- a/src/valgrind_ctime_test.c +++ b/src/ctime_tests.c @@ -39,7 +39,7 @@ int main(void) { if (!SECP256K1_CHECKMEM_RUNNING()) { fprintf(stderr, "Unless compiled under msan, this test can only usefully be run inside valgrind.\n"); - fprintf(stderr, "Usage: libtool --mode=execute valgrind ./valgrind_ctime_test\n"); + fprintf(stderr, "Usage: libtool --mode=execute valgrind ./ctime_tests\n"); return 1; } ctx = secp256k1_context_create(SECP256K1_CONTEXT_DECLASSIFY);