Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial pass #521

Merged
merged 14 commits into from
Nov 2, 2024
375 changes: 200 additions & 175 deletions draft-irtf-cfrg-vdaf.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions poc/vdaf_poc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def vec_neg(vec: list[F]) -> list[F]:

def to_le_bytes(val: int, length: int) -> bytes:
"""
Convert unsigned integer `val` in range `[0, 2 ^ (8 * length))` to a
Convert unsigned integer `val` in the range `[0, 2 ^ (8 * length))` to a
little-endian byte string.
"""
val = int(val)
Expand All @@ -94,7 +94,7 @@ def from_le_bytes(encoded: bytes) -> int:

def to_be_bytes(val: int, length: int) -> bytes:
"""
Convert unsigned integer `val` in range `[0, 2 ^ (8 * length))` to a
Convert unsigned integer `val` in the range `[0, 2 ^ (8 * length))` to a
big-endian byte string.
"""
val = int(val)
Expand Down Expand Up @@ -150,9 +150,9 @@ def format_dst(algo_class: int,

Pre-conditions:

- `algo_class` in `[0, 2^8)`
- `algo` in `[0, 2^32)`
- `usage` in `[0, 2^16)`
- `algo_class` in the range `[0, 2^8)`
- `algo` in the range `[0, 2^32)`
- `usage` in the range `[0, 2^16)`
"""
return concat([
to_be_bytes(VERSION, 1),
Expand Down
4 changes: 2 additions & 2 deletions poc/vdaf_poc/daf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ def prep(
Prepare an input share for aggregation. This algorithm takes in the
public share and one of the input shares generated by the Client. It
also takes in the application context, the Aggregator's ID (a unique
integer in range `[0, SHARES)` corresponding to the index of
integer in the range `[0, SHARES)` corresponding to the index of
`input_share` in the Client's output), and an aggregation parameter and
returns the corresponding output share.

Pre-conditions:

- `agg_id` in `[0, daf.SHARES)`
- `agg_id` in the range `[0, daf.SHARES)`
- `len(nonce) == daf.NONCE_SIZE`
"""
pass
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 @@ -1020,7 +1020,7 @@ class Sum(Valid[int, int, F]):
def __init__(self, field: type[F], max_measurement: int):
# REMOVE ME
"""
A circuit that checks that the measurement is in range `[0,
A circuit that checks that the measurement is in the range `[0,
max_measurement]`. This is accomplished by encoding the
measurement as a bit vector, encoding the measurement plus an
offset as a bit vector, then checking that the two encoded
Expand Down
6 changes: 3 additions & 3 deletions poc/vdaf_poc/idpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def eval(self,

Pre-conditions:

- `agg_id` in `[0, self.SHARES)`
- `level` in `[0, self.BITS)`
- `agg_id` in the range `[0, self.SHARES)`
- `level` in the range `[0, self.BITS)`
- `len(prefix) == level + 1` for each `prefix` in `prefixes`
"""
pass
Expand All @@ -144,7 +144,7 @@ def is_prefix(self, x: tuple[bool, ...], y: tuple[bool, ...], level: int) -> boo

Pre-conditions:

- `level` in `[0, self.BITS)`
- `level` in the range `[0, self.BITS)`
"""
return x == y[:level + 1]

Expand Down
4 changes: 2 additions & 2 deletions poc/vdaf_poc/vdaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def prep_init(self,
Pre-conditions:

- `len(verify_key) == vdaf.VERIFY_KEY_SIZE`
- `agg_id` in `[0, vdaf.SHARES)`
- `agg_id` in the range `[0, vdaf.SHARES)`
- `len(nonce) == vdaf.NONCE_SIZE`
"""
pass
Expand Down Expand Up @@ -206,7 +206,7 @@ def domain_separation_tag(self, usage: int, ctx: bytes) -> bytes:

Pre-conditions:

- `usage` in `[0, 2^16)`
- `usage` in the range `[0, 2^16)`
"""
return format_dst(0, self.ID, usage) + ctx

Expand Down
2 changes: 1 addition & 1 deletion poc/vdaf_poc/vdaf_prio3.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Prio3(
ROUNDS = 1

xof: type[Xof]
PROOFS: int # Number of proofs, in range `[1, 256)`
PROOFS: int # Number of proofs, in the range `[1, 256)`

@abstractmethod
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion poc/vdaf_poc/xof.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def expand_into_vec(cls,
binder: bytes,
length: int) -> list[F]:
"""
Expand the input `seed` into vector of `length` field elements.
Expand the input `seed` into a vector of `length` field elements.

Pre-conditions:

Expand Down