diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-05-29 12:39:00 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:38:02 +0000 |
commit | 0b05a0fa74512970ceba3c15ed2cbf027ef7b6da (patch) | |
tree | 8d124229d8b6df177a1e5d37e18681803a221c45 /tests/performance_tests/multiexp.h | |
parent | add pippenger unit tests (diff) | |
download | monero-0b05a0fa74512970ceba3c15ed2cbf027ef7b6da.tar.xz |
Add Pippenger cache and limit Straus cache size
Diffstat (limited to 'tests/performance_tests/multiexp.h')
-rw-r--r-- | tests/performance_tests/multiexp.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/performance_tests/multiexp.h b/tests/performance_tests/multiexp.h index 294e74116..b8b87b3a6 100644 --- a/tests/performance_tests/multiexp.h +++ b/tests/performance_tests/multiexp.h @@ -40,6 +40,7 @@ enum test_multiexp_algorithm multiexp_straus, multiexp_straus_cached, multiexp_pippenger, + multiexp_pippenger_cached, }; template<test_multiexp_algorithm algorithm, size_t npoints, size_t c=0> @@ -61,7 +62,8 @@ public: rct::key kn = rct::scalarmultKey(point, data[n].scalar); res = rct::addKeys(res, kn); } - cache = rct::straus_init_cache(data); + straus_cache = rct::straus_init_cache(data); + pippenger_cache = rct::pippenger_init_cache(data); return true; } @@ -74,9 +76,11 @@ public: case multiexp_straus: return res == straus(data); case multiexp_straus_cached: - return res == straus(data, cache); + return res == straus(data, straus_cache); case multiexp_pippenger: - return res == pippenger(data, c); + return res == pippenger(data, NULL, c); + case multiexp_pippenger_cached: + return res == pippenger(data, pippenger_cache, c); default: return false; } @@ -84,6 +88,7 @@ public: private: std::vector<rct::MultiexpData> data; - std::shared_ptr<rct::straus_cached_data> cache; + std::shared_ptr<rct::straus_cached_data> straus_cache; + std::shared_ptr<rct::pippenger_cached_data> pippenger_cache; rct::key res; }; |