private-attribution / ipa

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

keep track of amount of u,v values included in a proof #1143

Closed danielmasny closed 3 months ago

danielmasny commented 3 months ago

This PR allows to keep track of amount of u,v values when generate proof. This is important since the verification will need to know the amount.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.68%. Comparing base (2f873e1) to head (99841d0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1143 +/- ## ========================================== + Coverage 91.66% 91.68% +0.02% ========================================== Files 190 190 Lines 27999 28025 +26 ========================================== + Hits 25665 25695 +30 + Misses 2334 2330 -4 ```

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

danielmasny commented 3 months ago

I disagree with this design. I do not think compute proof should be responsible for counting the elements added to it. Look at all the complex tuple return types and the frequently ignored values. This is not a good design.

I think when we perform a multiplication and push it into the list of multiplications that need to be verified, THAT is the place to increment a counter. In fact, it's only that first stage where we need to perform this count.

@benjaminsavage I would be fine with that too and was thinking about that as well. A reason why I think this PR is more straightforward is that we just count the amount when we actually compute the proof (which will be the same for all three proofs and doesn't need to be sent over the network). Counting the multiplications when they are stored comes with two challenges: