Skip to content

Commit b477880

Browse files
authored
Fix base scalar multiplication (#117)
1 parent 69003c8 commit b477880

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CHANGELOG
22

33
## Pending
4+
- [\#117](https://github.com/arkworks-rs/r1cs-std/pull/117) Fix result of `precomputed_base_scalar_mul_le` to not discard previous value.
45

56
### Breaking changes
67

src/groups/curves/short_weierstrass/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ where
559559
.map(|(b, c)| (b.borrow().clone(), *c))
560560
.unzip();
561561
let base = bases[0];
562-
*self = Self::constant(base).scalar_mul_le(bits.iter())?;
562+
*self += Self::constant(base).scalar_mul_le(bits.iter())?;
563563
Ok(())
564564
}
565565
}

src/groups/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub trait CurveVar<C: CurveGroup, ConstraintF: Field>:
134134
// else, set self = self;
135135
result = bit.borrow().select(&self_plus_base, &result)?;
136136
}
137-
*self = result;
137+
*self += result;
138138
Ok(())
139139
}
140140

0 commit comments

Comments
 (0)