diff --git a/beacon-light-client/circom/circuits/is_valid_merkle_branch_out.circom b/beacon-light-client/circom/circuits/is_valid_merkle_branch_out.circom index 52694df67..14f4943e2 100644 --- a/beacon-light-client/circom/circuits/is_valid_merkle_branch_out.circom +++ b/beacon-light-client/circom/circuits/is_valid_merkle_branch_out.circom @@ -1,8 +1,8 @@ -pragma circom 2.0.3; +pragma circom 2.1.5; include "hash_two.circom"; include "../../../node_modules/circomlib/circuits/comparators.circom"; -include "utils.circom"; +include "utils/arrays.circom"; template IsValidMerkleBranchOut(N) { signal input branch[N][256]; @@ -33,6 +33,5 @@ template IsValidMerkleBranchOut(N) { } } - out <== IsEqualArrays(256)([root, hashers[N - 1].out]); } diff --git a/beacon-light-client/circom/circuits/utils.circom b/beacon-light-client/circom/circuits/utils.circom deleted file mode 100644 index 9a0cf2d01..000000000 --- a/beacon-light-client/circom/circuits/utils.circom +++ /dev/null @@ -1,52 +0,0 @@ -pragma circom 2.1.5; - -include "../../../node_modules/circomlib/circuits/comparators.circom"; -include "../../../node_modules/circomlib/circuits/bitify.circom"; - -template LessThanBitsCheck(n) { - signal input in[2]; - signal output out; - - signal bitCheck1[n] <== Num2Bits(n)(in[0]); - - signal bitCheck2[n] <== Num2Bits(n)(in[1]); - - out <== LessThan(n)(in); -} - -template LessThanOrEqualBitsCheck(n) { - signal input in[2]; - signal output out; - - signal bitCheck1[n] <== Num2Bits(n)(in[0]); - - signal bitCheck2[n] <== Num2Bits(n)(in[1]); - - out <== LessEqThan(n)(in); -} - -template RangeCheck(n) { - signal input in[3]; - signal output out; - - signal first <== LessThanBitsCheck(64)([in[0], in[1]]); - signal second <== LessThanBitsCheck(64)([in[1], in[2]]); - - out <== first * second; -} - -template IsEqualArrays(N) { - signal input in[2][N]; - signal output out; - - signal isEqual[N]; - var counter = 0; - - for(var i = 0; i < N; i++) { - isEqual[i] <== IsEqual()([in[0][i], in[1][i]]); - - counter += isEqual[i]; - } - - out <== IsEqual()([N, counter]); -} diff --git a/beacon-light-client/circom/circuits/utils/arrays.circom b/beacon-light-client/circom/circuits/utils/arrays.circom new file mode 100644 index 000000000..475e62c95 --- /dev/null +++ b/beacon-light-client/circom/circuits/utils/arrays.circom @@ -0,0 +1,44 @@ +pragma circom 2.1.5; + +include "../../../../node_modules/circomlib/circuits/comparators.circom"; +include "../../../../node_modules/circomlib/circuits/bitify.circom"; + +template Selector(N) { + signal input in[N]; + signal input index; + signal output out; + + signal sums[N + 1]; + sums[0] <== 0; + + component eqs[N]; + + // For each item, check whether its index equals the input index. + for (var i = 0; i < N; i ++) { + eqs[i] = IsEqual(); + eqs[i].in[0] <== i; + eqs[i].in[1] <== index; + + // eqs[i].out is 1 if the index matches. As such, at most one input to + sums[i + 1] <== sums[i] + eqs[i].out * in[i]; + } + + // Returns 0 + 0 + ... + item + out <== sums[N]; +} + +template IsEqualArrays(N) { + signal input in[2][N]; + signal output out; + + signal isEqual[N]; + var counter = 0; + + for(var i = 0; i < N; i++) { + isEqual[i] <== IsEqual()([in[0][i], in[1][i]]); + + counter += isEqual[i]; + } + + out <== IsEqual()([N, counter]); +} diff --git a/beacon-light-client/circom/circuits/utils/bits.circom b/beacon-light-client/circom/circuits/utils/bits.circom new file mode 100644 index 000000000..e6bc7aa64 --- /dev/null +++ b/beacon-light-client/circom/circuits/utils/bits.circom @@ -0,0 +1,26 @@ +pragma circom 2.1.5; + +include "../../../../node_modules/circomlib/circuits/comparators.circom"; +include "../../../../node_modules/circomlib/circuits/bitify.circom"; + +template LessThanBitsCheck(n) { + signal input in[2]; + signal output out; + + signal bitCheck1[n] <== Num2Bits(n)(in[0]); + + signal bitCheck2[n] <== Num2Bits(n)(in[1]); + + out <== LessThan(n)(in); +} + +template LessThanOrEqualBitsCheck(n) { + signal input in[2]; + signal output out; + + signal bitCheck1[n] <== Num2Bits(n)(in[0]); + + signal bitCheck2[n] <== Num2Bits(n)(in[1]); + + out <== LessEqThan(n)(in); +} \ No newline at end of file diff --git a/beacon-light-client/circom/circuits/utils/numerical.circom b/beacon-light-client/circom/circuits/utils/numerical.circom new file mode 100644 index 000000000..5ffee1ec6 --- /dev/null +++ b/beacon-light-client/circom/circuits/utils/numerical.circom @@ -0,0 +1,68 @@ +pragma circom 2.1.5; + +include "../../../../node_modules/circomlib/circuits/comparators.circom"; +include "../../../../node_modules/circomlib/circuits/bitify.circom"; +include "arrays.circom"; + +template LessThanBitsCheck(n) { + signal input in[2]; + signal output out; + + signal bitCheck1[n] <== Num2Bits(n)(in[0]); + + signal bitCheck2[n] <== Num2Bits(n)(in[1]); + + out <== LessThan(n)(in); +} + +template LessThanOrEqualBitsCheck(n) { + signal input in[2]; + signal output out; + + signal bitCheck1[n] <== Num2Bits(n)(in[0]); + + signal bitCheck2[n] <== Num2Bits(n)(in[1]); + + out <== LessEqThan(n)(in); +} + +template RangeCheck(n) { + signal input in[3]; + signal output out; + + signal first <== LessThanBitsCheck(n)([in[0], in[1]]); + signal second <== LessThanBitsCheck(n)([in[1], in[2]]); + + out <== first * second; +} + +template DivisionVerification() { + signal input dividend; + signal input divisor; + signal input quotient; + signal input remainder; + + //TODO: Needs additional corebase nstraint + dividend === divisor * quotient + remainder; +} + +template Pow(N){ + signal input base; + signal input power; + signal output out; + + assert(power < N); + + signal intermediary[N]; + for (var i=0; i < N; i++) { + intermediary[i] <== i == 0 ? 1 : (intermediary[i-1] * base); + } + + component selector = Selector(N); + for (var i = 0; i < N; i++) { + selector.in[i] <== intermediary[i]; + } + selector.index <== power; + + out <== selector.out; +} diff --git a/beacon-light-client/circom/circuits/validator_balances.circom b/beacon-light-client/circom/circuits/validator_balances.circom index 402e542d4..0a2917236 100644 --- a/beacon-light-client/circom/circuits/validator_balances.circom +++ b/beacon-light-client/circom/circuits/validator_balances.circom @@ -1,46 +1,15 @@ pragma circom 2.1.5; include "../../../node_modules/circomlib/circuits/bitify.circom"; -include "utils.circom"; include "hash_tree_root.circom"; include "hash_two.circom"; include "validator_hash_tree_root.circom"; include "is_valid_merkle_branch_out.circom"; include "is_valid_merkle_branch.circom"; include "ssz_num.circom"; - -template DivisionVerification() { - signal input dividend; - signal input divisor; - signal input quotient; - signal input remainder; - - dividend === divisor * quotient + remainder; -} - -template Selector(N) { - signal input in[N]; - signal input index; - signal output out; - - signal sums[N + 1]; - sums[0] <== 0; - - component eqs[N]; - - // For each item, check whether its index equals the input index. - for (var i = 0; i < N; i ++) { - eqs[i] = IsEqual(); - eqs[i].in[0] <== i; - eqs[i].in[1] <== index; - - // eqs[i].out is 1 if the index matches. As such, at most one input to - sums[i + 1] <== sums[i] + eqs[i].out * in[i]; - } - - // Returns 0 + 0 + ... + item - out <== sums[N]; -} +include "./utils/arrays.circom"; +include "./utils/bits.circom"; +include "./utils/numerical.circom"; template CalculateBalancesSum(N) { signal input balances[(N \ 4) + 1][256]; diff --git a/beacon-light-client/circom/test/is_equal_arrays/circuit.circom b/beacon-light-client/circom/test/is_equal_arrays/circuit.circom new file mode 100644 index 000000000..8d517930f --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/circuit.circom @@ -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"] diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json new file mode 100644 index 000000000..3f047d2c5 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case01/input.json @@ -0,0 +1 @@ +{"in": [["1","2","2"],["1","2","2"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json new file mode 100644 index 000000000..f4209a168 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case01/output.json @@ -0,0 +1 @@ +{"out": "1"} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json new file mode 100644 index 000000000..23271aee5 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case02/input.json @@ -0,0 +1 @@ +{"in": [["100","2","2"],["1","2","101"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json new file mode 100644 index 000000000..8b71f4187 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case02/output.json @@ -0,0 +1 @@ +{"out": "0"} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json b/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json new file mode 100644 index 000000000..9a6d16302 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case03/input.json @@ -0,0 +1 @@ +{"in": [["10","8","7"],["7","8","10"]]} diff --git a/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json b/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json new file mode 100644 index 000000000..8b71f4187 --- /dev/null +++ b/beacon-light-client/circom/test/is_equal_arrays/data/case03/output.json @@ -0,0 +1 @@ +{"out": "0"} diff --git a/beacon-light-client/circom/test/less_than_bits_check/circuit.circom b/beacon-light-client/circom/test/less_than_bits_check/circuit.circom new file mode 100644 index 000000000..e646ee633 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/numerical.circom"; + +component main = LessThanBitsCheck(32); diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case01/input.json b/beacon-light-client/circom/test/less_than_bits_check/data/case01/input.json new file mode 100644 index 000000000..68d349081 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case01/input.json @@ -0,0 +1,3 @@ +{ + "in": ["100","50"] +} diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case01/output.json b/beacon-light-client/circom/test/less_than_bits_check/data/case01/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case01/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case02/input.json b/beacon-light-client/circom/test/less_than_bits_check/data/case02/input.json new file mode 100644 index 000000000..2a7b534b8 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case02/input.json @@ -0,0 +1,3 @@ +{ + "in": ["1","2"] +} diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case02/output.json b/beacon-light-client/circom/test/less_than_bits_check/data/case02/output.json new file mode 100644 index 000000000..8575e58cd --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case02/output.json @@ -0,0 +1,3 @@ +{ + "out": "1" +} diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case03/input.json b/beacon-light-client/circom/test/less_than_bits_check/data/case03/input.json new file mode 100644 index 000000000..9f54db27d --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case03/input.json @@ -0,0 +1,3 @@ +{ + "in": ["1","1"] +} diff --git a/beacon-light-client/circom/test/less_than_bits_check/data/case03/output.json b/beacon-light-client/circom/test/less_than_bits_check/data/case03/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_bits_check/data/case03/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/circuit.circom b/beacon-light-client/circom/test/less_than_eq_bits_check/circuit.circom new file mode 100644 index 000000000..29b65cdcc --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/numerical.circom"; + +component main = LessThanOrEqualBitsCheck(32); diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/input.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/input.json new file mode 100644 index 000000000..68d349081 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/input.json @@ -0,0 +1,3 @@ +{ + "in": ["100","50"] +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/output.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case01/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/input.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/input.json new file mode 100644 index 000000000..2a7b534b8 --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/input.json @@ -0,0 +1,3 @@ +{ + "in": ["1","2"] +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/output.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/output.json new file mode 100644 index 000000000..8575e58cd --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case02/output.json @@ -0,0 +1,3 @@ +{ + "out": "1" +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/input.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/input.json new file mode 100644 index 000000000..9f54db27d --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/input.json @@ -0,0 +1,3 @@ +{ + "in": ["1","1"] +} diff --git a/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/output.json b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/output.json new file mode 100644 index 000000000..8575e58cd --- /dev/null +++ b/beacon-light-client/circom/test/less_than_eq_bits_check/data/case03/output.json @@ -0,0 +1,3 @@ +{ + "out": "1" +} diff --git a/beacon-light-client/circom/test/pow/circuit.circom b/beacon-light-client/circom/test/pow/circuit.circom new file mode 100644 index 000000000..85a0aff57 --- /dev/null +++ b/beacon-light-client/circom/test/pow/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/numerical.circom"; + +component main = Pow(256); diff --git a/beacon-light-client/circom/test/pow/data/case01/input.json b/beacon-light-client/circom/test/pow/data/case01/input.json new file mode 100644 index 000000000..49a279f00 --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case01/input.json @@ -0,0 +1 @@ +{"base": "10", "power": "3"} diff --git a/beacon-light-client/circom/test/pow/data/case01/output.json b/beacon-light-client/circom/test/pow/data/case01/output.json new file mode 100644 index 000000000..7d20147b5 --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case01/output.json @@ -0,0 +1,3 @@ +{ + "out": "1000" +} diff --git a/beacon-light-client/circom/test/pow/data/case02/input.json b/beacon-light-client/circom/test/pow/data/case02/input.json new file mode 100644 index 000000000..993d63a28 --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case02/input.json @@ -0,0 +1,4 @@ +{ + "base": "2", + "power": "10" +} diff --git a/beacon-light-client/circom/test/pow/data/case02/output.json b/beacon-light-client/circom/test/pow/data/case02/output.json new file mode 100644 index 000000000..f727e391f --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case02/output.json @@ -0,0 +1,3 @@ +{ + "out": "1024" +} diff --git a/beacon-light-client/circom/test/pow/data/case03/input.json b/beacon-light-client/circom/test/pow/data/case03/input.json new file mode 100644 index 000000000..daede4e19 --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case03/input.json @@ -0,0 +1,4 @@ +{ + "base": "99", + "power": "1" +} diff --git a/beacon-light-client/circom/test/pow/data/case03/output.json b/beacon-light-client/circom/test/pow/data/case03/output.json new file mode 100644 index 000000000..891f5eea5 --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case03/output.json @@ -0,0 +1,3 @@ +{ + "out": "99" +} diff --git a/beacon-light-client/circom/test/pow/data/case04/input.json b/beacon-light-client/circom/test/pow/data/case04/input.json new file mode 100644 index 000000000..1e31fc28d --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case04/input.json @@ -0,0 +1,4 @@ +{ + "base": "1", + "power": "100" +} diff --git a/beacon-light-client/circom/test/pow/data/case04/output.json b/beacon-light-client/circom/test/pow/data/case04/output.json new file mode 100644 index 000000000..8575e58cd --- /dev/null +++ b/beacon-light-client/circom/test/pow/data/case04/output.json @@ -0,0 +1,3 @@ +{ + "out": "1" +} diff --git a/beacon-light-client/circom/test/range_check/circuit.circom b/beacon-light-client/circom/test/range_check/circuit.circom new file mode 100644 index 000000000..41ac857d6 --- /dev/null +++ b/beacon-light-client/circom/test/range_check/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/numerical.circom"; + +component main = RangeCheck(32); diff --git a/beacon-light-client/circom/test/range_check/data/case01/input.json b/beacon-light-client/circom/test/range_check/data/case01/input.json new file mode 100644 index 000000000..dbfd86aed --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case01/input.json @@ -0,0 +1 @@ +{"in": ["1","2","3"]} diff --git a/beacon-light-client/circom/test/range_check/data/case01/output.json b/beacon-light-client/circom/test/range_check/data/case01/output.json new file mode 100644 index 000000000..8575e58cd --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case01/output.json @@ -0,0 +1,3 @@ +{ + "out": "1" +} diff --git a/beacon-light-client/circom/test/range_check/data/case02/input.json b/beacon-light-client/circom/test/range_check/data/case02/input.json new file mode 100644 index 000000000..30acbcb2e --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case02/input.json @@ -0,0 +1 @@ +{"in": ["3","2","1"]} diff --git a/beacon-light-client/circom/test/range_check/data/case02/output.json b/beacon-light-client/circom/test/range_check/data/case02/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case02/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/range_check/data/case03/input.json b/beacon-light-client/circom/test/range_check/data/case03/input.json new file mode 100644 index 000000000..e5f399fe0 --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case03/input.json @@ -0,0 +1 @@ +{"in": ["2","2","3"]} diff --git a/beacon-light-client/circom/test/range_check/data/case03/output.json b/beacon-light-client/circom/test/range_check/data/case03/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case03/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/range_check/data/case04/input.json b/beacon-light-client/circom/test/range_check/data/case04/input.json new file mode 100644 index 000000000..2c8a6a40f --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case04/input.json @@ -0,0 +1 @@ +{"in": ["1","2","2"]} diff --git a/beacon-light-client/circom/test/range_check/data/case04/output.json b/beacon-light-client/circom/test/range_check/data/case04/output.json new file mode 100644 index 000000000..fcf6c9a06 --- /dev/null +++ b/beacon-light-client/circom/test/range_check/data/case04/output.json @@ -0,0 +1,3 @@ +{ + "out": "0" +} diff --git a/beacon-light-client/circom/test/selector/circuit.circom b/beacon-light-client/circom/test/selector/circuit.circom new file mode 100644 index 000000000..c94a2f259 --- /dev/null +++ b/beacon-light-client/circom/test/selector/circuit.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../../circuits/utils/arrays.circom"; + +component main = Selector(8); // N must be equal to input["in"] length diff --git a/beacon-light-client/circom/test/selector/data/case01/input.json b/beacon-light-client/circom/test/selector/data/case01/input.json new file mode 100644 index 000000000..d0b157df3 --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case01/input.json @@ -0,0 +1,4 @@ +{ + "in": ["1","2","3","4","5","6","7","8"], + "index": "4" +} diff --git a/beacon-light-client/circom/test/selector/data/case01/output.json b/beacon-light-client/circom/test/selector/data/case01/output.json new file mode 100644 index 000000000..d84af3026 --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case01/output.json @@ -0,0 +1,3 @@ +{ + "out": "5" +} diff --git a/beacon-light-client/circom/test/selector/data/case02/input.json b/beacon-light-client/circom/test/selector/data/case02/input.json new file mode 100644 index 000000000..3bd6eea7a --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case02/input.json @@ -0,0 +1,4 @@ +{ + "in": ["123","123","123","123","123","123","123","99"], + "index": "7" +} diff --git a/beacon-light-client/circom/test/selector/data/case02/output.json b/beacon-light-client/circom/test/selector/data/case02/output.json new file mode 100644 index 000000000..891f5eea5 --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case02/output.json @@ -0,0 +1,3 @@ +{ + "out": "99" +} diff --git a/beacon-light-client/circom/test/selector/data/case03/input.json b/beacon-light-client/circom/test/selector/data/case03/input.json new file mode 100644 index 000000000..9219ace0d --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case03/input.json @@ -0,0 +1,4 @@ +{ + "in": ["99","123","123","123","123","123","123","123"], + "index": "0" +} diff --git a/beacon-light-client/circom/test/selector/data/case03/output.json b/beacon-light-client/circom/test/selector/data/case03/output.json new file mode 100644 index 000000000..891f5eea5 --- /dev/null +++ b/beacon-light-client/circom/test/selector/data/case03/output.json @@ -0,0 +1,3 @@ +{ + "out": "99" +}