Skip to content

Commit

Permalink
Totalize calculation of square root.
Browse files Browse the repository at this point in the history
Since this is a flagged operation, it must never fail.
  • Loading branch information
acoglio committed Oct 27, 2023
1 parent ca3699d commit 532033f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion circuit/types/field/src/square_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<E: Environment> Field<E> {
// The called function square_root returns the square root closer to 0.
let root_witness = match self.eject_value().square_root() {
Ok(root) => root,
Err(_) => E::halt("Failed to calculate square root witness"),
Err(_) => console::Field::zero(),
};

// In order to avoid actually calculating the square root in the circuit,
Expand Down

0 comments on commit 532033f

Please sign in to comment.