Browse Source

Fix base scalar multiplication (#117)

master
Pascal Berrang 1 year ago
committed by GitHub
parent
commit
b477880a3b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      src/groups/curves/short_weierstrass/mod.rs
  3. +1
    -1
      src/groups/mod.rs

+ 1
- 0
CHANGELOG.md

@ -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

+ 1
- 1
src/groups/curves/short_weierstrass/mod.rs

@ -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(())
}
}

+ 1
- 1
src/groups/mod.rs

@ -134,7 +134,7 @@ pub trait CurveVar:
// else, set self = self;
result = bit.borrow().select(&self_plus_base, &result)?;
}
*self = result;
*self += result;
Ok(())
}

Loading…
Cancel
Save