Browse Source

Fix ns issue

master
Pratyush Mishra 4 years ago
parent
commit
77837b4a1b
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      r1cs-std/src/fields/mod.rs

+ 3
- 6
r1cs-std/src/fields/mod.rs

@ -232,15 +232,12 @@ pub trait FieldGadget:
let mut res = Self::one(cs.ns(|| "Alloc result"))?;
let mut found_one = false;
for i in BitIterator::new(exp)
{
if found_one
{
for (i, bit) in BitIterator::new(exp).enumerate() {
if found_one {
res.square_in_place(cs.ns(|| format!("square for bit {:?}", i)))?;
}
if !i
{
if !bit {
found_one = true;
res.mul_in_place(cs.ns(|| format!("mul for bit {:?}", i)), self)?;
}

Loading…
Cancel
Save