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.

845 lines
26 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. const errs = require("./errs");
  2. const buildWasmFf = require("ffwasm").buildWasmFf;
  3. module.exports = function buildRuntime(module, builder) {
  4. const pSanityCheck = module.alloc(4);
  5. function buildInit() {
  6. const f = module.addFunction("init");
  7. f.addParam("sanityCheck", "i32");
  8. f.addLocal("i", "i32");
  9. const c = f.getCodeBuilder();
  10. // Set the stack to current memory
  11. f.addCode(
  12. c.i32_store(
  13. c.i32_const(4),
  14. c.i32_shl(
  15. c.i32_and(
  16. c.current_memory(),
  17. c.i32_const(0xFFFFFFF8)
  18. ),
  19. c.i32_const(16)
  20. )
  21. )
  22. );
  23. // Save Sanity check flag
  24. f.addCode(
  25. c.i32_store(
  26. c.i32_const(pSanityCheck),
  27. c.getLocal("sanityCheck")
  28. )
  29. );
  30. f.addCode(
  31. // i=0
  32. c.setLocal("i", c.i32_const(0)),
  33. c.block(c.loop(
  34. // if (i==NComponents) break
  35. c.br_if(1, c.i32_eq(c.getLocal("i"), c.i32_const(builder.header.NComponents))),
  36. // inputSignalsToTrigger[i] = components[i].nInputSignals
  37. c.i32_store(
  38. c.i32_add(
  39. c.i32_const(builder.pInputSignalsToTrigger),
  40. c.i32_mul(
  41. c.getLocal("i"),
  42. c.i32_const(4)
  43. )
  44. ),
  45. c.i32_load(
  46. c.i32_add(
  47. c.i32_load(c.i32_const(builder.ppComponents)),
  48. c.i32_mul(
  49. c.getLocal("i"),
  50. c.i32_const(builder.sizeofComponent) // Sizeof component
  51. )
  52. ),
  53. builder.offsetComponentNInputSignals
  54. )
  55. ),
  56. // i=i+1
  57. c.setLocal(
  58. "i",
  59. c.i32_add(
  60. c.getLocal("i"),
  61. c.i32_const(1)
  62. )
  63. ),
  64. c.br(0)
  65. ))
  66. );
  67. f.addCode(ifSanityCheck(c,
  68. // i=0
  69. c.setLocal("i", c.i32_const(0)),
  70. c.block(c.loop(
  71. // if (i==NSignals) break
  72. c.br_if(1, c.i32_eq(c.getLocal("i"), c.i32_const(builder.header.NSignals))),
  73. // signalsAssigned[i] = false
  74. c.i32_store(
  75. c.i32_add(
  76. c.i32_const(builder.pSignalsAssigned),
  77. c.i32_mul(
  78. c.getLocal("i"),
  79. c.i32_const(4)
  80. )
  81. ),
  82. c.i32_const(0)
  83. ),
  84. // i=i+1
  85. c.setLocal(
  86. "i",
  87. c.i32_add(
  88. c.getLocal("i"),
  89. c.i32_const(1)
  90. )
  91. ),
  92. c.br(0)
  93. ))
  94. ));
  95. f.addCode(
  96. c.call(
  97. "Fr_copy",
  98. c.i32_const(builder.pSignals),
  99. c.i32_add(
  100. c.i32_load(c.i32_const(builder.ppConstants)),
  101. c.i32_const(builder.addConstant(1) * builder.sizeFr)
  102. )
  103. )
  104. );
  105. f.addCode(ifSanityCheck(c,
  106. c.i32_store(
  107. c.i32_const(builder.pSignalsAssigned),
  108. c.i32_const(1)
  109. )
  110. ));
  111. f.addCode(
  112. // i=0
  113. c.setLocal("i", c.i32_const(0)),
  114. c.block(c.loop(
  115. // if (i==NComponents) break
  116. c.br_if(1, c.i32_eq(c.getLocal("i"), c.i32_const(builder.header.NComponents))),
  117. // if (inputSignalsToTrigger[i] == 0) triggerComponent(i)
  118. c.if(
  119. c.i32_eqz(
  120. c.i32_load(
  121. c.i32_add(
  122. c.i32_const(builder.pInputSignalsToTrigger),
  123. c.i32_mul(
  124. c.getLocal("i"),
  125. c.i32_const(4)
  126. )
  127. )
  128. )
  129. ),
  130. c.call(
  131. "triggerComponent",
  132. c.getLocal("i")
  133. )
  134. ),
  135. // i=i+1
  136. c.setLocal(
  137. "i",
  138. c.i32_add(
  139. c.getLocal("i"),
  140. c.i32_const(1)
  141. )
  142. ),
  143. c.br(0)
  144. ))
  145. );
  146. }
  147. function ifSanityCheck(c, ...args) {
  148. return c.if(
  149. c.i32_load(c.i32_const(pSanityCheck)),
  150. [].concat(...[...args])
  151. );
  152. }
  153. function buildTriggerComponent() {
  154. const f = module.addFunction("triggerComponent");
  155. f.addParam("component", "i32");
  156. const c = f.getCodeBuilder();
  157. f.addCode(
  158. c.call_indirect(
  159. c.getLocal("component"), // Idx in table
  160. c.getLocal("component") // Parameter
  161. )
  162. );
  163. }
  164. function buildHash2ComponentEntry() {
  165. const f = module.addFunction("hash2ComponentEntry");
  166. f.addParam("component", "i32");
  167. f.addParam("hash", "i64");
  168. f.setReturnType("i32");
  169. f.addLocal("pComponent", "i32");
  170. f.addLocal("pHashTable", "i32");
  171. f.addLocal("hIdx", "i32");
  172. f.addLocal("h", "i64");
  173. const c = f.getCodeBuilder();
  174. f.addCode(
  175. c.setLocal(
  176. "pComponent",
  177. c.i32_add(
  178. c.i32_load(c.i32_const(builder.ppComponents)), // pComponents
  179. c.i32_mul(
  180. c.getLocal("component"),
  181. c.i32_const(20) // sizeof(Component)
  182. )
  183. )
  184. ),
  185. c.setLocal(
  186. "pHashTable",
  187. c.i32_load(c.getLocal("pComponent"))
  188. ),
  189. c.setLocal(
  190. "hIdx",
  191. c.i32_and(
  192. c.i32_wrap_i64(c.getLocal("hash")),
  193. c.i32_const(0xFF)
  194. )
  195. ),
  196. c.block(c.loop(
  197. c.setLocal(
  198. "h",
  199. c.i64_load(
  200. c.i32_add(
  201. c.getLocal("pHashTable"),
  202. c.i32_mul(
  203. c.getLocal("hIdx"),
  204. c.i32_const(12)
  205. )
  206. )
  207. )
  208. ),
  209. c.br_if(1, c.i64_eq(c.getLocal("h"), c.getLocal("hash"))),
  210. c.if(
  211. c.i64_eqz(c.getLocal("h")),
  212. c.call(
  213. "error",
  214. c.i32_const(errs.HASH_NOT_FOUND.code),
  215. c.i32_const(errs.HASH_NOT_FOUND.pointer),
  216. c.i32_const(0),
  217. c.i32_const(0),
  218. c.i32_const(0),
  219. c.i32_const(0)
  220. )
  221. ),
  222. c.setLocal(
  223. "hIdx",
  224. c.i32_and(
  225. c.i32_add(
  226. c.getLocal("hIdx"),
  227. c.i32_const(1)
  228. ),
  229. c.i32_const(0xFF)
  230. )
  231. ),
  232. c.br(0)
  233. )),
  234. c.i32_add( // pComponentEntry
  235. c.i32_load( // pComponentEntryTable
  236. c.i32_add(
  237. c.getLocal("pComponent"),
  238. c.i32_const(4)
  239. )
  240. ),
  241. c.i32_mul(
  242. c.i32_load( // idx to the componentEntry
  243. c.i32_add(
  244. c.getLocal("pHashTable"),
  245. c.i32_mul(
  246. c.getLocal("hIdx"),
  247. c.i32_const(12)
  248. )
  249. ),
  250. 8
  251. ),
  252. c.i32_const(12)
  253. )
  254. )
  255. );
  256. }
  257. function buildGetFromComponentEntry(fnName, offset, type) {
  258. const f = module.addFunction(fnName);
  259. f.addParam("pR", "i32");
  260. f.addParam("component", "i32");
  261. f.addParam("hash", "i64");
  262. f.addLocal("pComponentEntry", "i32");
  263. const c = f.getCodeBuilder();
  264. f.addCode(
  265. c.setLocal(
  266. "pComponentEntry",
  267. c.call(
  268. "hash2ComponentEntry",
  269. c.getLocal("component"),
  270. c.getLocal("hash")
  271. )
  272. ),
  273. c.if( // If type is not signal
  274. c.i32_ne(
  275. c.i32_load(
  276. c.getLocal("pComponentEntry"),
  277. 8 // type offset
  278. ),
  279. c.i32_const(type)
  280. ),
  281. c.call(
  282. "error",
  283. c.i32_const(errs.INVALID_TYPE.code),
  284. c.i32_const(errs.INVALID_TYPE.pointer),
  285. c.i32_const(0),
  286. c.i32_const(0),
  287. c.i32_const(0),
  288. c.i32_const(0)
  289. )
  290. ),
  291. c.i32_store(
  292. c.getLocal("pR"),
  293. c.i32_load(
  294. c.getLocal("pComponentEntry"),
  295. offset
  296. )
  297. )
  298. );
  299. const f2 = module.addFunction(fnName + "32");
  300. f2.addParam("pR", "i32");
  301. f2.addParam("component", "i32");
  302. f2.addParam("hashMSB", "i32");
  303. f2.addParam("hashLSB", "i32");
  304. const c2 = f2.getCodeBuilder();
  305. f2.addCode(
  306. c2.call(
  307. fnName,
  308. c2.getLocal("pR"),
  309. c2.getLocal("component"),
  310. c2.i64_or(
  311. c2.i64_shl(
  312. c2.i64_extend_i32_u(c2.getLocal("hashMSB")),
  313. c2.i64_const(32)
  314. ),
  315. c2.i64_extend_i32_u(c2.getLocal("hashLSB"))
  316. )
  317. )
  318. );
  319. }
  320. function buildGetSignal() {
  321. const f = module.addFunction("getSignal");
  322. f.addParam("cIdx", "i32");
  323. f.addParam("pR", "i32");
  324. f.addParam("component", "i32");
  325. f.addParam("signal", "i32");
  326. const c = f.getCodeBuilder();
  327. f.addCode(ifSanityCheck(c,
  328. c.if(
  329. c.i32_eqz(
  330. c.i32_load(
  331. c.i32_add(
  332. c.i32_const(builder.pSignalsAssigned),
  333. c.i32_mul(
  334. c.getLocal("signal"),
  335. c.i32_const(4)
  336. )
  337. ),
  338. )
  339. ),
  340. c.call(
  341. "error",
  342. c.i32_const(errs.ACCESSING_NOT_ASSIGNED_SIGNAL.code),
  343. c.i32_const(errs.ACCESSING_NOT_ASSIGNED_SIGNAL.pointer),
  344. c.i32_const(0),
  345. c.i32_const(0),
  346. c.i32_const(0),
  347. c.i32_const(0)
  348. )
  349. )
  350. ));
  351. f.addCode(
  352. c.call(
  353. "Fr_copy",
  354. c.getLocal("pR"),
  355. c.i32_add(
  356. c.i32_const(builder.pSignals),
  357. c.i32_mul(
  358. c.getLocal("signal"),
  359. c.i32_const(builder.sizeFr)
  360. )
  361. )
  362. )
  363. );
  364. f.addCode(ifSanityCheck(c,
  365. c.call("logGetSignal", c.getLocal("signal"), c.getLocal("pR") )
  366. ));
  367. }
  368. function buildSetSignal() {
  369. const f = module.addFunction("setSignal");
  370. f.addParam("cIdx", "i32");
  371. f.addParam("component", "i32");
  372. f.addParam("signal", "i32");
  373. f.addParam("pVal", "i32");
  374. f.addLocal("signalsToTrigger", "i32");
  375. const c = f.getCodeBuilder();
  376. f.addCode(ifSanityCheck(c,
  377. c.call("logSetSignal", c.getLocal("signal"), c.getLocal("pVal") ),
  378. c.if(
  379. c.i32_load(
  380. c.i32_add(
  381. c.i32_const(builder.pSignalsAssigned),
  382. c.i32_mul(
  383. c.getLocal("signal"),
  384. c.i32_const(4)
  385. )
  386. ),
  387. ),
  388. c.call(
  389. "error",
  390. c.i32_const(errs.SIGNAL_ASSIGNED_TWICE.code),
  391. c.i32_const(errs.SIGNAL_ASSIGNED_TWICE.pointer),
  392. c.i32_const(0),
  393. c.i32_const(0),
  394. c.i32_const(0),
  395. c.i32_const(0)
  396. )
  397. ),
  398. c.i32_store(
  399. c.i32_add(
  400. c.i32_const(builder.pSignalsAssigned),
  401. c.i32_mul(
  402. c.getLocal("signal"),
  403. c.i32_const(4)
  404. )
  405. ),
  406. c.i32_const(1)
  407. ),
  408. ));
  409. f.addCode(
  410. c.call(
  411. "Fr_copy",
  412. c.i32_add(
  413. c.i32_const(builder.pSignals),
  414. c.i32_mul(
  415. c.getLocal("signal"),
  416. c.i32_const(builder.sizeFr)
  417. )
  418. ),
  419. c.getLocal("pVal"),
  420. )
  421. );
  422. f.addCode(
  423. c.if( // If ( mapIsInput[s >> 5] & 1 << (s & 0x1f) )
  424. c.i32_and(
  425. c.i32_load(
  426. c.i32_add(
  427. c.i32_load(c.i32_const(builder.ppMapIsInput)),
  428. c.i32_shl(
  429. c.i32_shr_u(
  430. c.getLocal("signal"),
  431. c.i32_const(5)
  432. ),
  433. c.i32_const(2)
  434. )
  435. )
  436. ),
  437. c.i32_shl(
  438. c.i32_const(1),
  439. c.i32_and(
  440. c.getLocal("signal"),
  441. c.i32_const(0x1F)
  442. )
  443. )
  444. ),
  445. [
  446. ...c.setLocal(
  447. "signalsToTrigger",
  448. c.i32_load(
  449. c.i32_add(
  450. c.i32_const(builder.pInputSignalsToTrigger),
  451. c.i32_mul(
  452. c.getLocal("component"),
  453. c.i32_const(4)
  454. )
  455. )
  456. )
  457. ),
  458. ...c.if( // if (signalsToTrigger > 0)
  459. c.i32_gt_u(
  460. c.getLocal("signalsToTrigger"),
  461. c.i32_const(0)
  462. ),
  463. [
  464. ...c.setLocal( // signalsToTrigger--
  465. "signalsToTrigger",
  466. c.i32_sub(
  467. c.getLocal("signalsToTrigger"),
  468. c.i32_const(1)
  469. )
  470. ),
  471. ...c.i32_store(
  472. c.i32_add(
  473. c.i32_const(builder.pInputSignalsToTrigger),
  474. c.i32_mul(
  475. c.getLocal("component"),
  476. c.i32_const(4)
  477. )
  478. ),
  479. c.getLocal("signalsToTrigger"),
  480. ),
  481. ...c.if( // if (signalsToTrigger==0) triggerCompomnent(component)
  482. c.i32_eqz(c.getLocal("signalsToTrigger")),
  483. c.call(
  484. "triggerComponent",
  485. c.getLocal("component")
  486. )
  487. )
  488. ],
  489. c.call(
  490. "error",
  491. c.i32_const(errs.MAPISINPUT_DONT_MATCH.code),
  492. c.i32_const(errs.MAPISINPUT_DONT_MATCH.pointer),
  493. c.getLocal("component"),
  494. c.getLocal("signal"),
  495. c.i32_const(0),
  496. c.i32_const(0)
  497. )
  498. )
  499. ]
  500. )
  501. );
  502. }
  503. function buildComponentFinished() {
  504. const f = module.addFunction("componentFinished");
  505. f.addParam("cIdx", "i32");
  506. const c = f.getCodeBuilder();
  507. f.addCode(ifSanityCheck(c,
  508. c.call("logFinishComponent", c.getLocal("cIdx"))
  509. ));
  510. f.addCode(c.ret([]));
  511. }
  512. function buildComponentStarted() {
  513. const f = module.addFunction("componentStarted");
  514. f.addParam("cIdx", "i32");
  515. const c = f.getCodeBuilder();
  516. f.addCode(ifSanityCheck(c,
  517. c.call("logStartComponent", c.getLocal("cIdx"))
  518. ));
  519. f.addCode(c.ret([]));
  520. }
  521. function buildCheckConstraint() {
  522. const pTmp = module.alloc(builder.sizeFr);
  523. const f = module.addFunction("checkConstraint");
  524. f.addParam("cIdx", "i32");
  525. f.addParam("pA", "i32");
  526. f.addParam("pB", "i32");
  527. f.addParam("pStr", "i32");
  528. const c = f.getCodeBuilder();
  529. f.addCode(ifSanityCheck(c,
  530. c.call(
  531. "Fr_eq",
  532. c.i32_const(pTmp),
  533. c.getLocal("pA"),
  534. c.getLocal("pB")
  535. ),
  536. c.if (
  537. c.i32_eqz(
  538. c.call(
  539. "Fr_isTrue",
  540. c.i32_const(pTmp),
  541. )
  542. ),
  543. c.call(
  544. "error",
  545. c.i32_const(errs.CONSTRAIN_DOES_NOT_MATCH.code),
  546. c.i32_const(errs.CONSTRAIN_DOES_NOT_MATCH.pointer),
  547. c.getLocal("cIdx"),
  548. c.getLocal("pA"),
  549. c.getLocal("pB"),
  550. c.getLocal("pStr"),
  551. )
  552. )
  553. ));
  554. }
  555. function buildGetNVars() {
  556. const f = module.addFunction("getNVars");
  557. f.setReturnType("i32");
  558. const c = f.getCodeBuilder();
  559. f.addCode(c.i32_const(builder.header.NVars));
  560. }
  561. function buildGetFrLen() {
  562. const f = module.addFunction("getFrLen");
  563. f.setReturnType("i32");
  564. const c = f.getCodeBuilder();
  565. f.addCode(
  566. c.i32_const(builder.sizeFr));
  567. }
  568. function buildGetPRawPrime() {
  569. const f = module.addFunction("getPRawPrime");
  570. f.setReturnType("i32");
  571. const c = f.getCodeBuilder();
  572. f.addCode(
  573. c.i32_const(module.modules["Fr_F1m"].pq));
  574. }
  575. function buildGetPWitness() {
  576. const f = module.addFunction("getPWitness");
  577. f.addParam("w", "i32");
  578. f.addLocal("signal", "i32");
  579. f.setReturnType("i32");
  580. const c = f.getCodeBuilder();
  581. f.addCode(
  582. c.setLocal(
  583. "signal",
  584. c.i32_load( // wit2sig[w]
  585. c.i32_add(
  586. c.i32_load( c.i32_const(builder.ppWit2sig)),
  587. c.i32_mul(
  588. c.getLocal("w"),
  589. c.i32_const(4)
  590. )
  591. )
  592. )
  593. )
  594. );
  595. if (builder.sanityCheck) {
  596. f.addCode(
  597. c.if(
  598. c.i32_eqz(
  599. c.i32_load(
  600. c.i32_add(
  601. c.i32_const(builder.pSignalsAssigned),
  602. c.i32_mul(
  603. c.getLocal("signal"),
  604. c.i32_const(4)
  605. )
  606. ),
  607. )
  608. ),
  609. c.call(
  610. "error",
  611. c.i32_const(errs.ACCESSING_NOT_ASSIGNED_SIGNAL.code),
  612. c.i32_const(errs.ACCESSING_NOT_ASSIGNED_SIGNAL.pointer),
  613. c.i32_const(0),
  614. c.i32_const(0),
  615. c.i32_const(0),
  616. c.i32_const(0)
  617. )
  618. )
  619. );
  620. }
  621. f.addCode(
  622. c.i32_add(
  623. c.i32_const(builder.pSignals),
  624. c.i32_mul(
  625. c.getLocal("signal"),
  626. c.i32_const(builder.sizeFr)
  627. )
  628. )
  629. );
  630. }
  631. function buildGetWitnessBuffer() {
  632. const f = module.addFunction("getWitnessBuffer");
  633. f.setReturnType("i32");
  634. f.addLocal("i", "i32");
  635. f.addLocal("pSrc", "i32");
  636. f.addLocal("pDst", "i32");
  637. const c = f.getCodeBuilder();
  638. f.addCode(
  639. c.setLocal("i", c.i32_const(0)),
  640. c.block(c.loop(
  641. // if (i==NComponents) break
  642. c.br_if(1, c.i32_eq(c.getLocal("i"), c.i32_const(builder.header.NVars))),
  643. c.setLocal(
  644. "pSrc",
  645. c.call(
  646. "getPWitness",
  647. c.getLocal("i"),
  648. )
  649. ),
  650. c.call(
  651. "Fr_toLongNormal",
  652. c.getLocal("pSrc")
  653. ),
  654. c.setLocal(
  655. "pDst",
  656. c.i32_add(
  657. c.i32_const(builder.pOutput),
  658. c.i32_mul(
  659. c.getLocal("i"),
  660. c.i32_const(builder.sizeFr-8)
  661. )
  662. )
  663. ),
  664. c.call(
  665. "Fr_F1m_copy",
  666. c.i32_add(c.getLocal("pSrc"), c.i32_const(8)),
  667. c.getLocal("pDst")
  668. ),
  669. // i=i+1
  670. c.setLocal(
  671. "i",
  672. c.i32_add(
  673. c.getLocal("i"),
  674. c.i32_const(1)
  675. )
  676. ),
  677. c.br(0)
  678. )),
  679. c.i32_const(builder.pOutput)
  680. );
  681. }
  682. const fError = module.addIimportFunction("error", "runtime");
  683. fError.addParam("code", "i32");
  684. fError.addParam("pStr", "i32");
  685. fError.addParam("param1", "i32");
  686. fError.addParam("param2", "i32");
  687. fError.addParam("param3", "i32");
  688. fError.addParam("param4", "i32");
  689. const fLogSetSignal = module.addIimportFunction("logSetSignal", "runtime");
  690. fLogSetSignal.addParam("signal", "i32");
  691. fLogSetSignal.addParam("val", "i32");
  692. const fLogGetSignal = module.addIimportFunction("logGetSignal", "runtime");
  693. fLogGetSignal.addParam("signal", "i32");
  694. fLogGetSignal.addParam("val", "i32");
  695. const fLogFinishComponent = module.addIimportFunction("logFinishComponent", "runtime");
  696. fLogFinishComponent.addParam("cIdx", "i32");
  697. const fLogStartComponent = module.addIimportFunction("logStartComponent", "runtime");
  698. fLogStartComponent.addParam("cIdx", "i32");
  699. const fLog = module.addIimportFunction("log", "runtime");
  700. fLog.addParam("code", "i32");
  701. buildWasmFf(module, "Fr", builder.header.P);
  702. builder.pSignals=module.alloc(builder.header.NSignals*builder.sizeFr);
  703. builder.pOutput=module.alloc(builder.header.NVars*(builder.sizeFr-8));
  704. builder.pInputSignalsToTrigger=module.alloc(builder.header.NComponents*4);
  705. builder.pSignalsAssigned=module.alloc(builder.header.NSignals*4);
  706. buildHash2ComponentEntry();
  707. buildTriggerComponent();
  708. buildInit();
  709. buildGetFromComponentEntry("getSubComponentOffset", 0 /* offset */, builder.TYPE_COMPONENT);
  710. buildGetFromComponentEntry("getSubComponentSizes", 4 /* offset */, builder.TYPE_COMPONENT);
  711. buildGetFromComponentEntry("getSignalOffset", 0 /* offset */, builder.TYPE_SIGNAL);
  712. buildGetFromComponentEntry("getSignalSizes", 4 /* offset */, builder.TYPE_SIGNAL);
  713. buildGetSignal();
  714. buildSetSignal();
  715. buildComponentStarted();
  716. buildComponentFinished();
  717. buildCheckConstraint();
  718. buildGetNVars();
  719. buildGetFrLen();
  720. buildGetPWitness();
  721. buildGetPRawPrime();
  722. buildGetWitnessBuffer();
  723. // buildFrToInt();
  724. module.exportFunction("init");
  725. module.exportFunction("getNVars");
  726. module.exportFunction("getFrLen");
  727. module.exportFunction("getSignalOffset32");
  728. module.exportFunction("setSignal");
  729. module.exportFunction("getPWitness");
  730. module.exportFunction("Fr_toInt");
  731. module.exportFunction("getPRawPrime");
  732. module.exportFunction("getWitnessBuffer");
  733. };