mozilla / docker-etl

Collection of dockerized ETL jobs managed by data engineering.
Mozilla Public License 2.0
19 stars 15 forks source link

Detect and correct wraparound for negative PPA conversion counts #278

Closed cbguder closed 2 months ago

cbguder commented 2 months ago

Differential privacy in Prio can result in negative conversion counts, which then wrap around to large numbers as all operations are performed modulo a large prime number.

This change hard-codes the prime number used for the Prio3SumVec data type (currently the only data type we use for DAP reports) to detect and correct this behavior, such that we can generate human-friendly reports for advertisers.

Namely, given the modulus P is a 128-bit prime, any value N in the histogram that is greater than 2^127 is replaced with (N-P).

JIRA: AE-553

Checklist for reviewer: