aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-02-17 00:17:09 -0500
committerJack Lloyd <[email protected]>2016-02-17 00:17:09 -0500
commit167d062dd9d60177691aa675a8a5b64424aa00e3 (patch)
treee34e2b28d7846ee6876277d79c82e31161048c90 /src/tests/tests.h
parente8700f6f6062fd769dea267646f9ac951de90a05 (diff)
Add constant time conditional swap, add, sub for bigint words
Not optimized and relies on asm support for const time word_add/word_sub instructions. Fix a bug introduced in 46e9a89 - unpoison needs to call the valgrind API with the pointer rather than the reference. Caused values not to be unpoisoned.
Diffstat (limited to 'src/tests/tests.h')
-rw-r--r--src/tests/tests.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tests/tests.h b/src/tests/tests.h
index 5a075975d..0c561a7d3 100644
--- a/src/tests/tests.h
+++ b/src/tests/tests.h
@@ -174,6 +174,13 @@ class Test
bool test_eq(const std::string& what, bool produced, bool expected);
bool test_eq(const std::string& what, size_t produced, size_t expected);
+
+ template<typename I1, typename I2>
+ bool test_int_eq(I1 x, I2 y, const char* what)
+ {
+ return test_eq(what, static_cast<size_t>(x), static_cast<size_t>(y));
+ }
+
bool test_lt(const std::string& what, size_t produced, size_t expected);
bool test_gte(const std::string& what, size_t produced, size_t expected);