summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2014-09-25 13:39:21 +0200
committerEmilia Kasper <emilia@openssl.org>2014-09-25 13:47:42 +0200
commit7b7aef9bfd1e7e9b449db0c6a54f788d2adcb671 (patch)
tree57c2f599fd161ac2b4d78a4859b23c55fb90d941
parent93540299fe5262917a6b5f6644a41872263260f9 (diff)
Add missing tests
Accidentally omitted from commit 455b65dfab0de51c9f67b3c909311770f2b3f801 Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit fdc35a9d3e8cf4cfd9330d5df9883f42cf5648ad)
-rw-r--r--crypto/constant_time_test.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/constant_time_test.c b/crypto/constant_time_test.c
index 1b4b18d199..d9c6a44aed 100644
--- a/crypto/constant_time_test.c
+++ b/crypto/constant_time_test.c
@@ -201,14 +201,14 @@ static int test_eq_int(int a, int b)
unsigned int equal = constant_time_eq_int(a, b);
if (a == b && equal != CONSTTIME_TRUE)
{
- fprintf(stderr, "Test failed for constant_time_select(%d, %d): "
+ fprintf(stderr, "Test failed for constant_time_eq_int(%d, %d): "
"expected %du(TRUE), got %du\n",
a, b, CONSTTIME_TRUE, equal);
return 1;
}
else if (a != b && equal != CONSTTIME_FALSE)
{
- fprintf(stderr, "Test failed for constant_time_select(%d, %d): "
+ fprintf(stderr, "Test failed for constant_time_eq_int(%d, %d): "
"expected %du(FALSE), got %du\n",
a, b, CONSTTIME_FALSE, equal);
return 1;
@@ -221,14 +221,14 @@ static int test_eq_int_8(int a, int b)
unsigned char equal = constant_time_eq_int_8(a, b);
if (a == b && equal != CONSTTIME_TRUE_8)
{
- fprintf(stderr, "Test failed for constant_time_select(%d, %d): "
+ fprintf(stderr, "Test failed for constant_time_eq_int_8(%d, %d): "
"expected %u(TRUE), got %u\n",
a, b, CONSTTIME_TRUE_8, equal);
return 1;
}
else if (a != b && equal != CONSTTIME_FALSE_8)
{
- fprintf(stderr, "Test failed for constant_time_select(%d, %d): "
+ fprintf(stderr, "Test failed for constant_time_eq_int_8(%d, %d): "
"expected %u(FALSE), got %u\n",
a, b, CONSTTIME_FALSE_8, equal);
return 1;
@@ -300,7 +300,9 @@ int main(int argc, char *argv[])
{
d = signed_test_values[j];
num_failed += test_select_int(c, d);
- num_all += 1;
+ num_failed += test_eq_int(c, d);
+ num_failed += test_eq_int_8(c, d);
+ num_all += 3;
}
}