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