From 5dab6445e404dfbbd09cad934291ec5e53958f99 Mon Sep 17 00:00:00 2001 From: Christopher Patton Date: Thu, 10 Oct 2024 07:30:22 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Cook --- draft-irtf-cfrg-vdaf.md | 18 ++++++++++-------- poc/tests/test_flp_bbcggi19.py | 2 +- poc/vdaf_poc/flp_bbcggi19.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/draft-irtf-cfrg-vdaf.md b/draft-irtf-cfrg-vdaf.md index b27164db..3ab87cc9 100644 --- a/draft-irtf-cfrg-vdaf.md +++ b/draft-irtf-cfrg-vdaf.md @@ -830,7 +830,9 @@ 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 @@ -838,7 +840,7 @@ Some common functionalities: 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 @@ -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 @@ -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] @@ -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 @@ -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] ~~~ diff --git a/poc/tests/test_flp_bbcggi19.py b/poc/tests/test_flp_bbcggi19.py index 38ae5feb..fd100bab 100644 --- a/poc/tests/test_flp_bbcggi19.py +++ b/poc/tests/test_flp_bbcggi19.py @@ -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( diff --git a/poc/vdaf_poc/flp_bbcggi19.py b/poc/vdaf_poc/flp_bbcggi19.py index 9a55c7ce..8dc7ead6 100644 --- a/poc/vdaf_poc/flp_bbcggi19.py +++ b/poc/vdaf_poc/flp_bbcggi19.py @@ -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