Skip to content

Commit

Permalink
tweaked documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio95 committed Mar 18, 2024
1 parent eb2843e commit 9c71a23
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/less_than.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ fn get_msb_index<F: PrimeField + PrimeFieldBits>(n: F) -> u8 {
.0 as u8
}

// Range check: constrains input < `bound`. The bound must fit into
// `num_bits` bits (this is asserted in the circuit constructor).
// Constrains `input` < `bound`, where the LHS is a witness and the RHS is a
// constant. The bound must fit into `num_bits` bits (this is asserted in the
// circuit constructor).
// Important: it must be checked elsewhere (in an overarching circuit) that the
// input fits into `num_bits` bits - this is NOT constrained by this circuit
// in order to avoid duplications (hence "unsafe"). Cf. LessThanCircuitSafe for
Expand Down Expand Up @@ -115,8 +116,9 @@ impl<F: PrimeField + PrimeFieldBits> Circuit<F> for LessThanCircuitUnsafe<F> {
}
}

// Range check: constrains input < `bound`. The bound must fit into
// `num_bits` bits (this is asserted in the circuit constructor).
// Constrains `input` < `bound`, where the LHS is a witness and the RHS is a
// constant. The bound must fit into `num_bits` bits (this is asserted in the
// circuit constructor).
// Furthermore, the input must fit into `num_bits`, which is enforced at the
// constraint level.
#[derive(Clone, Debug)]
Expand Down

0 comments on commit 9c71a23

Please sign in to comment.