-
Notifications
You must be signed in to change notification settings - Fork 242
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
Add MSM with chunks and HashMapPippenger #397
Conversation
It seems that the biggest problem is that we cannot use unstable features in arkworks-rs. And Any workaround for now? |
.entry(*base.borrow()) | ||
.or_insert(G::ScalarField::zero()); | ||
*entry += *scalar.borrow(); | ||
if self.buffer.len() == self.buffer.capacity() { |
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.
@huyuncong @mmaker I have a concern about whether capacity()
will run in the expected way. Rust did not promise that the capacity of the map would not grow on its own, and Rust did not promise that it will allocate exactly the capacity as specified during with_capacity
.
Note: Rust's hashmap is often constructed through the RawTable here, which may specify a slightly different capacity compared with the one from with_capacity
.
https://docs.rs/hashbrown/latest/src/hashbrown/raw/mod.rs.html#191
Co-authored-by: Michele Orrù <[email protected]>
Avoid relying on the hashmap `capacity()` method, by adding another field `buf_size` (that echoes `ChunkedPippenger`)
This makes the streaming API for pippenger mkore solid and consistent with HahMapPippenger.
This code comes from Gemini: https://github.com/mmaker/gemini.
All pending issues should be resolved now! However, I note that there is no unit-test! @huyuncong can you take care of it? |
If you could run |
Done! (staging only the changes in ec/msm/) |
Description
Add steaming multi-scalar multiplication algorithm with chunks.
Add Pippenger algorithm using hash map struct.
Note that we use #![feature(iter_advance_by)] in the MSM with chunks.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer