private-attribution / ipa

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

Use Upgradable trait in MAC module #1213

Closed akoshelev closed 1 month ago

akoshelev commented 1 month ago

When working on vectorizing malicious shares, we noticed that the existing upgrade API does not work for vectorized shares. It either required contexts to be vectorization-aware which we tried to avoid up to this point, or a different mechanism to specify how upgrades occur for vectorized shares.

For example: Replicated<F, N> when upgraded, gets transformed to MaliciousReplicated<F, N> and different N values, require different bounds on functions.

That was a blocker for PRF evaluation upgrade and the solution we came up with was to introduce Upgradable trait.

The functionality of this trait is very similar to UpgradeToMalicious and Upgrade but upgrade now is bound explicitly to RecordId. This optimizes for protocols readability. Malicious upgrades in tests had to find a way around this limitation, and it is a bit hacky. I don't think it is significantly different from what we've been doing before though.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 97.32143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.68%. Comparing base (c8f1788) to head (eb1afc9).

Files Patch % Lines
ipa-core/src/protocol/context/semi_honest.rs 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1213 +/- ## ========================================== + Coverage 92.62% 92.68% +0.05% ========================================== Files 197 196 -1 Lines 30527 30503 -24 ========================================== - Hits 28275 28271 -4 + Misses 2252 2232 -20 ```

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