From cba74c09d9fb9b90e8720275fed8d51d18708d72 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Fri, 28 Feb 2020 20:19:20 -0800 Subject: [PATCH] Fix error --- r1cs-std/src/fields/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)?; }