Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: David Cook <[email protected]>
  • Loading branch information
cjpatton and divergentdave authored Oct 10, 2024
1 parent a1c3987 commit 5dab644
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions draft-irtf-cfrg-vdaf.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,15 +830,17 @@ Some common functionalities:
overriding the start of the range and overriding the step between successive
output values.

* `poly_eval(field: type[F], p: list[F], x: F) -> F` returns `p(x)`.
* `poly_eval(field: type[F], p: list[F], x: F) -> F` returns the result of
evaluating the polynomial, `p(x)`. The coefficients of polynomials are stored
in lists in ascending order of degree, starting with the constant coefficient.

* `poly_interp(field: type[F], inputs: list[F], outputs: list[F]) -> list[F]`
returns the coefficients of the lowest degree polynomial `p` for which
`p(input[k]) == output[k]` for all `k`. Normally this will be computed using
the Number Theoretic Transform (NTT) {{SML24}}.

* `poly_mul(field: type[F], p: list[F], q: list[F]) -> list[F]` returns
multiplies two polynomials together.
the product of two polynomials.

* `poly_strip(field: type[F], p: list[F]) -> list[F]` strips the zeros from the
end of the input polynomial. That is, it returns `p[:i]` where `i` is the
Expand Down Expand Up @@ -4218,8 +4220,8 @@ class Histogram(Valid[int, list[int], F]):
self,
output: list[F],
_num_measurements: int) -> list[int]:
return [bucket_count.as_unsigned() \
for bucket_count in output]
return [bucket_count.as_unsigned()
for bucket_count in output]
~~~

### Prio3MultihotCountVec
Expand Down Expand Up @@ -4261,7 +4263,7 @@ zero if and only if the reported weight is equal to the true weight. The
complete circuit is defined below.

~~~ python
class MultihotCountVec(Valid[list[int], list[int], F,]):
class MultihotCountVec(Valid[list[int], list[int], F]):
EVAL_OUTPUT_LEN = 2
field: type[F]

Expand Down Expand Up @@ -4301,8 +4303,8 @@ class MultihotCountVec(Valid[list[int], list[int], F,]):
ParallelSum(Mul(), chunk_length),
]
self.GADGET_CALLS = [
(length + self.bits_for_weight + chunk_length - 1) \
// chunk_length
(length + self.bits_for_weight + chunk_length - 1)
// chunk_length
]
self.MEAS_LEN = self.length + self.bits_for_weight
self.OUTPUT_LEN = self.length
Expand Down Expand Up @@ -4373,7 +4375,7 @@ class MultihotCountVec(Valid[list[int], list[int], F,]):
self,
output: list[F],
_num_measurements: int) -> list[int]:
return [bucket_count.as_unsigned() for \
return [bucket_count.as_unsigned() for
bucket_count in output]
~~~

Expand Down
2 changes: 1 addition & 1 deletion poc/tests/test_flp_bbcggi19.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test(self) -> None:

class TestGadgets(TestFlpBBCGGI19):
def test_poly_eval_range2(self) -> None:
self.run_gadget_test(PolyEval([0, 0, 1]), Field128, 10)
self.run_gadget_test(PolyEval([0, -1, 1]), Field128, 10)

def test_poly_eval(self) -> None:
self.run_gadget_test(
Expand Down
2 changes: 1 addition & 1 deletion poc/vdaf_poc/flp_bbcggi19.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def test_vec_set_type_param(self, test_vec: dict[str, Any]) -> list[str]:
# NOTE: This class is excerpted in the document. Its width should be
# limited to 69 columns to avoid warnings from xml2rfc.
# ===================================================================
class MultihotCountVec(Valid[list[int], list[int], F,]):
class MultihotCountVec(Valid[list[int], list[int], F]):
# REMOVE ME
"""
A validity circuit that checks each Client's measurement is a bit
Expand Down

0 comments on commit 5dab644

Please sign in to comment.