private-attribution / ipa

A raw implementation of Interoperable Private Attribution
MIT License
40 stars 23 forks source link

Reveal wrapper #1112

Closed andyleiserson closed 1 month ago

andyleiserson commented 3 months ago

Create a wrapper around revealed values similar to the existing wrapper around downgraded values. Currently just unwrap things where needed, but there is some restructuring of protocols to consolidate reveal operations.

From talking with @danielmasny, it may be better to defer the reveal until after the DZKP has been validated. Possibly we can just do the reveal within the validate function, and avoid the wrapper entirely.

I am also changing reveal so that it is only implemented on "upgraded" contexts. This protects against inadvertent use of semi-honest protocols, which is a much greater concern in our new malicious security protocol where the share type is still semi_honest::AdditiveShare. In the previous protocol where shares were malicious::AdditiveShare, we were protected against inadvertently using semi-honest protocols because the non-upgraded context did not implement protocols for malicious::AdditiveShare. Removing protocol support from the base context requires changing a bunch of tests that used to call TestWorld::semi_honest to call TestWorld::upgraded_semi_honest instead. A similar change should be made for multiplication, but that can be done in a separate PR.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 98.31224% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.23%. Comparing base (b50beae) to head (c416d3b).

Files Patch % Lines
ipa-core/src/ff/ec_prime_field.rs 0.00% 3 Missing :warning:
ipa-core/src/protocol/basics/reveal.rs 99.25% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1112 +/- ## ========================================== + Coverage 91.22% 91.23% +0.01% ========================================== Files 187 187 Lines 26554 26641 +87 ========================================== + Hits 24224 24307 +83 - Misses 2330 2334 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.