Skip to content

Commit

Permalink
feat: replace single bit range constraints with basic bool gates (Azt…
Browse files Browse the repository at this point in the history
…ecProtocol#4164)

This PR pulls the optimisation made in
noir-lang/noir#3234 across into the backend.
  • Loading branch information
TomAFrench authored Jan 25, 2024
1 parent 6de36b3 commit 0a3553b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase<typename Arithmetization:
std::string const msg = "create_new_range_constraint");
void create_range_constraint(const uint32_t variable_index, const size_t num_bits, std::string const& msg)
{
if (num_bits <= DEFAULT_PLOOKUP_RANGE_BITNUM) {
if (num_bits == 1) {
create_bool_gate(variable_index);
} else if (num_bits <= DEFAULT_PLOOKUP_RANGE_BITNUM) {
/**
* N.B. if `variable_index` is not used in any arithmetic constraints, this will create an unsatisfiable
* circuit!
Expand Down

0 comments on commit 0a3553b

Please sign in to comment.