diff --git a/src/protocol/prf_sharding/mod.rs b/src/protocol/prf_sharding/mod.rs index 946887b35..07404509e 100644 --- a/src/protocol/prf_sharding/mod.rs +++ b/src/protocol/prf_sharding/mod.rs @@ -363,32 +363,6 @@ where }) } -// fn chunk_rows_by_user( -// input_rows: Vec>, -// ) -> Vec>> -// where -// BK: GaloisField, -// TV: GaloisField, -// TS: GaloisField, -// { -// let mut rows_for_user: Vec> = vec![]; - -// let mut rows_chunked_by_user = vec![]; -// for row in input_rows { -// if rows_for_user.is_empty() || row.prf_of_match_key == rows_for_user[0].prf_of_match_key { -// rows_for_user.push(row); -// } else { -// rows_chunked_by_user.push(rows_for_user); -// rows_for_user = vec![row]; -// } -// } -// if !rows_for_user.is_empty() { -// rows_chunked_by_user.push(rows_for_user); -// } - -// rows_chunked_by_user -// } - /// Sub-protocol of the PRF-sharded IPA Protocol /// /// After the computation of the per-user PRF, addition of dummy records and shuffling, @@ -485,13 +459,8 @@ where 0..BK::BITS + TV::BITS, ); - // transform value bits to large field - // let large_field_values = converted_values - // .map(|val| BitDecomposed::to_additive_sharing_in_large_field_consuming(val.unwrap())); - // move each value to the correct bucket let row_contributions_stream = converted_bks_and_tvs - // .zip(large_field_values) .zip(futures::stream::repeat( prime_field_ctx.narrow(&Step::MoveValueToCorrectBreakdown) .set_total_records(num_outputs), diff --git a/src/query/runner/oprf_ipa.rs b/src/query/runner/oprf_ipa.rs index e77a0300e..def96d26e 100644 --- a/src/query/runner/oprf_ipa.rs +++ b/src/query/runner/oprf_ipa.rs @@ -71,6 +71,18 @@ where panic!("Encrypted match key handling is not handled for OPRF flow as yet"); }; + let mut histogram = vec![]; + let mut last_prf = input[0].mk_oprf + 1; + let mut cur_count = 0; + for row in input { + if row.mk_oprf != last_prf { + cur_count = 0; + } else { + cur_count += 1; + } + histogram[cur_count] += 1; + } + // TODO: Compute OPRFs and shuffle and add dummies and stuff (Daniel's code will be called here) let sharded_input = input .into_iter() @@ -110,6 +122,7 @@ where sharded_input, user_cap.ilog2().try_into().unwrap(), config.attribution_window_seconds, + &histogram, ) .await }