-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assert that the binary decomposition of a variable is less than …
…the modulus (#835) The issue was reported by Marcin Kostrzewa @ Reilabs (@kustosz). * test: add internal regression test pacakge for tracking filed bugs * test: add test for reproducing non-unique binary decomposition * refactor: make comparison against a constant bound public Even though the method is public this method is not listable as we export interfaces with smaller method sets. The method can be accessed by implicitly implementing interface with the method `MustBeLessOrEqCst(aBits []frontend.Variable, bound *big.Int, aForDebug frontend.Variable)`. We use the method for checking in `std/math/bits` package that the binary decomposition of the bound returned by hint is less than the modulus. * feat: add option to omit uniqueness check when binary decomposing value * fix: check that the binary decomposition is unique when nbBits=modlen * refactor: use bits gadget directly for option control * docs: describe in documentation alternatives to Cmp and LEQ * test: add test for math/cmp cases * feat: add TestEngine checking * test: reduce binary decomposition length to accomodate tinyfield * refactor: rename to OmitModulusCheck * fix: limit decomposition length to fieldbitlen * feat: allow less than nbBits in constant comparison * test: update circuit statistics * feat: allow decomposition length be longer than field length * Revert "feat: add TestEngine checking" This reverts commit 8da5d07. * test: implement constant comparison for test engine * test: rename file to track issue
- Loading branch information
Showing
13 changed files
with
346 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package regressiontests includes tests to avoid re-introducing regressions. | ||
package regressiontests |
Oops, something went wrong.