diff options
Diffstat (limited to 'tests/test-ecdsa.c')
-rw-r--r-- | tests/test-ecdsa.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test-ecdsa.c b/tests/test-ecdsa.c index e940498..4a0a361 100644 --- a/tests/test-ecdsa.c +++ b/tests/test-ecdsa.c @@ -46,10 +46,7 @@ #include <stdio.h> #include <stdint.h> -#include <stdlib.h> #include <string.h> -#include <assert.h> -#include <errno.h> #include <sys/time.h> @@ -285,7 +282,7 @@ static void _time_check(const struct timeval t0, const int ok) struct timeval t; gettimeofday(&t, NULL); t.tv_sec -= t0.tv_sec; - t.tv_usec = t0.tv_usec; + t.tv_usec -= t0.tv_usec; if (t.tv_usec < 0) { t.tv_usec += 1000000; t.tv_sec -= 1; @@ -327,11 +324,13 @@ int main(int argc, char *argv[]) int ok = 1; +#if HAL_ECDSA_DEBUG_ONLY_STATIC_TEST_VECTOR_RANDOM /* * Test vectors (where we have them). */ for (int i = 0; i < sizeof(ecdsa_tc)/sizeof(*ecdsa_tc); i++) time_check(test_against_static_vectors(&ecdsa_tc[i])); +#endif /* * Generate/sign/verify test for each curve. |