Skip to content
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

Merged
merged 23 commits into from
May 22, 2024

Conversation

rnburn
Copy link
Collaborator

@rnburn rnburn commented May 21, 2024

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?

  • add cpu versions of Pippenger algorithms
  • add more documentation
  • minor renaming
  • minor changes to make testing easier

Are these changes tested?

Yes

@rnburn rnburn marked this pull request as draft May 21, 2024 17:00
@rnburn rnburn marked this pull request as ready for review May 22, 2024 03:20
@@ -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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped.

Comment on lines 69 to 70
std::vector<E> data((1u << 16u) * 2);
data[1u << 16u] = 12;
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

@rnburn rnburn merged commit 25788e0 into main May 22, 2024
8 checks passed
@rnburn rnburn deleted the hst-PROOF-831 branch May 22, 2024 17:54
@SxT-Release
Copy link

🎉 This PR is included in version 1.55.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants