This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short version: This PR fixes a small security bug in libprio. The bug would have taken quite a bit of work to exploit, but is a bug nonetheless.
Long version: Per Appendix D.2 of the full version of the Prio paper, the servers should evaluate the polynomials f, g, and h at a random point r in the set {M+1, ..., modulus-1}, where M is the number of multiplication gates in the "Valid" circuit. The implementation previously—and incorrectly—sampled the point r from the larger set {0, ..., modulus-1}.
The probability that a random point r would fall into the "bad set" {0, ..., M} is only (M+1)/(modulus size). Since we are using a 72-bit modulus, this probability would be no more than ~1/2^{60} for the data sizes that libprio currently supports. So, with probability ~1/2^{60}, the implementation could leak some bits of information about a client's private data to the servers. This is a pretty small failure probability, but this patch should nonetheless remove it entirely.