Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh0g0-1758 committed Sep 27, 2024
1 parent fefaefd commit fa837ee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/vm/builtins/modulo.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ func (m *ModBuiltin) fillValue(mem *memory.Memory, inputs ModBuiltinInputs, inde
} else {
value = *new(big.Int).Mul(a, b)
}
// value - (kBound - 1) * p <= intLim - 1
if new(big.Int).Sub(&value, new(big.Int).Mul((new(big.Int).Sub(kBound, big.NewInt(1))), &inputs.p)).Cmp(new(big.Int).Sub(intLim, big.NewInt(1))) == 1 {
return false, fmt.Errorf("%s builtin: Expected a %s b - %d * p <= %d", m.String(), m.modBuiltinType, kBound.Sub(kBound, big.NewInt(1)), intLim.Sub(intLim, big.NewInt(1)))
}
Expand Down

0 comments on commit fa837ee

Please sign in to comment.