Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
- fix typo

- replace `/=` with `≠` in comments
  • Loading branch information
ntc2 committed Feb 7, 2024
1 parent 75b4f1a commit 60a9137
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion book/src/design/gadgets/decomposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ We now explain how all of these constraints are Plonk encoded:

1) We don't enforce this check in the $K$-high-low decomp gadget, but it's easily represented as the degree-1 constraint $\alpha - (2^K h + \ell) = 0$ when $\alpha$ is in the base field (i.e. when $m = b$). When $\alpha$ is not in the base field, this constraint can't be encoded without transporting $h$ and $\ell$ to $\alpha$'s field.

2) The condition $\ell < 2^K$ is encoded using the [power-of-2 range check gadget](#pow2-rc)to compute a value that is zero when $\ell < 2^K$. Behind the scenes this involves two table lookups and a small degree constraint; see the power-of-2 range check docs for more details.
2) The condition $\ell < 2^K$ is encoded using the [power-of-2 range check gadget](#pow2-rc) to compute a value that is zero when $\ell < 2^K$. Behind the scenes this involves two table lookups and a small degree constraint; see the power-of-2 range check docs for more details.

3) The condition $h \le H$ is encoded using the [generic range check gadget](#generic-rc) to compute a value that is zero when $h \le H$. Behind the scenes this involves various small degree constraints and lookups; see the generic range check docs for more details.

Expand Down
6 changes: 3 additions & 3 deletions halo2_gadgets/src/utilities/high_low_decomp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ where
// Constrain `h = h_max`, where `h_max = H`, the high
// `N-K` bits of the field modulus.
let h_is_max = h.clone() - h_max;
// Constrain `h /= h_max` for use in constraining
// Constrain `h h_max` for use in constraining
// `(h = h_max) => (l = 0)`.
//
// This one is a little subtle: constraints are
Expand Down Expand Up @@ -208,7 +208,7 @@ where
// satisfied. I.e. if c is satisfied then d is
// satisfied, i.e. (c => d) when c is true.
//
// 2) if c /= 0, then (c => d) is true independent of
// 2) if c 0, then (c => d) is true independent of
// d. Now either ((1 - c*eta) * d) is zero (true),
// because eta was chosen correctly, or ((1 -
// c*eta) * d) is non-zero (false), and the
Expand All @@ -230,7 +230,7 @@ where
// - already checked in the assignment function using strict range check
// - h = h_max => l = 0
// - which is equivalent to
// - h /= h_max \/ l = 0
// - h h_max \/ l = 0
// - h <= h_max
// - already checked in the assignment function using strict range check
Constraints::with_selector(
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/utilities/pow2_range_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<F: PrimeFieldBits, const K: usize> Config<F, K> {
// If `r == 0`, we just assign `low_r_bits` to zero. We use
// `assign_advice_from_constant`, so this guarantees that `r =
// 0` / the prover can't cheat, and we don't need to do the
// `short_range_check` from the `r /= 0` branch.
// `short_range_check` from the `r 0` branch.
let low_r_bits = if r == 0 {
layouter.assign_region(
|| "low_r_bits (== 0)",
Expand Down

0 comments on commit 60a9137

Please sign in to comment.