Skip to content

bug: restrict nbDigits in std/math/bitslice Partition method #1153

@ivokub

Description

@ivokub

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

rh.Check(upper, upperBound)
where we check

rh.Check(upper, upperBound)

instead of

rh.Check(upper, upperBound - int(split))

Metadata

Metadata

Assignees

Labels

type: bugSomething isn't workingtype: consolidatestrengthen an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions