diff options
Diffstat (limited to 'tests/performance_tests')
-rw-r--r-- | tests/performance_tests/check_hash.h | 14 | ||||
-rw-r--r-- | tests/performance_tests/main.cpp | 20 | ||||
-rw-r--r-- | tests/performance_tests/rct_mlsag.h | 12 |
3 files changed, 18 insertions, 28 deletions
diff --git a/tests/performance_tests/check_hash.h b/tests/performance_tests/check_hash.h index 53746fec4..294654f37 100644 --- a/tests/performance_tests/check_hash.h +++ b/tests/performance_tests/check_hash.h @@ -29,6 +29,7 @@ #pragma once #include "string_tools.h" +#include "int-util.h" #include "cryptonote_basic/difficulty.h" template<uint64_t hash_target_high, uint64_t hash_target_low, uint64_t difficulty_high, uint64_t difficulty_low> @@ -44,13 +45,18 @@ public: difficulty = difficulty_high; difficulty = (difficulty << 64) | difficulty_low; boost::multiprecision::uint256_t hash_value = std::numeric_limits<boost::multiprecision::uint256_t>::max() / hash_target; - ((uint64_t*)&hash)[0] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + uint64_t val; + val = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + ((uint64_t*)&hash)[0] = SWAP64LE(val); hash_value >>= 64; - ((uint64_t*)&hash)[1] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + val = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + ((uint64_t*)&hash)[1] = SWAP64LE(val); hash_value >>= 64; - ((uint64_t*)&hash)[2] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + val = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + ((uint64_t*)&hash)[2] = SWAP64LE(val); hash_value >>= 64; - ((uint64_t*)&hash)[3] = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + val = (hash_value & 0xffffffffffffffff).convert_to<uint64_t>(); + ((uint64_t*)&hash)[3] = SWAP64LE(val); return true; } diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp index c32e0df20..bd7414c59 100644 --- a/tests/performance_tests/main.cpp +++ b/tests/performance_tests/main.cpp @@ -57,7 +57,6 @@ #include "rct_mlsag.h" #include "equality.h" #include "range_proof.h" -#include "rct_mlsag.h" #include "bulletproof.h" #include "crypto_ops.h" #include "multiexp.h" @@ -214,14 +213,8 @@ int main(int argc, char** argv) TEST_PERFORMANCE1(filter, p, test_cn_fast_hash, 32); TEST_PERFORMANCE1(filter, p, test_cn_fast_hash, 16384); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 3, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 5, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 10, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 100, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 3, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 5, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 10, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 100, true); + TEST_PERFORMANCE2(filter, p, test_ringct_mlsag, 11, false); + TEST_PERFORMANCE2(filter, p, test_ringct_mlsag, 11, true); TEST_PERFORMANCE2(filter, p, test_equality, memcmp32, true); TEST_PERFORMANCE2(filter, p, test_equality, memcmp32, false); @@ -251,15 +244,6 @@ int main(int argc, char** argv) TEST_PERFORMANCE6(filter, p, test_aggregated_bulletproof, false, 2, 1, 1, 0, 64); TEST_PERFORMANCE6(filter, p, test_aggregated_bulletproof, true, 2, 1, 1, 0, 64); // 64 proof, each with 2 amounts - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 3, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 5, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 10, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 100, false); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 3, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 5, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 10, true); - TEST_PERFORMANCE3(filter, p, test_ringct_mlsag, 1, 100, true); - TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_sc_add); TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_sc_sub); TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_sc_mul); diff --git a/tests/performance_tests/rct_mlsag.h b/tests/performance_tests/rct_mlsag.h index 0141710f7..59eae074e 100644 --- a/tests/performance_tests/rct_mlsag.h +++ b/tests/performance_tests/rct_mlsag.h @@ -35,13 +35,13 @@ #include "single_tx_test_base.h" -template<size_t inputs, size_t ring_size, bool ver> +template<size_t ring_size, bool ver> class test_ringct_mlsag : public single_tx_test_base { public: static const size_t cols = ring_size; - static const size_t rows = inputs; - static const size_t loop_count = 100; + static const size_t rows = 2; // single spend and commitment data + static const size_t loop_count = 1000; bool init() { @@ -65,7 +65,7 @@ public: { sk[j] = xm[ind][j]; } - IIccss = MLSAG_Gen(rct::identity(), P, sk, NULL, NULL, ind, rows, hw::get_device("default")); + IIccss = MLSAG_Gen(rct::identity(), P, sk, NULL, NULL, ind, rows-1, hw::get_device("default")); return true; } @@ -73,9 +73,9 @@ public: bool test() { if (ver) - MLSAG_Ver(rct::identity(), P, IIccss, rows); + MLSAG_Ver(rct::identity(), P, IIccss, rows-1); else - MLSAG_Gen(rct::identity(), P, sk, NULL, NULL, ind, rows, hw::get_device("default")); + MLSAG_Gen(rct::identity(), P, sk, NULL, NULL, ind, rows-1, hw::get_device("default")); return true; } |