Skip to content

Commit

Permalink
want to check update
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKotov committed Sep 18, 2024
1 parent bb1e0e2 commit 3facaab
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ std::array<field_t<Builder>, 64> extend_witness(const std::array<field_t<Builder
w_out = witness_t<Builder>(
ctx, fr(w_out_raw.get_value().from_montgomery_form().data[0] & (uint64_t)0xffffffffULL));
}
field_pt divisor = w_out_raw / w_out;
constexpr fr inv_pow_two = fr(2).pow(32).invert();
field_pt w_out_raw_inv_pow_two = w_out_raw * inv_pow_two;
field_pt w_out_inv_pow_two = w_out * inv_pow_two;
field_pt divisor = (w_out_raw_inv_pow_two - w_out_inv_pow_two).normalize();
ctx->create_new_range_constraint(divisor.witness_index, 3);
fr power_two = fr(1).pow(32);
ctx->create_add_gate(
{ divisor.witness_index, w_out.witness_index, w_out_raw.witness_index, power_two, fr(1), fr(-1), fr(0) });
w_sparse[i] = sparse_witness_limbs(w_out);
}

Expand Down

0 comments on commit 3facaab

Please sign in to comment.