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

Add Encryption and Decryption for OPRF Report Structs #904

Merged
merged 29 commits into from
Feb 15, 2024

Conversation

danielmasny
Copy link
Collaborator

No description provided.

@danielmasny
Copy link
Collaborator Author

I will use slices instead of generic arrays to fix the trait bounds. So don't review it yet.

@danielmasny danielmasny marked this pull request as ready for review December 27, 2023 00:52
@danielmasny
Copy link
Collaborator Author

I will use slices instead of generic arrays to fix the trait bounds. So don't review it yet.

I fixed it, its ready for review now.

Copy link
Collaborator

@andyleiserson andyleiserson left a comment

Choose a reason for hiding this comment

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

Looks good overall, I left a few suggestions.

ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
@andyleiserson
Copy link
Collaborator

Oh, and I'd suggest either cleaning up the commit history locally (I use git rebase -i), or using the squash-merge option in github.

ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/query/runner/oprf_ipa.rs Show resolved Hide resolved
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@a3d4fda). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #904   +/-   ##
=======================================
  Coverage        ?   90.29%           
=======================================
  Files           ?      182           
  Lines           ?    26091           
  Branches        ?        0           
=======================================
  Hits            ?    23560           
  Misses          ?     2531           
  Partials        ?        0           

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

@akoshelev
Copy link
Collaborator

This PR hasn't seen any updated in 2 weeks, are we still planning to work on it?

Copy link
Collaborator

@akoshelev akoshelev left a comment

Choose a reason for hiding this comment

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

some minor feedback

ipa-core/src/report.rs Show resolved Hide resolved
)
.unwrap(); // validated on construction

let mut ct_mk = self.mk_ciphertext().to_vec();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you point me to the heap allocation in the old code? I am struggling to find it - it does seem that it works w/o a roundtrip to jemalloc.

The reason I think it matters is because this will be called 50 million (or whatever shard size is) times - we got a decent chance for memory allocator to do its job properly, but this is a game I think we don't have to play as it should be possible to avoid in this code

ipa-core/src/protocol/ipa_prf/mod.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved
ipa-core/src/report.rs Outdated Show resolved Hide resolved

let mut ct_mk: GenericArray<u8, CTMKLength> =
*GenericArray::from_slice(self.mk_ciphertext());
// let mut ct_mk = self.mk_ciphertext().to_vec();
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't want to hold this change for too long, but lets make sure we clean up commented code. Fine with a follow up PR to address those

Comment on lines +597 to +598
let mut ct_btt: GenericArray<u8, CTBTTLength<BK, TV, TS>> =
GenericArray::from_slice(self.btt_ciphertext()).clone();
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use the same dereferencing trick *GenericArray instead of GenericArray(...).clone()

@akoshelev akoshelev merged commit b526f55 into private-attribution:main Feb 15, 2024
11 checks passed
@danielmasny danielmasny deleted the decrypt_oprf branch February 15, 2024 22:42
@danielmasny danielmasny restored the decrypt_oprf branch February 23, 2024 18:52
@danielmasny danielmasny deleted the decrypt_oprf branch February 23, 2024 18:58
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.

None yet

3 participants