diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-01-18 12:01:45 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-11 13:37:31 +0000 |
commit | e895c3def1aa6c037c3d9c2daca8dacbd62e74dd (patch) | |
tree | 4c5281f1d9bfda0f0b6e8e2e504a49091204ffab /tests/performance_tests/multiexp.h | |
parent | multiexp: bos coster now works for just one point (diff) | |
download | monero-e895c3def1aa6c037c3d9c2daca8dacbd62e74dd.tar.xz |
make straus cached mode thread safe, and add tests for it
Diffstat (limited to 'tests/performance_tests/multiexp.h')
-rw-r--r-- | tests/performance_tests/multiexp.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/performance_tests/multiexp.h b/tests/performance_tests/multiexp.h index ac5f60fdf..ab5af166b 100644 --- a/tests/performance_tests/multiexp.h +++ b/tests/performance_tests/multiexp.h @@ -38,6 +38,7 @@ enum test_multiexp_algorithm { multiexp_bos_coster, multiexp_straus, + multiexp_straus_cached, }; template<test_multiexp_algorithm algorithm, size_t npoints> @@ -59,6 +60,7 @@ public: rct::key kn = rct::scalarmultKey(point, data[n].scalar); res = rct::addKeys(res, kn); } + cache = rct::straus_init_cache(data); return true; } @@ -69,7 +71,9 @@ public: case multiexp_bos_coster: return res == bos_coster_heap_conv_robust(data); case multiexp_straus: - return res == straus(data, false); + return res == straus(data); + case multiexp_straus_cached: + return res == straus(data, cache); default: return false; } @@ -77,5 +81,6 @@ public: private: std::vector<rct::MultiexpData> data; + std::shared_ptr<rct::straus_cached_data> cache; rct::key res; }; |