Skip to content

Commit 254db5e

Browse files
authored
fix(emulated): MulConst negative constant handling and correct mul-check formula comment (#1603)
1 parent 2721757 commit 254db5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

std/math/emulated/field_mul.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type deferredChecker interface {
8585
//
8686
// Given these values, the following holds:
8787
//
88-
// a * b = r * k*p
88+
// a * b = r + k*p
8989
//
9090
// But for asserting that the previous equation holds, we instead use the
9191
// polynomial representation of the elements. If a non-native element a is given
@@ -623,7 +623,7 @@ func (f *Field[T]) MulConst(a *Element[T], c *big.Int) *Element[T] {
623623
}
624624
switch c.Sign() {
625625
case -1:
626-
f.MulConst(f.Neg(a), new(big.Int).Neg(c))
626+
return f.MulConst(f.Neg(a), new(big.Int).Neg(c))
627627
case 0:
628628
return f.Zero()
629629
}

0 commit comments

Comments
 (0)