Skip to content

Commit

Permalink
Fix chunk calculation for hybrid aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleiserson committed Dec 13, 2024
1 parent fa74e23 commit 7164402
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 7164402

Please sign in to comment.