-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add host support for multiexponentiations using precomputed partition method (PROOF-831) #131
Conversation
@@ -35,6 +35,8 @@ namespace sxt::mtxpp2 { | |||
//-------------------------------------------------------------------------------------------------- | |||
template <bascrv::element T> | |||
class in_memory_partition_table_accessor final : public partition_table_accessor<T> { | |||
static constexpr unsigned num_entries = 1u << 16u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a number of instances in the code where the number of entries get set to 1u << 16u
. Do you think adding a constants component in multiexp/pippenger2
would have any value? I'm not sure if the number of entries supported will ever change or if incorrectly setting the number of entries will be difficult to debug, so it might not be worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
basct::cspan<uint8_t> scalars, unsigned offset) noexcept { | ||
auto num_products = products.size(); | ||
auto n = static_cast<unsigned>(scalars.size() * 8u / num_products); | ||
constexpr auto partition_table_size_v = 1u << 16u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get rid of this variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped.
std::vector<E> data((1u << 16u) * 2); | ||
data[1u << 16u] = 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these be partition_table_size_v
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
🎉 This PR is included in version 1.55.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Rationale for this change
Support computing multiexponentiations using Pippenger's partition algorithm for the host side. This is the cpu version of #130
What changes are included in this PR?
Are these changes tested?
Yes