diff --git a/r1cs-std/src/fields/mod.rs b/r1cs-std/src/fields/mod.rs index d92042f..513b35a 100644 --- a/r1cs-std/src/fields/mod.rs +++ b/r1cs-std/src/fields/mod.rs @@ -236,8 +236,8 @@ pub trait FieldGadget: if found_one { res.square_in_place(cs.ns(|| format!("square for bit {:?}", i)))?; } - - if !bit { + + if bit { found_one = true; res.mul_in_place(cs.ns(|| format!("mul for bit {:?}", i)), self)?; }