Skip to content

Commit

Permalink
feat(circom): Add tests to IsEqaulArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-nikolov96 committed Jun 27, 2023
1 parent dfb10fe commit 43b2d3c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
4 changes: 1 addition & 3 deletions beacon-light-client/circom/circuits/utils/numerical.circom
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ template DivisionVerification() {
signal input quotient;
signal input remainder;

//TODO: Needs additional constraint
//TODO: Needs additional corebase nstraint
dividend === divisor * quotient + remainder;
}

Expand All @@ -66,5 +66,3 @@ template Pow(N){

out <== selector.out;
}

component main = Pow(256);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma circom 2.1.5;

include "../../circuits/utils/arrays.circom";

component main = IsEqualArrays(3); // N must be equal to length in both arrays in input["in"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": [["1","2","2"],["1","2","2"]]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"out": "1"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": [["100","2","2"],["1","2","101"]]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"out": "0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"in": [["10","8","7"],["7","8","10"]]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"out": "0"}
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
pragma circom 2.1.5;

include "../../circuits/utils/arrays.circom";
include "../../circuits/utils/numerical.circom";

<<<<<<< HEAD
<<<<<<< HEAD
component main = LessThanOrEqualBitsCheck(32);
=======
component main = Selector(8) // N must be equal to input["in"] length
>>>>>>> 7f6ce53 (feat(circom) Add tests for Selector circuit.)
=======
component main = LessThanOrEqualBitsCheck(32)
>>>>>>> 5452718 (fix(circom): Fix wrong main call for selector and less_than_eq_bits_check.)
2 changes: 1 addition & 1 deletion beacon-light-client/circom/test/selector/circuit.circom
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pragma circom 2.1.5;

include "../../circuits/utils/arrays.circom";

component main = Selector(32) // N must be equal to input["in"] length
component main = Selector(8); // N must be equal to input["in"] length

0 comments on commit 43b2d3c

Please sign in to comment.