aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ecdsa.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2015-10-31 22:46:17 -0400
committerPaul Selkirk <paul@psgd.org>2015-10-31 22:46:17 -0400
commit274f905d985565c68d4133bed39b626b636e2512 (patch)
treea67670e690528a01dc082661018d08aeb136dbd1 /tests/test-ecdsa.c
parent3ddf1e38e15a94e3a7cad78a61ecb24ef68cfcb3 (diff)
fix time calculation in test-ecdsa
Diffstat (limited to 'tests/test-ecdsa.c')
-rw-r--r--tests/test-ecdsa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-ecdsa.c b/tests/test-ecdsa.c
index 23d9720..cbb2450 100644
--- a/tests/test-ecdsa.c
+++ b/tests/test-ecdsa.c
@@ -282,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;
@@ -322,11 +322,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.