Skip to content

Commit

Permalink
Merge pull request #48 from kobigurk/kobigurk/fix_and_assert_less_than
Browse files Browse the repository at this point in the history
fix: improve LessThan and adds assert
  • Loading branch information
jbaylina authored Aug 24, 2020
2 parents 01e3f0d + 1cd3d20 commit 3f4734d
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 45 deletions.
3 changes: 2 additions & 1 deletion circuits/comparators.circom
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ template LessThan(n) {
*/

template LessThan(n) {
assert(n <= 252);
signal input in[2];
signal output out;

component n2b = Num2Bits(n*2+1);
component n2b = Num2Bits(n+1);

n2b.in <== in[0]+ (1<<n) - in[1];

Expand Down
175 changes: 132 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"blake-hash": "^1.1.0",
"blake2b": "^2.1.3",
"circom": "0.5.10",
"circom": "0.5.21",
"ffjavascript": "0.1.0",
"web3": "^1.2.6"
},
Expand Down

0 comments on commit 3f4734d

Please sign in to comment.