Skip to content

Commit

Permalink
Support multiproof in PINE
Browse files Browse the repository at this point in the history
  • Loading branch information
junyechen1996 committed Dec 18, 2023
1 parent 0f0807e commit 3e3765d
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 99 deletions.
2 changes: 1 addition & 1 deletion poc/draft-irtf-cfrg-vdaf
Submodule draft-irtf-cfrg-vdaf updated 40 files
+2 −0 .github/workflows/test.yml
+3 −0 .gitmodules
+402 −291 draft-irtf-cfrg-vdaf.md
+1 −1 poc/common.py
+6 −6 poc/daf.py
+1 −0 poc/draft-irtf-cfrg-kangarootwelve
+185 −10 poc/flp_generic.py
+8 −4 poc/idpf_poplar.py
+101 −0 poc/plot_prio3_multiproof_robustness.py
+0 −52 poc/test_vec/07/IdpfPoplar_0.json
+0 −56 poc/test_vec/07/Poplar1_0.json
+0 −64 poc/test_vec/07/Poplar1_1.json
+0 −64 poc/test_vec/07/Poplar1_2.json
+0 −76 poc/test_vec/07/Poplar1_3.json
+0 −52 poc/test_vec/07/Prio3Histogram_0.json
+0 −89 poc/test_vec/07/Prio3Histogram_1.json
+0 −194 poc/test_vec/07/Prio3SumVec_0.json
+0 −146 poc/test_vec/07/Prio3SumVec_1.json
+0 −40 poc/test_vec/07/Prio3Sum_0.json
+0 −46 poc/test_vec/07/Prio3Sum_1.json
+0 −8 poc/test_vec/07/XofFixedKeyAes128.json
+0 −8 poc/test_vec/07/XofShake128.json
+52 −0 poc/test_vec/08/IdpfPoplar_0.json
+56 −0 poc/test_vec/08/Poplar1_0.json
+64 −0 poc/test_vec/08/Poplar1_1.json
+64 −0 poc/test_vec/08/Poplar1_2.json
+76 −0 poc/test_vec/08/Poplar1_3.json
+7 −7 poc/test_vec/08/Prio3Count_0.json
+10 −10 poc/test_vec/08/Prio3Count_1.json
+52 −0 poc/test_vec/08/Prio3Histogram_0.json
+89 −0 poc/test_vec/08/Prio3Histogram_1.json
+194 −0 poc/test_vec/08/Prio3SumVec_0.json
+146 −0 poc/test_vec/08/Prio3SumVec_1.json
+40 −0 poc/test_vec/08/Prio3Sum_0.json
+46 −0 poc/test_vec/08/Prio3Sum_1.json
+8 −0 poc/test_vec/08/XofFixedKeyAes128.json
+8 −0 poc/test_vec/08/XofTurboShake128.json
+12 −12 poc/vdaf_poplar1.py
+233 −69 poc/vdaf_prio3.py
+33 −25 poc/xof.py
25 changes: 22 additions & 3 deletions poc/flp_pine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from common import Unsigned, Vec, front, gen_rand, next_power_of_2
from field import Field, Field128
from flp_generic import FlpGeneric, Mul, ParallelSum, Valid, test_flp_generic
from xof import Xof, XofShake128
from xof import Xof, XofFixedKeyAes128


class PineValid(Valid):
Expand Down Expand Up @@ -38,7 +38,26 @@ class PineValid(Valid):
# Associated types for `Valid`.
Measurement = Vec[float]
AggResult = Vec[float]
Field = Field128
Field = Field128 # Can be set by `with_field()`.

# Associated types for `PineValid`.
# Note we currently use `XofFixedKeyAes128` by default, because
# `XofTurboShake128` in VDAF poc has a limit of how many bytes can be
# sampled:
# https://github.com/cfrg/draft-irtf-cfrg-vdaf/blob/fd7a2dc4993babbf3acffc7d498cd7925890064b/poc/xof.py#L18-L21
Xof = XofFixedKeyAes128 # Can be set by `with_xof()`.

@classmethod
def with_xof(PineValid, TheXof):
class PineValidWithXof(PineValid):
Xof = TheXof
return PineValidWithXof

@classmethod
def with_field(PineValid, TheField):
class PineValidWithField(PineValid):
Field = TheField
return PineValidWithField

def __init__(self,
l2_norm_bound: float,
Expand Down Expand Up @@ -528,7 +547,7 @@ def test():
flp = FlpGeneric(pine_valid)

# Test PINE FLP with verification.
xof = XofShake128(gen_rand(16), b"", b"")
xof = XofFixedKeyAes128(gen_rand(16), b"", b"")
encoded_meas_no_wr = flp.encode(measurement)
(wr_dot_prods, wr_res) = pine_valid.run_wr_checks(encoded_meas_no_wr, xof)
flp_meas = encoded_meas_no_wr + wr_res + wr_dot_prods
Expand Down
Loading

0 comments on commit 3e3765d

Please sign in to comment.