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

Hybrid padding #1381

Merged
merged 6 commits into from
Oct 29, 2024
Merged

Conversation

eriktaubeneck
Copy link
Member

This implements the Paddable trait for IndistinguishableHybridReport so that it can work with apply_dp_padding. It also implements TestIndistinguishableHybridReport and Reconstruct to support the tests.

Note that this is fairly repetitive to the OPRF implementation. If we wanted to keep that around, we'd want to make this more generic, but given our intention is to delete that, it's copied and modified to work directly with IndistinguishableHybridReport.

ipa-core/src/test_fixture/hybrid.rs Outdated Show resolved Hide resolved
matchkey_cardinality_cap,
oprf_padding_sensitivity,
} => {
let oprf_padding =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still plan to use OPRFPaddingDp or it will be replicated as well for hybrid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets somewhat confusing, because we use the term "OPRF" to name both the entire ipa v2 protocol as well as the pseudo random value that the match key is converted into.

In this instance, we are padding values so that the process of converting match keys into OPRF values is differentially private (same as previously), as opposed to padding values for aggregation or breakdown key reveal. In that sense, I think this naming still makes sense, and actually "HybridPadding" would be less clear (at least once the old protocol is purged.)

Happy for input on this - but that was my thinking. I can add a comment here to make that more clear as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this more closely, this is actually just poor naming of the existing OPRFPaddingDp struct, which itself isn't tied specifically to the OPRF, and is used for aggregation padding as well. I'll open a new PR to make that naming more generic. It still makes sense to me to use the OPRFPadding struct here since we're still using it to provide DP for the match_key to OPRF conversion.

@@ -130,6 +131,71 @@ pub trait Paddable {
Self: Sized;
}

impl<BK, V> Paddable for IndistinguishableHybridReport<BK, V>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trait could be made better...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you take a look and see if this impl is cleaner?

ipa-core/src/protocol/ipa_prf/oprf_padding/mod.rs Outdated Show resolved Hide resolved
@@ -451,6 +518,31 @@ mod tests {
Ok(input)
}

pub async fn set_up_apply_dp_padding_pass_for_indistinguishable_reports<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting on this function is crazy. Is it because the name of the function is kinda long? Does it make sense to move this to a separate module? Maybe that way you can reduce the size of the function name since it will have a more specific context in which is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the standard formatter. I don't think it makes sense to move to a separate module, all the padding functions live in this module.

} => {
let oprf_padding =
OPRFPaddingDp::new(oprf_epsilon, oprf_delta, oprf_padding_sensitivity)?;
for cardinality in 1..=matchkey_cardinality_cap {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted to get this all into a single padding_input_rows.extend but I ran into a conflict between needing to use move so that cardinality didn't outlive the closure and a mutable rng not working with the move.

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 99.46809% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.63%. Comparing base (631bfc3) to head (52c78c0).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
ipa-core/src/protocol/ipa_prf/oprf_padding/mod.rs 99.31% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1381      +/-   ##
==========================================
+ Coverage   93.55%   93.63%   +0.07%     
==========================================
  Files         223      223              
  Lines       37003    37351     +348     
==========================================
+ Hits        34620    34973     +353     
+ Misses       2383     2378       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eriktaubeneck eriktaubeneck merged commit 9477db8 into private-attribution:main Oct 29, 2024
12 checks passed
@eriktaubeneck eriktaubeneck deleted the hybrid-padding branch October 29, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants