private-attribution / ipa

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

Implement reveal for upgraded contexts only #1206

Closed andyleiserson closed 1 month ago

andyleiserson commented 1 month ago

Another piece of #1112. This modifies the reveal implementations so that reveal is implemented only for upgraded contexts, and not for any C: Context. The danger of impl Reveal<C: Context> for /* semi honest */ AdditiveShare<F> is that it could accidentally be invoked by a protocol intending to have DZKP malicious security.

This changes the check_zero protocol used for MAC-based malicious security to use a malicious reveal, however, there is still a problem with the zero check, see https://github.com/private-attribution/ipa/issues/1204#issuecomment-2261313344.

The reveals in PRF evaluation are changed to call malicious_reveal directly because the PRF doesn't yet take a context of an appropriate type. I've added a TODO, which can be cleaned up with the changes for malicious security in the PRF.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 97.36842% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.23%. Comparing base (2da9b09) to head (9ad30d9).

Files Patch % Lines
ipa-core/src/protocol/basics/reveal.rs 98.39% 3 Missing :warning:
ipa-core/src/test_fixture/world.rs 76.92% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1206 +/- ## ========================================== - Coverage 92.25% 92.23% -0.03% ========================================== Files 197 197 Lines 29825 29951 +126 ========================================== + Hits 27514 27624 +110 - Misses 2311 2327 +16 ```

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