aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/performance_tests/cn_slow_hash.h15
-rw-r--r--tests/performance_tests/main.cpp5
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/performance_tests/cn_slow_hash.h b/tests/performance_tests/cn_slow_hash.h
index b484afa41..79ebb8778 100644
--- a/tests/performance_tests/cn_slow_hash.h
+++ b/tests/performance_tests/cn_slow_hash.h
@@ -34,6 +34,7 @@
#include "crypto/crypto.h"
#include "cryptonote_basic/cryptonote_basic.h"
+template<unsigned int variant>
class test_cn_slow_hash
{
public:
@@ -42,18 +43,15 @@ public:
#pragma pack(push, 1)
struct data_t
{
- char data[13];
+ char data[43];
};
#pragma pack(pop)
- static_assert(13 == sizeof(data_t), "Invalid structure size");
+ static_assert(43 == sizeof(data_t), "Invalid structure size");
bool init()
{
- if (!epee::string_tools::hex_to_pod("63617665617420656d70746f72", m_data))
- return false;
-
- if (!epee::string_tools::hex_to_pod("bbec2cacf69866a8e740380fe7b818fc78f8571221742d729d9d02d7f8989b87", m_expected_hash))
+ if (!epee::string_tools::hex_to_pod("63617665617420656d70746f763617665617420656d70746f72263617665617420656d70746f7201020304", m_data))
return false;
return true;
@@ -62,11 +60,10 @@ public:
bool test()
{
crypto::hash hash;
- crypto::cn_slow_hash(&m_data, sizeof(m_data), hash);
- return hash == m_expected_hash;
+ crypto::cn_slow_hash(&m_data, sizeof(m_data), hash, variant);
+ return true;
}
private:
data_t m_data;
- crypto::hash m_expected_hash;
};
diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp
index bfe6de895..86450760c 100644
--- a/tests/performance_tests/main.cpp
+++ b/tests/performance_tests/main.cpp
@@ -193,7 +193,10 @@ int main(int argc, char** argv)
TEST_PERFORMANCE2(filter, p, test_wallet2_expand_subaddresses, 50, 200);
- TEST_PERFORMANCE0(filter, p, test_cn_slow_hash);
+ TEST_PERFORMANCE1(filter, p, test_cn_slow_hash, 0);
+ TEST_PERFORMANCE1(filter, p, test_cn_slow_hash, 1);
+ TEST_PERFORMANCE1(filter, p, test_cn_slow_hash, 2);
+ TEST_PERFORMANCE1(filter, p, test_cn_slow_hash, 4);
TEST_PERFORMANCE1(filter, p, test_cn_fast_hash, 32);
TEST_PERFORMANCE1(filter, p, test_cn_fast_hash, 16384);