Skip to content

Commit

Permalink
Merge pull request #1498 from andyleiserson/batch
Browse files Browse the repository at this point in the history
Fix chunk calculation for hybrid aggregation
  • Loading branch information
akoshelev authored Dec 13, 2024
2 parents fa74e23 + 7164402 commit 480a91d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ipa-core/src/protocol/hybrid/agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::{
},
report::hybrid::{AggregateableHybridReport, PrfHybridReport},
secret_sharing::replicated::semi_honest::AdditiveShare as Replicated,
utils::non_zero_prev_power_of_two,
};

enum MatchEntry<BK, V>
Expand Down Expand Up @@ -112,7 +113,8 @@ where
{
let report_pairs = group_report_pairs_ordered(reports);

let chunk_size: usize = TARGET_PROOF_SIZE / (BK::BITS as usize + V::BITS as usize);
let chunk_size =
non_zero_prev_power_of_two(TARGET_PROOF_SIZE / (BK::BITS as usize + V::BITS as usize));

let ctx = ctx.set_total_records(TotalRecords::specified(report_pairs.len())?);

Expand All @@ -121,7 +123,7 @@ where
protocol: &HybridStep::GroupBySum,
validate: &HybridStep::GroupBySumValidate,
},
chunk_size.next_power_of_two(),
chunk_size,
);

let agg_ctx = dzkp_validator.context();
Expand Down

0 comments on commit 480a91d

Please sign in to comment.