mirror of
https://github.com/arnaucube/grapevine-sonobe.git
synced 2026-01-12 17:01:31 +01:00
out of bounds on constraint gen maybe 2d array?
This commit is contained in:
4
circom/node_modules/circomlib/test/circuits/aliascheck_test.circom
generated
vendored
Normal file
4
circom/node_modules/circomlib/test/circuits/aliascheck_test.circom
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
pragma circom 2.0.0;
|
||||
include "../../circuits/aliascheck.circom";
|
||||
|
||||
component main = AliasCheck();
|
||||
4
circom/node_modules/circomlib/test/circuits/babyadd_tester.circom
generated
vendored
Normal file
4
circom/node_modules/circomlib/test/circuits/babyadd_tester.circom
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
pragma circom 2.0.0;
|
||||
include "../../circuits/babyjub.circom";
|
||||
|
||||
component main = BabyAdd();
|
||||
4
circom/node_modules/circomlib/test/circuits/babycheck_test.circom
generated
vendored
Normal file
4
circom/node_modules/circomlib/test/circuits/babycheck_test.circom
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
pragma circom 2.0.0;
|
||||
include "../../circuits/babyjub.circom";
|
||||
|
||||
component main = BabyCheck();
|
||||
4
circom/node_modules/circomlib/test/circuits/babypbk_test.circom
generated
vendored
Normal file
4
circom/node_modules/circomlib/test/circuits/babypbk_test.circom
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
pragma circom 2.0.0;
|
||||
include "../../circuits/babyjub.circom";
|
||||
|
||||
component main = BabyPbk();
|
||||
33
circom/node_modules/circomlib/test/circuits/binsub_test.circom
generated
vendored
Normal file
33
circom/node_modules/circomlib/test/circuits/binsub_test.circom
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/bitify.circom";
|
||||
include "../../circuits/binsub.circom";
|
||||
|
||||
template A() {
|
||||
signal input a; //private
|
||||
signal input b;
|
||||
signal output out;
|
||||
|
||||
var i;
|
||||
|
||||
component n2ba = Num2Bits(16);
|
||||
component n2bb = Num2Bits(16);
|
||||
component sub = BinSub(16);
|
||||
component b2n = Bits2Num(16);
|
||||
|
||||
n2ba.in <== a;
|
||||
n2bb.in <== b;
|
||||
|
||||
for (i=0; i<16; i++) {
|
||||
sub.in[0][i] <== n2ba.out[i];
|
||||
sub.in[1][i] <== n2bb.out[i];
|
||||
}
|
||||
|
||||
for (i=0; i<16; i++) {
|
||||
b2n.in[i] <== sub.out[i];
|
||||
}
|
||||
|
||||
out <== b2n.out;
|
||||
}
|
||||
|
||||
component main = A();
|
||||
20
circom/node_modules/circomlib/test/circuits/constants_test.circom
generated
vendored
Normal file
20
circom/node_modules/circomlib/test/circuits/constants_test.circom
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/sha256/constants.circom";
|
||||
|
||||
template A() {
|
||||
signal input in;
|
||||
component h0;
|
||||
h0 = K(8);
|
||||
|
||||
var lc = 0;
|
||||
var e = 1;
|
||||
for (var i=0; i<32; i++) {
|
||||
lc = lc + e*h0.out[i];
|
||||
e *= 2;
|
||||
}
|
||||
|
||||
lc === in;
|
||||
}
|
||||
|
||||
component main {public [in]} = A();
|
||||
5
circom/node_modules/circomlib/test/circuits/eddsa_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/eddsa_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/eddsa.circom";
|
||||
|
||||
component main = EdDSAVerifier(80);
|
||||
5
circom/node_modules/circomlib/test/circuits/eddsamimc_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/eddsamimc_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/eddsamimc.circom";
|
||||
|
||||
component main = EdDSAMiMCVerifier();
|
||||
5
circom/node_modules/circomlib/test/circuits/eddsaposeidon_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/eddsaposeidon_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/eddsaposeidon.circom";
|
||||
|
||||
component main = EdDSAPoseidonVerifier();
|
||||
5
circom/node_modules/circomlib/test/circuits/edwards2montgomery.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/edwards2montgomery.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/montgomery.circom";
|
||||
|
||||
component main = Edwards2Montgomery();
|
||||
27
circom/node_modules/circomlib/test/circuits/escalarmul_min_test.circom
generated
vendored
Normal file
27
circom/node_modules/circomlib/test/circuits/escalarmul_min_test.circom
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmul.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in[256];
|
||||
signal output out[2];
|
||||
|
||||
var i;
|
||||
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553, 16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
component escalarMul = EscalarMul(256, base);
|
||||
|
||||
escalarMul.inp[0] <== 0;
|
||||
escalarMul.inp[1] <== 1;
|
||||
|
||||
for (i=0; i<256; i++) {
|
||||
in[i] ==> escalarMul.in[i];
|
||||
}
|
||||
|
||||
escalarMul.out[0] ==> out[0];
|
||||
escalarMul.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
33
circom/node_modules/circomlib/test/circuits/escalarmul_test.circom
generated
vendored
Normal file
33
circom/node_modules/circomlib/test/circuits/escalarmul_test.circom
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmul.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out[2];
|
||||
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
|
||||
component n2b = Num2Bits(253);
|
||||
component escalarMul = EscalarMul(253, base);
|
||||
|
||||
escalarMul.inp[0] <== 0;
|
||||
escalarMul.inp[1] <== 1;
|
||||
|
||||
var i;
|
||||
|
||||
in ==> n2b.in;
|
||||
|
||||
for (i=0; i<253; i++) {
|
||||
n2b.out[i] ==> escalarMul.in[i];
|
||||
}
|
||||
|
||||
escalarMul.out[0] ==> out[0];
|
||||
escalarMul.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
28
circom/node_modules/circomlib/test/circuits/escalarmul_test_min.circom
generated
vendored
Normal file
28
circom/node_modules/circomlib/test/circuits/escalarmul_test_min.circom
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmul.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in[256];
|
||||
signal output out[2];
|
||||
|
||||
var i;
|
||||
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
component escalarMul = EscalarMul(256, base);
|
||||
|
||||
escalarMul.inp[0] <== 0;
|
||||
escalarMul.inp[1] <== 1;
|
||||
|
||||
for (i=0; i<256; i++) {
|
||||
in[i] ==> escalarMul.in[i];
|
||||
}
|
||||
|
||||
escalarMul.out[0] ==> out[0];
|
||||
escalarMul.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
30
circom/node_modules/circomlib/test/circuits/escalarmulany_test.circom
generated
vendored
Normal file
30
circom/node_modules/circomlib/test/circuits/escalarmulany_test.circom
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmulany.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
template Main() {
|
||||
signal input e;
|
||||
signal input p[2];
|
||||
signal output out[2];
|
||||
|
||||
component n2b = Num2Bits(253);
|
||||
component escalarMulAny = EscalarMulAny(253);
|
||||
|
||||
escalarMulAny.p[0] <== p[0];
|
||||
escalarMulAny.p[1] <== p[1];
|
||||
|
||||
var i;
|
||||
|
||||
e ==> n2b.in;
|
||||
|
||||
for (i=0; i<253; i++) {
|
||||
n2b.out[i] ==> escalarMulAny.e[i];
|
||||
}
|
||||
|
||||
escalarMulAny.out[0] ==> out[0];
|
||||
escalarMulAny.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
|
||||
31
circom/node_modules/circomlib/test/circuits/escalarmulfix_test.circom
generated
vendored
Normal file
31
circom/node_modules/circomlib/test/circuits/escalarmulfix_test.circom
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmulfix.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input e;
|
||||
signal output out[2];
|
||||
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
|
||||
component n2b = Num2Bits(253);
|
||||
component escalarMul = EscalarMulFix(253, base);
|
||||
|
||||
var i;
|
||||
|
||||
e ==> n2b.in;
|
||||
|
||||
for (i=0; i<253; i++) {
|
||||
n2b.out[i] ==> escalarMul.e[i];
|
||||
}
|
||||
|
||||
escalarMul.out[0] ==> out[0];
|
||||
escalarMul.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
|
||||
20
circom/node_modules/circomlib/test/circuits/escalarmulw4table.circom
generated
vendored
Normal file
20
circom/node_modules/circomlib/test/circuits/escalarmulw4table.circom
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmulw4table.circom";
|
||||
|
||||
|
||||
|
||||
|
||||
template Main() {
|
||||
signal output out[16][2];
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
var escalarMul[16][2] = EscalarMulW4Table(base, 0);
|
||||
for (var i=0; i<16; i++) {
|
||||
out[i][0] <== escalarMul[i][0];
|
||||
out[i][1] <== escalarMul[i][1];
|
||||
}
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
19
circom/node_modules/circomlib/test/circuits/escalarmulw4table_test.circom
generated
vendored
Normal file
19
circom/node_modules/circomlib/test/circuits/escalarmulw4table_test.circom
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmulw4table.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out[16][2];
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
var escalarMul[16][2] = EscalarMulW4Table(base, 0);
|
||||
for (var i=0; i<16; i++) {
|
||||
out[i][0] <== escalarMul[i][0]*in;
|
||||
out[i][1] <== escalarMul[i][1]*in;
|
||||
}
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
19
circom/node_modules/circomlib/test/circuits/escalarmulw4table_test3.circom
generated
vendored
Normal file
19
circom/node_modules/circomlib/test/circuits/escalarmulw4table_test3.circom
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/escalarmulw4table.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out[16][2];
|
||||
var base[2] = [5299619240641551281634865583518297030282874472190772894086521144482721001553,
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203];
|
||||
|
||||
var escalarMul[16][2] = EscalarMulW4Table(base, 3);
|
||||
for (var i=0; i<16; i++) {
|
||||
out[i][0] <== escalarMul[i][0]*in;
|
||||
out[i][1] <== escalarMul[i][1]*in;
|
||||
}
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
5
circom/node_modules/circomlib/test/circuits/greatereqthan.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/greatereqthan.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = GreaterEqThan(32);
|
||||
5
circom/node_modules/circomlib/test/circuits/greaterthan.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/greaterthan.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = GreaterThan(32);
|
||||
5
circom/node_modules/circomlib/test/circuits/isequal.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/isequal.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = IsEqual();
|
||||
5
circom/node_modules/circomlib/test/circuits/iszero.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/iszero.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = IsZero();
|
||||
5
circom/node_modules/circomlib/test/circuits/lesseqthan.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/lesseqthan.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = LessEqThan(32);
|
||||
5
circom/node_modules/circomlib/test/circuits/lessthan.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/lessthan.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/comparators.circom";
|
||||
|
||||
component main = LessThan(32);
|
||||
5
circom/node_modules/circomlib/test/circuits/mimc_sponge_hash_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/mimc_sponge_hash_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mimcsponge.circom";
|
||||
|
||||
component main = MiMCSponge(2, 220, 3);
|
||||
5
circom/node_modules/circomlib/test/circuits/mimc_sponge_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/mimc_sponge_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mimcsponge.circom";
|
||||
|
||||
component main = MiMCFeistel(220);
|
||||
5
circom/node_modules/circomlib/test/circuits/mimc_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/mimc_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mimc.circom";
|
||||
|
||||
component main = MiMC7(91);
|
||||
5
circom/node_modules/circomlib/test/circuits/montgomery2edwards.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/montgomery2edwards.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/montgomery.circom";
|
||||
|
||||
component main = Montgomery2Edwards();
|
||||
5
circom/node_modules/circomlib/test/circuits/montgomeryadd.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/montgomeryadd.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/montgomery.circom";
|
||||
|
||||
component main = MontgomeryAdd();
|
||||
5
circom/node_modules/circomlib/test/circuits/montgomerydouble.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/montgomerydouble.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/montgomery.circom";
|
||||
|
||||
component main = MontgomeryDouble();
|
||||
33
circom/node_modules/circomlib/test/circuits/mux1_1.circom
generated
vendored
Normal file
33
circom/node_modules/circomlib/test/circuits/mux1_1.circom
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mux1.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Constants() {
|
||||
var i;
|
||||
signal output out[2];
|
||||
|
||||
out[0] <== 37;
|
||||
out[1] <== 47;
|
||||
}
|
||||
|
||||
template Main() {
|
||||
var i;
|
||||
signal input selector;//private
|
||||
signal output out;
|
||||
|
||||
component mux = Mux1();
|
||||
component n2b = Num2Bits(1);
|
||||
component cst = Constants();
|
||||
|
||||
selector ==> n2b.in;
|
||||
n2b.out[0] ==> mux.s;
|
||||
for (i=0; i<2; i++) {
|
||||
cst.out[i] ==> mux.c[i];
|
||||
}
|
||||
|
||||
mux.out ==> out;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
37
circom/node_modules/circomlib/test/circuits/mux2_1.circom
generated
vendored
Normal file
37
circom/node_modules/circomlib/test/circuits/mux2_1.circom
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mux2.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Constants() {
|
||||
var i;
|
||||
signal output out[4];
|
||||
|
||||
out[0] <== 37;
|
||||
out[1] <== 47;
|
||||
out[2] <== 53;
|
||||
out[3] <== 71;
|
||||
}
|
||||
|
||||
template Main() {
|
||||
var i;
|
||||
signal input selector;//private
|
||||
signal output out;
|
||||
|
||||
component mux = Mux2();
|
||||
component n2b = Num2Bits(2);
|
||||
component cst = Constants();
|
||||
|
||||
selector ==> n2b.in;
|
||||
for (i=0; i<2; i++) {
|
||||
n2b.out[i] ==> mux.s[i];
|
||||
}
|
||||
for (i=0; i<4; i++) {
|
||||
cst.out[i] ==> mux.c[i];
|
||||
}
|
||||
|
||||
mux.out ==> out;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
41
circom/node_modules/circomlib/test/circuits/mux3_1.circom
generated
vendored
Normal file
41
circom/node_modules/circomlib/test/circuits/mux3_1.circom
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mux3.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Constants() {
|
||||
var i;
|
||||
signal output out[8];
|
||||
|
||||
out[0] <== 37;
|
||||
out[1] <== 47;
|
||||
out[2] <== 53;
|
||||
out[3] <== 71;
|
||||
out[4] <== 89;
|
||||
out[5] <== 107;
|
||||
out[6] <== 163;
|
||||
out[7] <== 191;
|
||||
}
|
||||
|
||||
template Main() {
|
||||
var i;
|
||||
signal input selector;//private
|
||||
signal output out;
|
||||
|
||||
component mux = Mux3();
|
||||
component n2b = Num2Bits(3);
|
||||
component cst = Constants();
|
||||
|
||||
selector ==> n2b.in;
|
||||
for (i=0; i<3; i++) {
|
||||
n2b.out[i] ==> mux.s[i];
|
||||
}
|
||||
for (i=0; i<8; i++) {
|
||||
cst.out[i] ==> mux.c[i];
|
||||
}
|
||||
|
||||
mux.out ==> out;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
56
circom/node_modules/circomlib/test/circuits/mux4_1.circom
generated
vendored
Normal file
56
circom/node_modules/circomlib/test/circuits/mux4_1.circom
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/mux4.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Constants() {
|
||||
var i;
|
||||
signal output out[16];
|
||||
|
||||
out[0] <== 123;
|
||||
out[1] <== 456;
|
||||
out[2] <== 789;
|
||||
out[3] <== 012;
|
||||
out[4] <== 111;
|
||||
out[5] <== 222;
|
||||
out[6] <== 333;
|
||||
out[7] <== 4546;
|
||||
out[8] <== 134523;
|
||||
out[9] <== 44356;
|
||||
out[10] <== 15623;
|
||||
out[11] <== 4566;
|
||||
out[12] <== 1223;
|
||||
out[13] <== 4546;
|
||||
out[14] <== 4256;
|
||||
out[15] <== 4456;
|
||||
|
||||
/*
|
||||
for (i=0;i<16; i++) {
|
||||
out[i] <== i*2+100;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
template Main() {
|
||||
var i;
|
||||
signal input selector;//private
|
||||
signal output out;
|
||||
|
||||
component mux = Mux4();
|
||||
component n2b = Num2Bits(4);
|
||||
component cst = Constants();
|
||||
|
||||
selector ==> n2b.in;
|
||||
for (i=0; i<4; i++) {
|
||||
n2b.out[i] ==> mux.s[i];
|
||||
}
|
||||
for (i=0; i<16; i++) {
|
||||
cst.out[i] ==> mux.c[i];
|
||||
}
|
||||
|
||||
mux.out ==> out;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
34
circom/node_modules/circomlib/test/circuits/pedersen2_test.circom
generated
vendored
Normal file
34
circom/node_modules/circomlib/test/circuits/pedersen2_test.circom
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/pedersen.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out[2];
|
||||
|
||||
component pedersen = Pedersen(256);
|
||||
|
||||
component n2b;
|
||||
n2b = Num2Bits(253);
|
||||
|
||||
var i;
|
||||
|
||||
in ==> n2b.in;
|
||||
|
||||
for (i=0; i<253; i++) {
|
||||
pedersen.in[i] <== n2b.out[i];
|
||||
}
|
||||
|
||||
for (i=253; i<256; i++) {
|
||||
pedersen.in[i] <== 0;
|
||||
}
|
||||
|
||||
pedersen.out[0] ==> out[0];
|
||||
pedersen.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
|
||||
|
||||
31
circom/node_modules/circomlib/test/circuits/pedersen_test.circom
generated
vendored
Normal file
31
circom/node_modules/circomlib/test/circuits/pedersen_test.circom
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/pedersen_old.circom";
|
||||
include "../../circuits/bitify.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in[2];
|
||||
signal output out[2];
|
||||
|
||||
component pedersen = Pedersen(250*2);
|
||||
|
||||
component n2b[2];
|
||||
n2b[0] = Num2Bits(250);
|
||||
n2b[1] = Num2Bits(250);
|
||||
|
||||
var i;
|
||||
|
||||
in[0] ==> n2b[0].in;
|
||||
in[1] ==> n2b[1].in;
|
||||
|
||||
for (i=0; i<250; i++) {
|
||||
n2b[0].out[i] ==> pedersen.in[i];
|
||||
n2b[1].out[i] ==> pedersen.in[250+i];
|
||||
}
|
||||
|
||||
pedersen.out[0] ==> out[0];
|
||||
pedersen.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
25
circom/node_modules/circomlib/test/circuits/pointbits_loopback.circom
generated
vendored
Normal file
25
circom/node_modules/circomlib/test/circuits/pointbits_loopback.circom
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/pointbits.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in[2];
|
||||
|
||||
var i;
|
||||
|
||||
component p2b = Point2Bits_Strict();
|
||||
component b2p = Bits2Point_Strict();
|
||||
|
||||
p2b.in[0] <== in[0];
|
||||
p2b.in[1] <== in[1];
|
||||
|
||||
for (i=0; i<256; i++) {
|
||||
b2p.in[i] <== p2b.out[i];
|
||||
}
|
||||
|
||||
b2p.out[0] === in[0];
|
||||
b2p.out[1] === in[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
5
circom/node_modules/circomlib/test/circuits/poseidon3_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/poseidon3_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/poseidon.circom";
|
||||
|
||||
component main = Poseidon(2);
|
||||
5
circom/node_modules/circomlib/test/circuits/poseidon6_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/poseidon6_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/poseidon.circom";
|
||||
|
||||
component main = Poseidon(5);
|
||||
5
circom/node_modules/circomlib/test/circuits/poseidonex_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/poseidonex_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/poseidon.circom";
|
||||
|
||||
component main = PoseidonEx(16, 17);
|
||||
17
circom/node_modules/circomlib/test/circuits/sha256_2_test.circom
generated
vendored
Normal file
17
circom/node_modules/circomlib/test/circuits/sha256_2_test.circom
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/sha256/sha256_2.circom";
|
||||
|
||||
template Main() {
|
||||
signal input a; //private
|
||||
signal input b; //private
|
||||
signal output out;
|
||||
|
||||
component sha256_2 = Sha256_2();
|
||||
|
||||
sha256_2.a <== a;
|
||||
sha256_2.b <== b;
|
||||
out <== sha256_2.out;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
5
circom/node_modules/circomlib/test/circuits/sha256_test448.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/sha256_test448.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/sha256/sha256.circom";
|
||||
|
||||
component main = Sha256(448);
|
||||
5
circom/node_modules/circomlib/test/circuits/sha256_test512.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/sha256_test512.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/sha256/sha256.circom";
|
||||
|
||||
component main = Sha256(512);
|
||||
5
circom/node_modules/circomlib/test/circuits/sign_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/sign_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/sign.circom";
|
||||
|
||||
component main = Sign();
|
||||
5
circom/node_modules/circomlib/test/circuits/smtprocessor10_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/smtprocessor10_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/smt/smtprocessor.circom";
|
||||
|
||||
component main = SMTProcessor(10);
|
||||
5
circom/node_modules/circomlib/test/circuits/smtverifier10_test.circom
generated
vendored
Normal file
5
circom/node_modules/circomlib/test/circuits/smtverifier10_test.circom
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/smt/smtverifier.circom";
|
||||
|
||||
component main = SMTVerifier(10);
|
||||
33
circom/node_modules/circomlib/test/circuits/sum_test.circom
generated
vendored
Normal file
33
circom/node_modules/circomlib/test/circuits/sum_test.circom
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "../../circuits/bitify.circom";
|
||||
include "../../circuits/binsum.circom";
|
||||
|
||||
template A() {
|
||||
signal input a; //private
|
||||
signal input b;
|
||||
signal output out;
|
||||
|
||||
var i;
|
||||
|
||||
component n2ba = Num2Bits(32);
|
||||
component n2bb = Num2Bits(32);
|
||||
component sum = BinSum(32,2);
|
||||
component b2n = Bits2Num(32);
|
||||
|
||||
n2ba.in <== a;
|
||||
n2bb.in <== b;
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
sum.in[0][i] <== n2ba.out[i];
|
||||
sum.in[1][i] <== n2bb.out[i];
|
||||
}
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
b2n.in[i] <== sum.out[i];
|
||||
}
|
||||
|
||||
out <== b2n.out;
|
||||
}
|
||||
|
||||
component main = A();
|
||||
Reference in New Issue
Block a user