EccInstructions::mul: take Self::ScalarVar instead of Chip::Var.

This commit is contained in:
therealyingtong 2022-03-22 12:35:06 +08:00
parent 72ff677776
commit 6d83db719e
2 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ pub trait EccInstructions<C: CurveAffine>:
fn mul( fn mul(
&self, &self,
layouter: &mut impl Layouter<C::Base>, layouter: &mut impl Layouter<C::Base>,
scalar: &Self::Var, scalar: &Self::ScalarVar,
base: &Self::NonIdentityPoint, base: &Self::NonIdentityPoint,
) -> Result<(Self::Point, Self::ScalarVar), Error>; ) -> Result<(Self::Point, Self::ScalarVar), Error>;
@ -259,7 +259,7 @@ impl<C: CurveAffine, EccChip: EccInstructions<C>> NonIdentityPoint<C, EccChip> {
pub fn mul( pub fn mul(
&self, &self,
mut layouter: impl Layouter<C::Base>, mut layouter: impl Layouter<C::Base>,
by: &EccChip::Var, by: &EccChip::ScalarVar,
) -> Result<(Point<C, EccChip>, ScalarVar<C, EccChip>), Error> { ) -> Result<(Point<C, EccChip>, ScalarVar<C, EccChip>), Error> {
self.chip self.chip
.mul(&mut layouter, by, &self.inner.clone()) .mul(&mut layouter, by, &self.inner.clone())

View File

@ -471,7 +471,7 @@ where
fn mul( fn mul(
&self, &self,
layouter: &mut impl Layouter<pallas::Base>, layouter: &mut impl Layouter<pallas::Base>,
scalar: &Self::Var, scalar: &Self::ScalarVar,
base: &Self::NonIdentityPoint, base: &Self::NonIdentityPoint,
) -> Result<(Self::Point, Self::ScalarVar), Error> { ) -> Result<(Self::Point, Self::ScalarVar), Error> {
let config = self.config().mul; let config = self.config().mul;