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

chore: Add Pippenger with precomp #247

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove empty buckets
  • Loading branch information
kevaundray committed Sep 2, 2024
commit a4b66f3bf35693637f438217a4978b285f6f4911
7 changes: 3 additions & 4 deletions cryptography/bls12_381/src/msm.rs
Original file line number Diff line number Diff line change
@@ -203,12 +203,11 @@ pub fn msm_best2_noinfo(
// or use the optimized formulas
// let mut all_points = Vec::new();
// let mut bucket_indices = Vec::new();
// TODO: This should return the points too, ie skip the empty buckets
let bucket_indices: Vec<_> = all_information
.iter()
let (bucket_indices, all_information): (Vec<_>, Vec<_>) = all_information
.into_iter()
.enumerate()
.filter(|(_, points)| !points.is_empty())
.map(|(index, _)| (index + 1) as u64)
.map(|(index, points)| (((index + 1) as u64), points))
.collect();

let buckets_added = crate::batch_add::multi_batch_addition(all_information);