-
Notifications
You must be signed in to change notification settings - Fork 516
bug: restrict nbDigits in std/math/bitslice Partition method #1153
Copy link
Copy link
Closed
Labels
type: bugSomething isn't workingSomething isn't workingtype: consolidatestrengthen an existing featurestrengthen an existing feature
Description
Description
The method was provided for allowing to efficiently split variables into lower and upper part without needing for a binary decomposition. It works well when nbDigits is smaller than the modulus bitlength, but in case nbDigits equal modulus bitlength (or is undefined), then we're currently underconstraining the result as we could have both lower + 2^split upper equal input or input+modulus. But when we would to strict comparison against the modulus, then the added overhead wouldn't be worth it to use as a separate method and should be keep using binary decomposition directly.
Additionally, there is additional bug in
gnark/std/math/bitslice/partition.go
Line 61 in 6ec0af7
| rh.Check(upper, upperBound) |
rh.Check(upper, upperBound)instead of
rh.Check(upper, upperBound - int(split))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't workingSomething isn't workingtype: consolidatestrengthen an existing featurestrengthen an existing feature