diff options
Diffstat (limited to 'src/regress/lib/libc')
-rw-r--r-- | src/regress/lib/libc/timingsafe/timingsafe.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/regress/lib/libc/timingsafe/timingsafe.c b/src/regress/lib/libc/timingsafe/timingsafe.c index 9ecac93c09..e7807db258 100644 --- a/src/regress/lib/libc/timingsafe/timingsafe.c +++ b/src/regress/lib/libc/timingsafe/timingsafe.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: timingsafe.c,v 1.1 2014/06/13 01:55:02 matthew Exp $ */ | 1 | /* $OpenBSD: timingsafe.c,v 1.2 2014/06/13 02:12:17 matthew Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Google Inc. | 3 | * Copyright (c) 2014 Google Inc. |
4 | * | 4 | * |
@@ -42,21 +42,17 @@ check() | |||
42 | /* Check for reflexivity. */ | 42 | /* Check for reflexivity. */ |
43 | ASSERT_EQ(0, timingsafe_bcmp(bufone, bufone, N)); | 43 | ASSERT_EQ(0, timingsafe_bcmp(bufone, bufone, N)); |
44 | ASSERT_EQ(0, timingsafe_bcmp(buftwo, buftwo, N)); | 44 | ASSERT_EQ(0, timingsafe_bcmp(buftwo, buftwo, N)); |
45 | #if notyet | ||
46 | ASSERT_EQ(0, timingsafe_memcmp(bufone, bufone, N)); | 45 | ASSERT_EQ(0, timingsafe_memcmp(bufone, bufone, N)); |
47 | ASSERT_EQ(0, timingsafe_memcmp(buftwo, buftwo, N)); | 46 | ASSERT_EQ(0, timingsafe_memcmp(buftwo, buftwo, N)); |
48 | #endif | ||
49 | 47 | ||
50 | /* Check that timingsafe_bcmp returns 0 iff memcmp returns 0. */ | 48 | /* Check that timingsafe_bcmp returns 0 iff memcmp returns 0. */ |
51 | ASSERT_EQ(cmp == 0, timingsafe_bcmp(bufone, buftwo, N) == 0); | 49 | ASSERT_EQ(cmp == 0, timingsafe_bcmp(bufone, buftwo, N) == 0); |
52 | 50 | ||
53 | #if notyet | ||
54 | /* Check that timingsafe_memcmp returns cmp... */ | 51 | /* Check that timingsafe_memcmp returns cmp... */ |
55 | ASSERT_EQ(cmp, timingsafe_memcmp(bufone, buftwo, N)); | 52 | ASSERT_EQ(cmp, timingsafe_memcmp(bufone, buftwo, N)); |
56 | 53 | ||
57 | /* ... or -cmp if the argument order is swapped. */ | 54 | /* ... or -cmp if the argument order is swapped. */ |
58 | ASSERT_EQ(-cmp, timingsafe_memcmp(buftwo, bufone, N)); | 55 | ASSERT_EQ(-cmp, timingsafe_memcmp(buftwo, bufone, N)); |
59 | #endif | ||
60 | } | 56 | } |
61 | 57 | ||
62 | int | 58 | int |