mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-09 07:21:29 +01:00
Fix base scalar multiplication (#117)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
## Pending
|
## Pending
|
||||||
|
- [\#117](https://github.com/arkworks-rs/r1cs-std/pull/117) Fix result of `precomputed_base_scalar_mul_le` to not discard previous value.
|
||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ where
|
|||||||
.map(|(b, c)| (b.borrow().clone(), *c))
|
.map(|(b, c)| (b.borrow().clone(), *c))
|
||||||
.unzip();
|
.unzip();
|
||||||
let base = bases[0];
|
let base = bases[0];
|
||||||
*self = Self::constant(base).scalar_mul_le(bits.iter())?;
|
*self += Self::constant(base).scalar_mul_le(bits.iter())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ pub trait CurveVar<C: CurveGroup, ConstraintF: Field>:
|
|||||||
// else, set self = self;
|
// else, set self = self;
|
||||||
result = bit.borrow().select(&self_plus_base, &result)?;
|
result = bit.borrow().select(&self_plus_base, &result)?;
|
||||||
}
|
}
|
||||||
*self = result;
|
*self += result;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user