circom/constant_test.json
constant_test.jsonRaw
1{
2 "mainCode": "{\n {\n }\n}\n",
3 "signalName2Idx": {
4 "one": 0,
5 "main.in": 1,
6 "main.h0.out[0]": 2,
7 "main.h0.out[1]": 3,
8 "main.h0.out[2]": 4,
9 "main.h0.out[3]": 5,
10 "main.h0.out[4]": 6,
11 "main.h0.out[5]": 7,
12 "main.h0.out[6]": 8,
13 "main.h0.out[7]": 9,
14 "main.h0.out[8]": 10,
15 "main.h0.out[9]": 11,
16 "main.h0.out[10]": 12,
17 "main.h0.out[11]": 13,
18 "main.h0.out[12]": 14,
19 "main.h0.out[13]": 15,
20 "main.h0.out[14]": 16,
21 "main.h0.out[15]": 17,
22 "main.h0.out[16]": 18,
23 "main.h0.out[17]": 19,
24 "main.h0.out[18]": 20,
25 "main.h0.out[19]": 21,
26 "main.h0.out[20]": 22,
27 "main.h0.out[21]": 23,
28 "main.h0.out[22]": 24,
29 "main.h0.out[23]": 25,
30 "main.h0.out[24]": 26,
31 "main.h0.out[25]": 27,
32 "main.h0.out[26]": 28,
33 "main.h0.out[27]": 29,
34 "main.h0.out[28]": 30,
35 "main.h0.out[29]": 31,
36 "main.h0.out[30]": 32,
37 "main.h0.out[31]": 33
38 },
39 "components": [
40 {
41 "name": "main",
42 "params": {},
43 "template": "A",
44 "inputSignals": 1
45 },
46 {
47 "name": "main.h0",
48 "params": {
49 "x": "8"
50 },
51 "template": "K",
52 "inputSignals": 0
53 }
54 ],
55 "componentName2Idx": {
56 "main": 0,
57 "main.h0": 1
58 },
59 "signals": [
60 {
61 "names": [
62 "one"
63 ],
64 "triggerComponents": []
65 },
66 {
67 "names": [
68 "main.in"
69 ],
70 "triggerComponents": [
71 0
72 ]
73 },
74 {
75 "names": [
76 "main.h0.out[0]"
77 ],
78 "triggerComponents": []
79 },
80 {
81 "names": [
82 "main.h0.out[1]"
83 ],
84 "triggerComponents": []
85 },
86 {
87 "names": [
88 "main.h0.out[2]"
89 ],
90 "triggerComponents": []
91 },
92 {
93 "names": [
94 "main.h0.out[3]"
95 ],
96 "triggerComponents": []
97 },
98 {
99 "names": [
100 "main.h0.out[4]"
101 ],
102 "triggerComponents": []
103 },
104 {
105 "names": [
106 "main.h0.out[5]"
107 ],
108 "triggerComponents": []
109 },
110 {
111 "names": [
112 "main.h0.out[6]"
113 ],
114 "triggerComponents": []
115 },
116 {
117 "names": [
118 "main.h0.out[7]"
119 ],
120 "triggerComponents": []
121 },
122 {
123 "names": [
124 "main.h0.out[8]"
125 ],
126 "triggerComponents": []
127 },
128 {
129 "names": [
130 "main.h0.out[9]"
131 ],
132 "triggerComponents": []
133 },
134 {
135 "names": [
136 "main.h0.out[10]"
137 ],
138 "triggerComponents": []
139 },
140 {
141 "names": [
142 "main.h0.out[11]"
143 ],
144 "triggerComponents": []
145 },
146 {
147 "names": [
148 "main.h0.out[12]"
149 ],
150 "triggerComponents": []
151 },
152 {
153 "names": [
154 "main.h0.out[13]"
155 ],
156 "triggerComponents": []
157 },
158 {
159 "names": [
160 "main.h0.out[14]"
161 ],
162 "triggerComponents": []
163 },
164 {
165 "names": [
166 "main.h0.out[15]"
167 ],
168 "triggerComponents": []
169 },
170 {
171 "names": [
172 "main.h0.out[16]"
173 ],
174 "triggerComponents": []
175 },
176 {
177 "names": [
178 "main.h0.out[17]"
179 ],
180 "triggerComponents": []
181 },
182 {
183 "names": [
184 "main.h0.out[18]"
185 ],
186 "triggerComponents": []
187 },
188 {
189 "names": [
190 "main.h0.out[19]"
191 ],
192 "triggerComponents": []
193 },
194 {
195 "names": [
196 "main.h0.out[20]"
197 ],
198 "triggerComponents": []
199 },
200 {
201 "names": [
202 "main.h0.out[21]"
203 ],
204 "triggerComponents": []
205 },
206 {
207 "names": [
208 "main.h0.out[22]"
209 ],
210 "triggerComponents": []
211 },
212 {
213 "names": [
214 "main.h0.out[23]"
215 ],
216 "triggerComponents": []
217 },
218 {
219 "names": [
220 "main.h0.out[24]"
221 ],
222 "triggerComponents": []
223 },
224 {
225 "names": [
226 "main.h0.out[25]"
227 ],
228 "triggerComponents": []
229 },
230 {
231 "names": [
232 "main.h0.out[26]"
233 ],
234 "triggerComponents": []
235 },
236 {
237 "names": [
238 "main.h0.out[27]"
239 ],
240 "triggerComponents": []
241 },
242 {
243 "names": [
244 "main.h0.out[28]"
245 ],
246 "triggerComponents": []
247 },
248 {
249 "names": [
250 "main.h0.out[29]"
251 ],
252 "triggerComponents": []
253 },
254 {
255 "names": [
256 "main.h0.out[30]"
257 ],
258 "triggerComponents": []
259 },
260 {
261 "names": [
262 "main.h0.out[31]"
263 ],
264 "triggerComponents": []
265 }
266 ],
267 "constrains": [
268 [
269 {},
270 {},
271 {
272 "0": "21888242871839275222246405745257275088548364400416034343698204186572184114537",
273 "1": "1"
274 }
275 ]
276 ],
277 "templates": {
278 "H": "function(ctx) {\n ctx.setVar(\"c\", [], [\"1779033703\",\"3144134277\",\"1013904242\",\"2773480762\",\"1359893119\",\"2600822924\",\"528734635\",\"1541459225\"]);\n for (ctx.setVar(\"i\", [], \"0\");bigInt(ctx.getVar(\"i\",[])).lt(bigInt(\"32\")) ? 1 : 0;(ctx.setVar(\"i\", [], bigInt(ctx.getVar(\"i\",[])).add(bigInt(\"1\")).mod(__P__))).add(__P__).sub(bigInt(1)).mod(__P__))\n {\n ctx.setSignal(\"out\", [ctx.getVar(\"i\",[])], bigInt(bigInt(ctx.getVar(\"i\",[])).greater(bigInt(256)) ? 0 : bigInt(ctx.getVar(\"c\",[ctx.getVar(\"x\",[])])).shr(bigInt(ctx.getVar(\"i\",[]))).and(__MASK__)).and(bigInt(\"1\")).and(__MASK__));\n ctx.assert(ctx.getSignal(\"out\", [ctx.getVar(\"i\",[])]), bigInt(bigInt(ctx.getVar(\"i\",[])).greater(bigInt(256)) ? 0 : bigInt(ctx.getVar(\"c\",[ctx.getVar(\"x\",[])])).shr(bigInt(ctx.getVar(\"i\",[]))).and(__MASK__)).and(bigInt(\"1\")).and(__MASK__));\n }\n}\n",
279 "K": "function(ctx) {\n ctx.setVar(\"c\", [], [\"1116352408\",\"1899447441\",\"3049323471\",\"3921009573\",\"961987163\",\"1508970993\",\"2453635748\",\"2870763221\",\"3624381080\",\"310598401\",\"607225278\",\"1426881987\",\"1925078388\",\"2162078206\",\"2614888103\",\"3248222580\",\"3835390401\",\"4022224774\",\"264347078\",\"604807628\",\"770255983\",\"1249150122\",\"1555081692\",\"1996064986\",\"2554220882\",\"2821834349\",\"2952996808\",\"3210313671\",\"3336571891\",\"3584528711\",\"113926993\",\"338241895\",\"666307205\",\"773529912\",\"1294757372\",\"1396182291\",\"1695183700\",\"1986661051\",\"2177026350\",\"2456956037\",\"2730485921\",\"2820302411\",\"3259730800\",\"3345764771\",\"3516065817\",\"3600352804\",\"4094571909\",\"275423344\",\"430227734\",\"506948616\",\"659060556\",\"883997877\",\"958139571\",\"1322822218\",\"1537002063\",\"1747873779\",\"1955562222\",\"2024104815\",\"2227730452\",\"2361852424\",\"2428436474\",\"2756734187\",\"3204031479\",\"3329325298\"]);\n for (ctx.setVar(\"i\", [], \"0\");bigInt(ctx.getVar(\"i\",[])).lt(bigInt(\"32\")) ? 1 : 0;(ctx.setVar(\"i\", [], bigInt(ctx.getVar(\"i\",[])).add(bigInt(\"1\")).mod(__P__))).add(__P__).sub(bigInt(1)).mod(__P__))\n {\n ctx.setSignal(\"out\", [ctx.getVar(\"i\",[])], bigInt(bigInt(ctx.getVar(\"i\",[])).greater(bigInt(256)) ? 0 : bigInt(ctx.getVar(\"c\",[ctx.getVar(\"x\",[])])).shr(bigInt(ctx.getVar(\"i\",[]))).and(__MASK__)).and(bigInt(\"1\")).and(__MASK__));\n ctx.assert(ctx.getSignal(\"out\", [ctx.getVar(\"i\",[])]), bigInt(bigInt(ctx.getVar(\"i\",[])).greater(bigInt(256)) ? 0 : bigInt(ctx.getVar(\"c\",[ctx.getVar(\"x\",[])])).shr(bigInt(ctx.getVar(\"i\",[]))).and(__MASK__)).and(bigInt(\"1\")).and(__MASK__));\n }\n}\n",
280 "A": "function(ctx) {\n ctx.setVar(\"lc\", [], \"0\");\n ctx.setVar(\"e\", [], \"1\");\n for (ctx.setVar(\"i\", [], \"0\");bigInt(ctx.getVar(\"i\",[])).lt(bigInt(\"32\")) ? 1 : 0;(ctx.setVar(\"i\", [], bigInt(ctx.getVar(\"i\",[])).add(bigInt(\"1\")).mod(__P__))).add(__P__).sub(bigInt(1)).mod(__P__))\n {\n ctx.setVar(\"lc\", [], bigInt(ctx.getVar(\"lc\",[])).add(bigInt(bigInt(ctx.getVar(\"e\",[])).mul(bigInt(ctx.getPin(\"h0\", [], \"out\", [ctx.getVar(\"i\",[])]))).mod(__P__))).mod(__P__));\n ctx.setVar(\"e\", [], bigInt(ctx.getVar(\"e\",[])).mul(bigInt(\"2\")).mod(__P__));\n }\n ctx.assert(ctx.getVar(\"lc\",[]), ctx.getSignal(\"in\", []));\n}\n"
281 },
282 "functions": {},
283 "nPrvInputs": 0,
284 "nPubInputs": 1,
285 "nInputs": 1,
286 "nOutputs": 0,
287 "nVars": 2,
288 "nConstants": 32,
289 "nSignals": 34
290}