arnaucube
arnaucube/circomlibPublic Self-hosted repository
circomlib/circuit.json
circuit.jsonRaw
  1{
  2 "mainCode": "{\n    {\n    }\n    ctx.setVar(\"base\", [], [\"17777552123799933955779906779655732241715742912184938656739573121738514868268\",\"2626589144620713026669568689430873010625803728049924121243784502389097019475\"]);\n}\n",
  3 "signalName2Idx": {
  4  "one": 0,
  5  "main.out[0][0]": 1,
  6  "main.out[0][1]": 2,
  7  "main.out[1][0]": 3,
  8  "main.out[1][1]": 4,
  9  "main.out[2][0]": 5,
 10  "main.out[2][1]": 6,
 11  "main.out[3][0]": 7,
 12  "main.out[3][1]": 8,
 13  "main.out[4][0]": 9,
 14  "main.out[4][1]": 10,
 15  "main.out[5][0]": 11,
 16  "main.out[5][1]": 12,
 17  "main.out[6][0]": 13,
 18  "main.out[6][1]": 14,
 19  "main.out[7][0]": 15,
 20  "main.out[7][1]": 16,
 21  "main.out[8][0]": 17,
 22  "main.out[8][1]": 18,
 23  "main.out[9][0]": 19,
 24  "main.out[9][1]": 20,
 25  "main.out[10][0]": 21,
 26  "main.out[10][1]": 22,
 27  "main.out[11][0]": 23,
 28  "main.out[11][1]": 24,
 29  "main.out[12][0]": 25,
 30  "main.out[12][1]": 26,
 31  "main.out[13][0]": 27,
 32  "main.out[13][1]": 28,
 33  "main.out[14][0]": 29,
 34  "main.out[14][1]": 30,
 35  "main.out[15][0]": 31,
 36  "main.out[15][1]": 32
 37 },
 38 "components": [
 39  {
 40   "name": "main",
 41   "params": {
 42    "base": [
 43     {
 44      "type": "NUMBER",
 45      "value": "17777552123799933955779906779655732241715742912184938656739573121738514868268",
 46      "first_line": 3,
 47      "first_column": 12,
 48      "last_line": 3,
 49      "last_column": 89
 50     },
 51     {
 52      "type": "NUMBER",
 53      "value": "2626589144620713026669568689430873010625803728049924121243784502389097019475",
 54      "first_line": 4,
 55      "first_column": 12,
 56      "last_line": 4,
 57      "last_column": 88
 58     }
 59    ],
 60    "k": {
 61     "type": "NUMBER",
 62     "value": "0",
 63     "first_line": 6,
 64     "first_column": 41,
 65     "last_line": 6,
 66     "last_column": 42
 67    }
 68   },
 69   "template": "EscalarMulW4Table",
 70   "inputSignals": 0
 71  }
 72 ],
 73 "componentName2Idx": {
 74  "main": 0
 75 },
 76 "signals": [
 77  {
 78   "names": [
 79    "one"
 80   ],
 81   "triggerComponents": []
 82  },
 83  {
 84   "names": [
 85    "main.out[0][0]"
 86   ],
 87   "triggerComponents": []
 88  },
 89  {
 90   "names": [
 91    "main.out[0][1]"
 92   ],
 93   "triggerComponents": []
 94  },
 95  {
 96   "names": [
 97    "main.out[1][0]"
 98   ],
 99   "triggerComponents": []
100  },
101  {
102   "names": [
103    "main.out[1][1]"
104   ],
105   "triggerComponents": []
106  },
107  {
108   "names": [
109    "main.out[2][0]"
110   ],
111   "triggerComponents": []
112  },
113  {
114   "names": [
115    "main.out[2][1]"
116   ],
117   "triggerComponents": []
118  },
119  {
120   "names": [
121    "main.out[3][0]"
122   ],
123   "triggerComponents": []
124  },
125  {
126   "names": [
127    "main.out[3][1]"
128   ],
129   "triggerComponents": []
130  },
131  {
132   "names": [
133    "main.out[4][0]"
134   ],
135   "triggerComponents": []
136  },
137  {
138   "names": [
139    "main.out[4][1]"
140   ],
141   "triggerComponents": []
142  },
143  {
144   "names": [
145    "main.out[5][0]"
146   ],
147   "triggerComponents": []
148  },
149  {
150   "names": [
151    "main.out[5][1]"
152   ],
153   "triggerComponents": []
154  },
155  {
156   "names": [
157    "main.out[6][0]"
158   ],
159   "triggerComponents": []
160  },
161  {
162   "names": [
163    "main.out[6][1]"
164   ],
165   "triggerComponents": []
166  },
167  {
168   "names": [
169    "main.out[7][0]"
170   ],
171   "triggerComponents": []
172  },
173  {
174   "names": [
175    "main.out[7][1]"
176   ],
177   "triggerComponents": []
178  },
179  {
180   "names": [
181    "main.out[8][0]"
182   ],
183   "triggerComponents": []
184  },
185  {
186   "names": [
187    "main.out[8][1]"
188   ],
189   "triggerComponents": []
190  },
191  {
192   "names": [
193    "main.out[9][0]"
194   ],
195   "triggerComponents": []
196  },
197  {
198   "names": [
199    "main.out[9][1]"
200   ],
201   "triggerComponents": []
202  },
203  {
204   "names": [
205    "main.out[10][0]"
206   ],
207   "triggerComponents": []
208  },
209  {
210   "names": [
211    "main.out[10][1]"
212   ],
213   "triggerComponents": []
214  },
215  {
216   "names": [
217    "main.out[11][0]"
218   ],
219   "triggerComponents": []
220  },
221  {
222   "names": [
223    "main.out[11][1]"
224   ],
225   "triggerComponents": []
226  },
227  {
228   "names": [
229    "main.out[12][0]"
230   ],
231   "triggerComponents": []
232  },
233  {
234   "names": [
235    "main.out[12][1]"
236   ],
237   "triggerComponents": []
238  },
239  {
240   "names": [
241    "main.out[13][0]"
242   ],
243   "triggerComponents": []
244  },
245  {
246   "names": [
247    "main.out[13][1]"
248   ],
249   "triggerComponents": []
250  },
251  {
252   "names": [
253    "main.out[14][0]"
254   ],
255   "triggerComponents": []
256  },
257  {
258   "names": [
259    "main.out[14][1]"
260   ],
261   "triggerComponents": []
262  },
263  {
264   "names": [
265    "main.out[15][0]"
266   ],
267   "triggerComponents": []
268  },
269  {
270   "names": [
271    "main.out[15][1]"
272   ],
273   "triggerComponents": []
274  }
275 ],
276 "constraints": [],
277 "templates": {
278  "EscalarMulW4Table": "function(ctx) {\n    ctx.setVar(\"dbl\", [], ctx.getVar(\"base\",[]));\n    for (ctx.setVar(\"i\", [], \"0\");bigInt(ctx.getVar(\"i\",[])).lt(bigInt(bigInt(ctx.getVar(\"k\",[])).mul(bigInt(\"4\")).mod(__P__))) ? 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(\"dbl\", [], ctx.callFunction(\"pointAdd\", [ctx.getVar(\"dbl\",[\"0\"]),ctx.getVar(\"dbl\",[\"1\"]),ctx.getVar(\"dbl\",[\"0\"]),ctx.getVar(\"dbl\",[\"1\"])]));\n    }\n\n     }\n    ctx.setSignal(\"out\", [\"0\",\"0\"], \"0\");\n    ctx.assert(ctx.getSignal(\"out\", [\"0\",\"0\"]), \"0\");\n    ctx.setSignal(\"out\", [\"0\",\"1\"], \"1\");\n    ctx.assert(ctx.getSignal(\"out\", [\"0\",\"1\"]), \"1\");\n    for (ctx.setVar(\"i\", [], \"1\");bigInt(ctx.getVar(\"i\",[])).lt(bigInt(\"16\")) ? 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(\"p\", [], ctx.callFunction(\"pointAdd\", [ctx.getSignal(\"out\", [bigInt(ctx.getVar(\"i\",[])).add(__P__).sub(bigInt(\"1\")).mod(__P__),\"0\"]),ctx.getSignal(\"out\", [bigInt(ctx.getVar(\"i\",[])).add(__P__).sub(bigInt(\"1\")).mod(__P__),\"1\"]),ctx.getVar(\"dbl\",[\"0\"]),ctx.getVar(\"dbl\",[\"1\"])]));\n        ctx.setSignal(\"out\", [ctx.getVar(\"i\",[]),\"0\"], ctx.getVar(\"p\",[\"0\"]));\n        ctx.assert(ctx.getSignal(\"out\", [ctx.getVar(\"i\",[]),\"0\"]), ctx.getVar(\"p\",[\"0\"]));\n        ctx.setSignal(\"out\", [ctx.getVar(\"i\",[]),\"1\"], ctx.getVar(\"p\",[\"1\"]));\n        ctx.assert(ctx.getSignal(\"out\", [ctx.getVar(\"i\",[]),\"1\"]), ctx.getVar(\"p\",[\"1\"]));\n    }\n\n     }\n}\n"
279 },
280 "functions": {
281  "pointAdd": {
282   "params": [
283    "x1",
284    "y1",
285    "x2",
286    "y2"
287   ],
288   "func": "function(ctx) {\n    ctx.setVar(\"a\", [], \"168700\");\n    ctx.setVar(\"d\", [], \"168696\");\n    ctx.setVar(\"res\", [\"0\"], bigInt(bigInt(bigInt(ctx.getVar(\"x1\",[])).mul(bigInt(ctx.getVar(\"y2\",[]))).mod(__P__)).add(bigInt(bigInt(ctx.getVar(\"y1\",[])).mul(bigInt(ctx.getVar(\"x2\",[]))).mod(__P__))).mod(__P__)).mul( bigInt(bigInt(\"1\").add(bigInt(bigInt(bigInt(bigInt(bigInt(ctx.getVar(\"d\",[])).mul(bigInt(ctx.getVar(\"x1\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"x2\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"y1\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"y2\",[]))).mod(__P__))).mod(__P__)).inverse(__P__) ).mod(__P__));\n    ctx.setVar(\"res\", [\"1\"], bigInt(bigInt(bigInt(ctx.getVar(\"y1\",[])).mul(bigInt(ctx.getVar(\"y2\",[]))).mod(__P__)).add(__P__).sub(bigInt(bigInt(bigInt(ctx.getVar(\"a\",[])).mul(bigInt(ctx.getVar(\"x1\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"x2\",[]))).mod(__P__))).mod(__P__)).mul( bigInt(bigInt(\"1\").add(__P__).sub(bigInt(bigInt(bigInt(bigInt(bigInt(ctx.getVar(\"d\",[])).mul(bigInt(ctx.getVar(\"x1\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"x2\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"y1\",[]))).mod(__P__)).mul(bigInt(ctx.getVar(\"y2\",[]))).mod(__P__))).mod(__P__)).inverse(__P__) ).mod(__P__));\n    return ctx.getVar(\"res\",[]);;\n}\n"
289  }
290 },
291 "nPrvInputs": 0,
292 "nPubInputs": 0,
293 "nInputs": 0,
294 "nOutputs": 0,
295 "nVars": 1,
296 "nConstants": 32,
297 "nSignals": 33
298}