You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1226 lines
22 KiB

  1. const bigInt = require("big-integer");
  2. const __P__ = new bigInt("21888242871839275222246405745257275088696311157297823662689037894645226208583");
  3. const __MASK__ = new bigInt(2).pow(253).minus(1);
  4. const circuit = {};
  5. module.exports = circuit;
  6. circuit.signals={
  7. "one": {
  8. "fullName": "one",
  9. "value": "1",
  10. "equivalence": "",
  11. "direction": "",
  12. "id": 0
  13. },
  14. "main.in": {
  15. "fullName": "main.in",
  16. "direction": "IN",
  17. "component": "main",
  18. "equivalence": "",
  19. "alias": [
  20. "main.in"
  21. ],
  22. "id": 1
  23. },
  24. "main.out[0]": {
  25. "fullName": "main.out[0]",
  26. "direction": "OUT",
  27. "component": "main",
  28. "equivalence": "",
  29. "alias": [
  30. "main.out[0]"
  31. ],
  32. "id": 2
  33. },
  34. "main.out[1]": {
  35. "fullName": "main.out[1]",
  36. "direction": "OUT",
  37. "component": "main",
  38. "equivalence": "",
  39. "alias": [
  40. "main.out[1]"
  41. ],
  42. "id": 3
  43. },
  44. "main.out[2]": {
  45. "fullName": "main.out[2]",
  46. "direction": "OUT",
  47. "component": "main",
  48. "equivalence": "",
  49. "alias": [
  50. "main.out[2]"
  51. ],
  52. "id": 4
  53. },
  54. "main.out[3]": {
  55. "fullName": "main.out[3]",
  56. "direction": "OUT",
  57. "component": "main",
  58. "equivalence": "",
  59. "alias": [
  60. "main.out[3]"
  61. ],
  62. "id": 5
  63. },
  64. "main.out[4]": {
  65. "fullName": "main.out[4]",
  66. "direction": "OUT",
  67. "component": "main",
  68. "equivalence": "",
  69. "alias": [
  70. "main.out[4]"
  71. ],
  72. "id": 6
  73. },
  74. "main.out[5]": {
  75. "fullName": "main.out[5]",
  76. "direction": "OUT",
  77. "component": "main",
  78. "equivalence": "",
  79. "alias": [
  80. "main.out[5]"
  81. ],
  82. "id": 7
  83. },
  84. "main.out[6]": {
  85. "fullName": "main.out[6]",
  86. "direction": "OUT",
  87. "component": "main",
  88. "equivalence": "",
  89. "alias": [
  90. "main.out[6]"
  91. ],
  92. "id": 8
  93. },
  94. "main.out[7]": {
  95. "fullName": "main.out[7]",
  96. "direction": "OUT",
  97. "component": "main",
  98. "equivalence": "",
  99. "alias": [
  100. "main.out[7]"
  101. ],
  102. "id": 9
  103. },
  104. "main.out[8]": {
  105. "fullName": "main.out[8]",
  106. "direction": "OUT",
  107. "component": "main",
  108. "equivalence": "",
  109. "alias": [
  110. "main.out[8]"
  111. ],
  112. "id": 10
  113. },
  114. "main.out[9]": {
  115. "fullName": "main.out[9]",
  116. "direction": "OUT",
  117. "component": "main",
  118. "equivalence": "",
  119. "alias": [
  120. "main.out[9]"
  121. ],
  122. "id": 11
  123. },
  124. "main.out[10]": {
  125. "fullName": "main.out[10]",
  126. "direction": "OUT",
  127. "component": "main",
  128. "equivalence": "",
  129. "alias": [
  130. "main.out[10]"
  131. ],
  132. "id": 12
  133. },
  134. "main.out[11]": {
  135. "fullName": "main.out[11]",
  136. "direction": "OUT",
  137. "component": "main",
  138. "equivalence": "",
  139. "alias": [
  140. "main.out[11]"
  141. ],
  142. "id": 13
  143. },
  144. "main.out[12]": {
  145. "fullName": "main.out[12]",
  146. "direction": "OUT",
  147. "component": "main",
  148. "equivalence": "",
  149. "alias": [
  150. "main.out[12]"
  151. ],
  152. "id": 14
  153. },
  154. "main.out[13]": {
  155. "fullName": "main.out[13]",
  156. "direction": "OUT",
  157. "component": "main",
  158. "equivalence": "",
  159. "alias": [
  160. "main.out[13]"
  161. ],
  162. "id": 15
  163. },
  164. "main.out[14]": {
  165. "fullName": "main.out[14]",
  166. "direction": "OUT",
  167. "component": "main",
  168. "equivalence": "",
  169. "alias": [
  170. "main.out[14]"
  171. ],
  172. "id": 16
  173. },
  174. "main.out[15]": {
  175. "fullName": "main.out[15]",
  176. "direction": "OUT",
  177. "component": "main",
  178. "equivalence": "",
  179. "alias": [
  180. "main.out[15]"
  181. ],
  182. "id": 17
  183. },
  184. "main.out[16]": {
  185. "fullName": "main.out[16]",
  186. "direction": "OUT",
  187. "component": "main",
  188. "equivalence": "",
  189. "alias": [
  190. "main.out[16]"
  191. ],
  192. "id": 18
  193. },
  194. "main.out[17]": {
  195. "fullName": "main.out[17]",
  196. "direction": "OUT",
  197. "component": "main",
  198. "equivalence": "",
  199. "alias": [
  200. "main.out[17]"
  201. ],
  202. "id": 19
  203. },
  204. "main.out[18]": {
  205. "fullName": "main.out[18]",
  206. "direction": "OUT",
  207. "component": "main",
  208. "equivalence": "",
  209. "alias": [
  210. "main.out[18]"
  211. ],
  212. "id": 20
  213. },
  214. "main.out[19]": {
  215. "fullName": "main.out[19]",
  216. "direction": "OUT",
  217. "component": "main",
  218. "equivalence": "",
  219. "alias": [
  220. "main.out[19]"
  221. ],
  222. "id": 21
  223. },
  224. "main.out[20]": {
  225. "fullName": "main.out[20]",
  226. "direction": "OUT",
  227. "component": "main",
  228. "equivalence": "",
  229. "alias": [
  230. "main.out[20]"
  231. ],
  232. "id": 22
  233. },
  234. "main.out[21]": {
  235. "fullName": "main.out[21]",
  236. "direction": "OUT",
  237. "component": "main",
  238. "equivalence": "",
  239. "alias": [
  240. "main.out[21]"
  241. ],
  242. "id": 23
  243. },
  244. "main.out[22]": {
  245. "fullName": "main.out[22]",
  246. "direction": "OUT",
  247. "component": "main",
  248. "equivalence": "",
  249. "alias": [
  250. "main.out[22]"
  251. ],
  252. "id": 24
  253. },
  254. "main.out[23]": {
  255. "fullName": "main.out[23]",
  256. "direction": "OUT",
  257. "component": "main",
  258. "equivalence": "",
  259. "alias": [
  260. "main.out[23]"
  261. ],
  262. "id": 25
  263. },
  264. "main.out[24]": {
  265. "fullName": "main.out[24]",
  266. "direction": "OUT",
  267. "component": "main",
  268. "equivalence": "",
  269. "alias": [
  270. "main.out[24]"
  271. ],
  272. "id": 26
  273. },
  274. "main.out[25]": {
  275. "fullName": "main.out[25]",
  276. "direction": "OUT",
  277. "component": "main",
  278. "equivalence": "",
  279. "alias": [
  280. "main.out[25]"
  281. ],
  282. "id": 27
  283. },
  284. "main.out[26]": {
  285. "fullName": "main.out[26]",
  286. "direction": "OUT",
  287. "component": "main",
  288. "equivalence": "",
  289. "alias": [
  290. "main.out[26]"
  291. ],
  292. "id": 28
  293. },
  294. "main.out[27]": {
  295. "fullName": "main.out[27]",
  296. "direction": "OUT",
  297. "component": "main",
  298. "equivalence": "",
  299. "alias": [
  300. "main.out[27]"
  301. ],
  302. "id": 29
  303. },
  304. "main.out[28]": {
  305. "fullName": "main.out[28]",
  306. "direction": "OUT",
  307. "component": "main",
  308. "equivalence": "",
  309. "alias": [
  310. "main.out[28]"
  311. ],
  312. "id": 30
  313. },
  314. "main.out[29]": {
  315. "fullName": "main.out[29]",
  316. "direction": "OUT",
  317. "component": "main",
  318. "equivalence": "",
  319. "alias": [
  320. "main.out[29]"
  321. ],
  322. "id": 31
  323. },
  324. "main.out[30]": {
  325. "fullName": "main.out[30]",
  326. "direction": "OUT",
  327. "component": "main",
  328. "equivalence": "",
  329. "alias": [
  330. "main.out[30]"
  331. ],
  332. "id": 32
  333. },
  334. "main.out[31]": {
  335. "fullName": "main.out[31]",
  336. "direction": "OUT",
  337. "component": "main",
  338. "equivalence": "",
  339. "alias": [
  340. "main.out[31]"
  341. ],
  342. "id": 33
  343. }
  344. };
  345. circuit.components={
  346. "main": {
  347. "signals": [
  348. "main.in",
  349. "main.out[0]",
  350. "main.out[1]",
  351. "main.out[2]",
  352. "main.out[3]",
  353. "main.out[4]",
  354. "main.out[5]",
  355. "main.out[6]",
  356. "main.out[7]",
  357. "main.out[8]",
  358. "main.out[9]",
  359. "main.out[10]",
  360. "main.out[11]",
  361. "main.out[12]",
  362. "main.out[13]",
  363. "main.out[14]",
  364. "main.out[15]",
  365. "main.out[16]",
  366. "main.out[17]",
  367. "main.out[18]",
  368. "main.out[19]",
  369. "main.out[20]",
  370. "main.out[21]",
  371. "main.out[22]",
  372. "main.out[23]",
  373. "main.out[24]",
  374. "main.out[25]",
  375. "main.out[26]",
  376. "main.out[27]",
  377. "main.out[28]",
  378. "main.out[29]",
  379. "main.out[30]",
  380. "main.out[31]"
  381. ],
  382. "params": {},
  383. "template": "ToBin",
  384. "inputSignals": 1
  385. }
  386. };
  387. circuit.signalConstrains=[
  388. {
  389. "type": "QEQ",
  390. "a": {
  391. "type": "LINEARCOMBINATION",
  392. "values": {
  393. "main.out[0]": "1"
  394. }
  395. },
  396. "b": {
  397. "type": "LINEARCOMBINATION",
  398. "values": {
  399. "main.out[0]": "1",
  400. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  401. }
  402. },
  403. "c": {
  404. "type": "LINEARCOMBINATION",
  405. "values": {}
  406. }
  407. },
  408. {
  409. "type": "QEQ",
  410. "a": {
  411. "type": "LINEARCOMBINATION",
  412. "values": {
  413. "main.out[1]": "1"
  414. }
  415. },
  416. "b": {
  417. "type": "LINEARCOMBINATION",
  418. "values": {
  419. "main.out[1]": "1",
  420. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  421. }
  422. },
  423. "c": {
  424. "type": "LINEARCOMBINATION",
  425. "values": {}
  426. }
  427. },
  428. {
  429. "type": "QEQ",
  430. "a": {
  431. "type": "LINEARCOMBINATION",
  432. "values": {
  433. "main.out[2]": "1"
  434. }
  435. },
  436. "b": {
  437. "type": "LINEARCOMBINATION",
  438. "values": {
  439. "main.out[2]": "1",
  440. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  441. }
  442. },
  443. "c": {
  444. "type": "LINEARCOMBINATION",
  445. "values": {}
  446. }
  447. },
  448. {
  449. "type": "QEQ",
  450. "a": {
  451. "type": "LINEARCOMBINATION",
  452. "values": {
  453. "main.out[3]": "1"
  454. }
  455. },
  456. "b": {
  457. "type": "LINEARCOMBINATION",
  458. "values": {
  459. "main.out[3]": "1",
  460. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  461. }
  462. },
  463. "c": {
  464. "type": "LINEARCOMBINATION",
  465. "values": {}
  466. }
  467. },
  468. {
  469. "type": "QEQ",
  470. "a": {
  471. "type": "LINEARCOMBINATION",
  472. "values": {
  473. "main.out[4]": "1"
  474. }
  475. },
  476. "b": {
  477. "type": "LINEARCOMBINATION",
  478. "values": {
  479. "main.out[4]": "1",
  480. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  481. }
  482. },
  483. "c": {
  484. "type": "LINEARCOMBINATION",
  485. "values": {}
  486. }
  487. },
  488. {
  489. "type": "QEQ",
  490. "a": {
  491. "type": "LINEARCOMBINATION",
  492. "values": {
  493. "main.out[5]": "1"
  494. }
  495. },
  496. "b": {
  497. "type": "LINEARCOMBINATION",
  498. "values": {
  499. "main.out[5]": "1",
  500. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  501. }
  502. },
  503. "c": {
  504. "type": "LINEARCOMBINATION",
  505. "values": {}
  506. }
  507. },
  508. {
  509. "type": "QEQ",
  510. "a": {
  511. "type": "LINEARCOMBINATION",
  512. "values": {
  513. "main.out[6]": "1"
  514. }
  515. },
  516. "b": {
  517. "type": "LINEARCOMBINATION",
  518. "values": {
  519. "main.out[6]": "1",
  520. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  521. }
  522. },
  523. "c": {
  524. "type": "LINEARCOMBINATION",
  525. "values": {}
  526. }
  527. },
  528. {
  529. "type": "QEQ",
  530. "a": {
  531. "type": "LINEARCOMBINATION",
  532. "values": {
  533. "main.out[7]": "1"
  534. }
  535. },
  536. "b": {
  537. "type": "LINEARCOMBINATION",
  538. "values": {
  539. "main.out[7]": "1",
  540. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  541. }
  542. },
  543. "c": {
  544. "type": "LINEARCOMBINATION",
  545. "values": {}
  546. }
  547. },
  548. {
  549. "type": "QEQ",
  550. "a": {
  551. "type": "LINEARCOMBINATION",
  552. "values": {
  553. "main.out[8]": "1"
  554. }
  555. },
  556. "b": {
  557. "type": "LINEARCOMBINATION",
  558. "values": {
  559. "main.out[8]": "1",
  560. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  561. }
  562. },
  563. "c": {
  564. "type": "LINEARCOMBINATION",
  565. "values": {}
  566. }
  567. },
  568. {
  569. "type": "QEQ",
  570. "a": {
  571. "type": "LINEARCOMBINATION",
  572. "values": {
  573. "main.out[9]": "1"
  574. }
  575. },
  576. "b": {
  577. "type": "LINEARCOMBINATION",
  578. "values": {
  579. "main.out[9]": "1",
  580. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  581. }
  582. },
  583. "c": {
  584. "type": "LINEARCOMBINATION",
  585. "values": {}
  586. }
  587. },
  588. {
  589. "type": "QEQ",
  590. "a": {
  591. "type": "LINEARCOMBINATION",
  592. "values": {
  593. "main.out[10]": "1"
  594. }
  595. },
  596. "b": {
  597. "type": "LINEARCOMBINATION",
  598. "values": {
  599. "main.out[10]": "1",
  600. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  601. }
  602. },
  603. "c": {
  604. "type": "LINEARCOMBINATION",
  605. "values": {}
  606. }
  607. },
  608. {
  609. "type": "QEQ",
  610. "a": {
  611. "type": "LINEARCOMBINATION",
  612. "values": {
  613. "main.out[11]": "1"
  614. }
  615. },
  616. "b": {
  617. "type": "LINEARCOMBINATION",
  618. "values": {
  619. "main.out[11]": "1",
  620. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  621. }
  622. },
  623. "c": {
  624. "type": "LINEARCOMBINATION",
  625. "values": {}
  626. }
  627. },
  628. {
  629. "type": "QEQ",
  630. "a": {
  631. "type": "LINEARCOMBINATION",
  632. "values": {
  633. "main.out[12]": "1"
  634. }
  635. },
  636. "b": {
  637. "type": "LINEARCOMBINATION",
  638. "values": {
  639. "main.out[12]": "1",
  640. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  641. }
  642. },
  643. "c": {
  644. "type": "LINEARCOMBINATION",
  645. "values": {}
  646. }
  647. },
  648. {
  649. "type": "QEQ",
  650. "a": {
  651. "type": "LINEARCOMBINATION",
  652. "values": {
  653. "main.out[13]": "1"
  654. }
  655. },
  656. "b": {
  657. "type": "LINEARCOMBINATION",
  658. "values": {
  659. "main.out[13]": "1",
  660. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  661. }
  662. },
  663. "c": {
  664. "type": "LINEARCOMBINATION",
  665. "values": {}
  666. }
  667. },
  668. {
  669. "type": "QEQ",
  670. "a": {
  671. "type": "LINEARCOMBINATION",
  672. "values": {
  673. "main.out[14]": "1"
  674. }
  675. },
  676. "b": {
  677. "type": "LINEARCOMBINATION",
  678. "values": {
  679. "main.out[14]": "1",
  680. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  681. }
  682. },
  683. "c": {
  684. "type": "LINEARCOMBINATION",
  685. "values": {}
  686. }
  687. },
  688. {
  689. "type": "QEQ",
  690. "a": {
  691. "type": "LINEARCOMBINATION",
  692. "values": {
  693. "main.out[15]": "1"
  694. }
  695. },
  696. "b": {
  697. "type": "LINEARCOMBINATION",
  698. "values": {
  699. "main.out[15]": "1",
  700. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  701. }
  702. },
  703. "c": {
  704. "type": "LINEARCOMBINATION",
  705. "values": {}
  706. }
  707. },
  708. {
  709. "type": "QEQ",
  710. "a": {
  711. "type": "LINEARCOMBINATION",
  712. "values": {
  713. "main.out[16]": "1"
  714. }
  715. },
  716. "b": {
  717. "type": "LINEARCOMBINATION",
  718. "values": {
  719. "main.out[16]": "1",
  720. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  721. }
  722. },
  723. "c": {
  724. "type": "LINEARCOMBINATION",
  725. "values": {}
  726. }
  727. },
  728. {
  729. "type": "QEQ",
  730. "a": {
  731. "type": "LINEARCOMBINATION",
  732. "values": {
  733. "main.out[17]": "1"
  734. }
  735. },
  736. "b": {
  737. "type": "LINEARCOMBINATION",
  738. "values": {
  739. "main.out[17]": "1",
  740. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  741. }
  742. },
  743. "c": {
  744. "type": "LINEARCOMBINATION",
  745. "values": {}
  746. }
  747. },
  748. {
  749. "type": "QEQ",
  750. "a": {
  751. "type": "LINEARCOMBINATION",
  752. "values": {
  753. "main.out[18]": "1"
  754. }
  755. },
  756. "b": {
  757. "type": "LINEARCOMBINATION",
  758. "values": {
  759. "main.out[18]": "1",
  760. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  761. }
  762. },
  763. "c": {
  764. "type": "LINEARCOMBINATION",
  765. "values": {}
  766. }
  767. },
  768. {
  769. "type": "QEQ",
  770. "a": {
  771. "type": "LINEARCOMBINATION",
  772. "values": {
  773. "main.out[19]": "1"
  774. }
  775. },
  776. "b": {
  777. "type": "LINEARCOMBINATION",
  778. "values": {
  779. "main.out[19]": "1",
  780. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  781. }
  782. },
  783. "c": {
  784. "type": "LINEARCOMBINATION",
  785. "values": {}
  786. }
  787. },
  788. {
  789. "type": "QEQ",
  790. "a": {
  791. "type": "LINEARCOMBINATION",
  792. "values": {
  793. "main.out[20]": "1"
  794. }
  795. },
  796. "b": {
  797. "type": "LINEARCOMBINATION",
  798. "values": {
  799. "main.out[20]": "1",
  800. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  801. }
  802. },
  803. "c": {
  804. "type": "LINEARCOMBINATION",
  805. "values": {}
  806. }
  807. },
  808. {
  809. "type": "QEQ",
  810. "a": {
  811. "type": "LINEARCOMBINATION",
  812. "values": {
  813. "main.out[21]": "1"
  814. }
  815. },
  816. "b": {
  817. "type": "LINEARCOMBINATION",
  818. "values": {
  819. "main.out[21]": "1",
  820. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  821. }
  822. },
  823. "c": {
  824. "type": "LINEARCOMBINATION",
  825. "values": {}
  826. }
  827. },
  828. {
  829. "type": "QEQ",
  830. "a": {
  831. "type": "LINEARCOMBINATION",
  832. "values": {
  833. "main.out[22]": "1"
  834. }
  835. },
  836. "b": {
  837. "type": "LINEARCOMBINATION",
  838. "values": {
  839. "main.out[22]": "1",
  840. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  841. }
  842. },
  843. "c": {
  844. "type": "LINEARCOMBINATION",
  845. "values": {}
  846. }
  847. },
  848. {
  849. "type": "QEQ",
  850. "a": {
  851. "type": "LINEARCOMBINATION",
  852. "values": {
  853. "main.out[23]": "1"
  854. }
  855. },
  856. "b": {
  857. "type": "LINEARCOMBINATION",
  858. "values": {
  859. "main.out[23]": "1",
  860. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  861. }
  862. },
  863. "c": {
  864. "type": "LINEARCOMBINATION",
  865. "values": {}
  866. }
  867. },
  868. {
  869. "type": "QEQ",
  870. "a": {
  871. "type": "LINEARCOMBINATION",
  872. "values": {
  873. "main.out[24]": "1"
  874. }
  875. },
  876. "b": {
  877. "type": "LINEARCOMBINATION",
  878. "values": {
  879. "main.out[24]": "1",
  880. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  881. }
  882. },
  883. "c": {
  884. "type": "LINEARCOMBINATION",
  885. "values": {}
  886. }
  887. },
  888. {
  889. "type": "QEQ",
  890. "a": {
  891. "type": "LINEARCOMBINATION",
  892. "values": {
  893. "main.out[25]": "1"
  894. }
  895. },
  896. "b": {
  897. "type": "LINEARCOMBINATION",
  898. "values": {
  899. "main.out[25]": "1",
  900. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  901. }
  902. },
  903. "c": {
  904. "type": "LINEARCOMBINATION",
  905. "values": {}
  906. }
  907. },
  908. {
  909. "type": "QEQ",
  910. "a": {
  911. "type": "LINEARCOMBINATION",
  912. "values": {
  913. "main.out[26]": "1"
  914. }
  915. },
  916. "b": {
  917. "type": "LINEARCOMBINATION",
  918. "values": {
  919. "main.out[26]": "1",
  920. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  921. }
  922. },
  923. "c": {
  924. "type": "LINEARCOMBINATION",
  925. "values": {}
  926. }
  927. },
  928. {
  929. "type": "QEQ",
  930. "a": {
  931. "type": "LINEARCOMBINATION",
  932. "values": {
  933. "main.out[27]": "1"
  934. }
  935. },
  936. "b": {
  937. "type": "LINEARCOMBINATION",
  938. "values": {
  939. "main.out[27]": "1",
  940. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  941. }
  942. },
  943. "c": {
  944. "type": "LINEARCOMBINATION",
  945. "values": {}
  946. }
  947. },
  948. {
  949. "type": "QEQ",
  950. "a": {
  951. "type": "LINEARCOMBINATION",
  952. "values": {
  953. "main.out[28]": "1"
  954. }
  955. },
  956. "b": {
  957. "type": "LINEARCOMBINATION",
  958. "values": {
  959. "main.out[28]": "1",
  960. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  961. }
  962. },
  963. "c": {
  964. "type": "LINEARCOMBINATION",
  965. "values": {}
  966. }
  967. },
  968. {
  969. "type": "QEQ",
  970. "a": {
  971. "type": "LINEARCOMBINATION",
  972. "values": {
  973. "main.out[29]": "1"
  974. }
  975. },
  976. "b": {
  977. "type": "LINEARCOMBINATION",
  978. "values": {
  979. "main.out[29]": "1",
  980. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  981. }
  982. },
  983. "c": {
  984. "type": "LINEARCOMBINATION",
  985. "values": {}
  986. }
  987. },
  988. {
  989. "type": "QEQ",
  990. "a": {
  991. "type": "LINEARCOMBINATION",
  992. "values": {
  993. "main.out[30]": "1"
  994. }
  995. },
  996. "b": {
  997. "type": "LINEARCOMBINATION",
  998. "values": {
  999. "main.out[30]": "1",
  1000. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  1001. }
  1002. },
  1003. "c": {
  1004. "type": "LINEARCOMBINATION",
  1005. "values": {}
  1006. }
  1007. },
  1008. {
  1009. "type": "QEQ",
  1010. "a": {
  1011. "type": "LINEARCOMBINATION",
  1012. "values": {
  1013. "main.out[31]": "1"
  1014. }
  1015. },
  1016. "b": {
  1017. "type": "LINEARCOMBINATION",
  1018. "values": {
  1019. "main.out[31]": "1",
  1020. "one": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  1021. }
  1022. },
  1023. "c": {
  1024. "type": "LINEARCOMBINATION",
  1025. "values": {}
  1026. }
  1027. },
  1028. {
  1029. "type": "QEQ",
  1030. "a": {
  1031. "type": "LINEARCOMBINATION",
  1032. "values": {}
  1033. },
  1034. "b": {
  1035. "type": "LINEARCOMBINATION",
  1036. "values": {}
  1037. },
  1038. "c": {
  1039. "type": "LINEARCOMBINATION",
  1040. "values": {
  1041. "main.out[0]": "1",
  1042. "main.out[1]": "2",
  1043. "main.out[2]": "4",
  1044. "main.out[3]": "8",
  1045. "main.out[4]": "16",
  1046. "main.out[5]": "32",
  1047. "main.out[6]": "64",
  1048. "main.out[7]": "128",
  1049. "main.out[8]": "256",
  1050. "main.out[9]": "512",
  1051. "main.out[10]": "1024",
  1052. "main.out[11]": "2048",
  1053. "main.out[12]": "4096",
  1054. "main.out[13]": "8192",
  1055. "main.out[14]": "16384",
  1056. "main.out[15]": "32768",
  1057. "main.out[16]": "65536",
  1058. "main.out[17]": "131072",
  1059. "main.out[18]": "262144",
  1060. "main.out[19]": "524288",
  1061. "main.out[20]": "1048576",
  1062. "main.out[21]": "2097152",
  1063. "main.out[22]": "4194304",
  1064. "main.out[23]": "8388608",
  1065. "main.out[24]": "16777216",
  1066. "main.out[25]": "33554432",
  1067. "main.out[26]": "67108864",
  1068. "main.out[27]": "134217728",
  1069. "main.out[28]": "268435456",
  1070. "main.out[29]": "536870912",
  1071. "main.out[30]": "1073741824",
  1072. "main.out[31]": "2147483648",
  1073. "main.in": "21888242871839275222246405745257275088548364400416034343698204186575808495616"
  1074. }
  1075. }
  1076. }
  1077. ];
  1078. circuit.witnessNames=[
  1079. [
  1080. "one"
  1081. ],
  1082. [
  1083. "main.in"
  1084. ],
  1085. [
  1086. "main.out[0]"
  1087. ],
  1088. [
  1089. "main.out[1]"
  1090. ],
  1091. [
  1092. "main.out[2]"
  1093. ],
  1094. [
  1095. "main.out[3]"
  1096. ],
  1097. [
  1098. "main.out[4]"
  1099. ],
  1100. [
  1101. "main.out[5]"
  1102. ],
  1103. [
  1104. "main.out[6]"
  1105. ],
  1106. [
  1107. "main.out[7]"
  1108. ],
  1109. [
  1110. "main.out[8]"
  1111. ],
  1112. [
  1113. "main.out[9]"
  1114. ],
  1115. [
  1116. "main.out[10]"
  1117. ],
  1118. [
  1119. "main.out[11]"
  1120. ],
  1121. [
  1122. "main.out[12]"
  1123. ],
  1124. [
  1125. "main.out[13]"
  1126. ],
  1127. [
  1128. "main.out[14]"
  1129. ],
  1130. [
  1131. "main.out[15]"
  1132. ],
  1133. [
  1134. "main.out[16]"
  1135. ],
  1136. [
  1137. "main.out[17]"
  1138. ],
  1139. [
  1140. "main.out[18]"
  1141. ],
  1142. [
  1143. "main.out[19]"
  1144. ],
  1145. [
  1146. "main.out[20]"
  1147. ],
  1148. [
  1149. "main.out[21]"
  1150. ],
  1151. [
  1152. "main.out[22]"
  1153. ],
  1154. [
  1155. "main.out[23]"
  1156. ],
  1157. [
  1158. "main.out[24]"
  1159. ],
  1160. [
  1161. "main.out[25]"
  1162. ],
  1163. [
  1164. "main.out[26]"
  1165. ],
  1166. [
  1167. "main.out[27]"
  1168. ],
  1169. [
  1170. "main.out[28]"
  1171. ],
  1172. [
  1173. "main.out[29]"
  1174. ],
  1175. [
  1176. "main.out[30]"
  1177. ],
  1178. [
  1179. "main.out[31]"
  1180. ]
  1181. ];
  1182. {
  1183. }
  1184. circuit.templates = {};
  1185. circuit.templates["AND"] = function(ctx) {
  1186. ctx.setSignal("c", [], bigInt(ctx.getSignal("a", [])).times(ctx.getSignal("b", [])).mod(__P__));
  1187. ctx.assert(ctx.getSignal("c", []), bigInt(ctx.getSignal("a", [])).times(ctx.getSignal("b", [])).mod(__P__));
  1188. }
  1189. ;
  1190. circuit.templates["AND3"] = function(ctx) {
  1191. ctx.setPin("and1", [], "a", [], ctx.getSignal("in1", []));
  1192. ctx.assert(ctx.getPin("and1", [], "a", []), ctx.getSignal("in1", []));
  1193. ctx.setPin("and1", [], "b", [], ctx.getSignal("in2", []));
  1194. ctx.assert(ctx.getPin("and1", [], "b", []), ctx.getSignal("in2", []));
  1195. ctx.setPin("and2", [], "a", [], ctx.getSignal("in3", []));
  1196. ctx.assert(ctx.getPin("and2", [], "a", []), ctx.getSignal("in3", []));
  1197. ctx.setPin("and2", [], "b", [], ctx.getPin("and1", [], "c", []));
  1198. ctx.assert(ctx.getPin("and2", [], "b", []), ctx.getPin("and1", [], "c", []));
  1199. ctx.setSignal("out", [], ctx.getPin("and2", [], "c", []));
  1200. ctx.assert(ctx.getSignal("out", []), ctx.getPin("and2", [], "c", []));
  1201. }
  1202. ;
  1203. circuit.templates["ToBin"] = function(ctx) {
  1204. ctx.setVar("lc", [], "0");
  1205. for (ctx.setVar("i", [], "0");bigInt(ctx.getVar("i",[])).lt("32") ? 1 : 0;(ctx.setVar("i", [], bigInt(ctx.getVar("i",[])).add("1").mod(__P__))).add(__P__).minus(1).mod(__P__))
  1206. {
  1207. ctx.setSignal("out", [ctx.getVar("i",[])], bigInt(bigInt(ctx.getVar("i",[])).greater(256) ? 0 : bigInt(ctx.getSignal("in", [])).shiftRight(bigInt(ctx.getVar("i",[])).value).and(__MASK__)).and("1").and(__MASK__));
  1208. ctx.setVar("lc", [], bigInt(ctx.getVar("lc",[])).add(bigInt(ctx.getSignal("out", [ctx.getVar("i",[])])).times(bigInt("2").modPow(ctx.getVar("i",[]), __P__)).mod(__P__)).mod(__P__));
  1209. ctx.assert(bigInt(ctx.getSignal("out", [ctx.getVar("i",[])])).times(bigInt(ctx.getSignal("out", [ctx.getVar("i",[])])).add(__P__).minus("1").mod(__P__)).mod(__P__), "0");
  1210. }
  1211. ctx.assert(ctx.getVar("lc",[]), ctx.getSignal("in", []));
  1212. }
  1213. ;
  1214. circuit.functionParams={};
  1215. circuit.functions = {};