@hinkal/common 0.0.65 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/assets/{snarkjsWorkerLauncher-Cxayz-rO.js → snarkjsWorkerLauncher-CAfPlZZk.js} +1 -1
  2. package/assets/{snarkjsWorkerLogic-scy9tbGQ.js → snarkjsWorkerLogic-BkSolcWj.js} +615 -612
  3. package/assets/{snarkjsWorkerLogic-C0jhwQeU.js → snarkjsWorkerLogic-CfOGOfbH.js} +26 -29
  4. package/assets/{utxoWorkerLauncher-949gA7j-.js → utxoWorkerLauncher-DnwHvvqe.js} +1 -1
  5. package/assets/{utxoWorkerLogic-CyWO48JX.js → utxoWorkerLogic-7GeccTLS.js} +30 -25
  6. package/assets/{utxoWorkerLogic-CWVrduGP.js → utxoWorkerLogic-YmFgVUCJ.js} +4 -4
  7. package/assets/viteWorkerURL.constant-DU3D7LKk.js +11 -0
  8. package/assets/{zkProofWorkerLauncher-B54jpyIs.js → zkProofWorkerLauncher-C2KuMm7O.js} +1 -1
  9. package/assets/{zkProofWorkerLogic-g413cUJh.js → zkProofWorkerLogic-Bd0sRQ50.js} +61833 -58147
  10. package/data-structures/Hinkal/Hinkal.d.ts +1 -0
  11. package/data-structures/Hinkal/IHinkal.d.ts +1 -0
  12. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -0
  13. package/data-structures/Hinkal/index.d.ts +1 -0
  14. package/externalABIs/index.d.ts +2 -1
  15. package/functions/index.d.ts +1 -0
  16. package/functions/private-wallet/emporium.helpers.d.ts +5 -0
  17. package/functions/private-wallet/index.d.ts +2 -0
  18. package/functions/private-wallet/opProducer.d.ts +5 -0
  19. package/functions/snarkjs/constructEmporiumProof.d.ts +10 -0
  20. package/functions/snarkjs/index.d.ts +1 -0
  21. package/{index-NUnUt2WT.js → index-BCgedduK.mjs} +48762 -43677
  22. package/index.mjs +456 -0
  23. package/package.json +3 -1
  24. package/{snarkjsWorkerLogic-kMemW87G.js → snarkjsWorkerLogic-B7Hr8R4L.mjs} +615 -611
  25. package/types/ethereum-network.types.d.ts +1 -0
  26. package/types/hinkal.types.d.ts +1 -0
  27. package/{utxoWorkerLogic-rJ2_iL6U.js → utxoWorkerLogic-BEfHrOd3.mjs} +2 -2
  28. package/viteWorkerURL.constant-Dj8YKvHN.mjs +9 -0
  29. package/{workerProxy-CTJEGxeD.js → workerProxy-D7RxpMZi.mjs} +1 -1
  30. package/{zkProofWorkerLogic-DRKw4LUS.js → zkProofWorkerLogic-C0Khxd9i.mjs} +2 -2
  31. package/assets/viteWorkerURL.constant-D9TTkFfm.js +0 -11
  32. package/index.js +0 -449
  33. package/viteWorkerURL.constant-Dl3Bss90.js +0 -9
@@ -1,13 +1,13 @@
1
- import { e as Ua, p as Se, r as po, g as ho, B as Lo, a as mo, b as bo, c as en, d as ja, f as $a, u as zn } from "./index-NUnUt2WT.js";
2
- import { W as yo } from "./workerProxy-CTJEGxeD.js";
1
+ import { r as sn, g as ja, p as Se, a as Lo, B as mo, b as bo, c as en, e as $a, d as Ga, u as Un } from "./index-BCgedduK.mjs";
2
+ import { W as yo } from "./workerProxy-D7RxpMZi.mjs";
3
3
  const Co = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
4
- function sn(c, t) {
4
+ function rn(c, t) {
5
5
  if (!t || t == 10)
6
6
  return BigInt(c);
7
7
  if (t == 16)
8
8
  return c.slice(0, 2) == "0x" ? BigInt(c) : BigInt("0x" + c);
9
9
  }
10
- const ve = sn;
10
+ const ve = rn;
11
11
  function Ao(c, t) {
12
12
  let e = BigInt(0);
13
13
  t = BigInt(t);
@@ -15,7 +15,7 @@ function Ao(c, t) {
15
15
  e = e * t + BigInt(c[n]);
16
16
  return e;
17
17
  }
18
- function Ga(c) {
18
+ function Za(c) {
19
19
  const t = c.toString(16);
20
20
  return (t.length - 1) * 4 + Co[parseInt(t[0], 16)];
21
21
  }
@@ -25,13 +25,13 @@ function Fo(c) {
25
25
  function Eo(c) {
26
26
  return !c;
27
27
  }
28
- function Za(c, t) {
28
+ function Wa(c, t) {
29
29
  return BigInt(c) << BigInt(t);
30
30
  }
31
- function Un(c, t) {
31
+ function jn(c, t) {
32
32
  return BigInt(c) >> BigInt(t);
33
33
  }
34
- const wo = Za, Bo = Un;
34
+ const wo = Wa, Bo = jn;
35
35
  function vo(c) {
36
36
  return (BigInt(c) & BigInt(1)) == BigInt(1);
37
37
  }
@@ -55,7 +55,7 @@ function So(c) {
55
55
  t & BigInt(1) ? e.push(1) : e.push(0), t = t >> BigInt(1);
56
56
  return e;
57
57
  }
58
- function Wa(c) {
58
+ function Xa(c) {
59
59
  if (c > BigInt(Number.MAX_SAFE_INTEGER))
60
60
  throw new Error("Number too big");
61
61
  return Number(c);
@@ -115,7 +115,7 @@ function Zo(c, t) {
115
115
  function Wo(c, t) {
116
116
  return BigInt(c) >= BigInt(t);
117
117
  }
118
- function Xa(c, t) {
118
+ function Va(c, t) {
119
119
  return BigInt(c) & BigInt(t);
120
120
  }
121
121
  function Xo(c, t) {
@@ -133,14 +133,14 @@ function Qo(c, t) {
133
133
  function Jo(c) {
134
134
  return !BigInt(c);
135
135
  }
136
- function Va(c, t, e, n) {
136
+ function Ha(c, t, e, n) {
137
137
  const a = "0000000" + e.toString(16), s = new Uint32Array(c.buffer, c.byteOffset + t, n / 4), g = ((a.length - 7) * 4 - 1 >> 5) + 1;
138
138
  for (let d = 0; d < g; d++)
139
139
  s[d] = parseInt(a.substring(a.length - 8 * d - 8, a.length - 8 * d), 16);
140
140
  for (let d = g; d < s.length; d++)
141
141
  s[d] = 0;
142
142
  for (let d = s.length * 4; d < n; d++)
143
- c[d] = Wa(Xa(Un(e, d * 8), 255));
143
+ c[d] = Xa(Va(jn(e, d * 8), 255));
144
144
  }
145
145
  function Ko(c, t, e, n) {
146
146
  const a = "0000000" + e.toString(16), s = new DataView(c.buffer, c.byteOffset + t, n), g = ((a.length - 7) * 4 - 1 >> 5) + 1;
@@ -152,29 +152,29 @@ function Ko(c, t, e, n) {
152
152
  function Yo(c, t, e) {
153
153
  e = e || c.byteLength, t = t || 0;
154
154
  const n = new Uint32Array(c.buffer, c.byteOffset + t, e / 4), a = new Array(e / 4);
155
- return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), sn(a.join(""), 16);
155
+ return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), rn(a.join(""), 16);
156
156
  }
157
157
  function tc(c, t, e) {
158
158
  e = e || c.byteLength, t = t || 0;
159
159
  const n = new DataView(c.buffer, c.byteOffset + t, e), a = new Array(e / 4);
160
160
  for (let s = 0; s < e / 4; s++)
161
161
  a[s] = n.getUint32(s * 4, !1).toString(16).padStart(8, "0");
162
- return sn(a.join(""), 16);
162
+ return rn(a.join(""), 16);
163
163
  }
164
164
  function ec(c, t) {
165
165
  return c.toString(t);
166
166
  }
167
167
  function nc(c) {
168
- const t = new Uint8Array(Math.floor((Ga(c) - 1) / 8) + 1);
169
- return Va(t, 0, c, t.byteLength), t;
168
+ const t = new Uint8Array(Math.floor((Za(c) - 1) / 8) + 1);
169
+ return Ha(t, 0, c, t.byteLength), t;
170
170
  }
171
171
  const ac = ve(0), ic = ve(1);
172
172
  var oc = /* @__PURE__ */ Object.freeze({
173
173
  __proto__: null,
174
174
  abs: Ro,
175
175
  add: Oo,
176
- band: Xa,
177
- bitLength: Ga,
176
+ band: Va,
177
+ bitLength: Za,
178
178
  bits: So,
179
179
  bor: Xo,
180
180
  bxor: Vo,
@@ -185,7 +185,7 @@ var oc = /* @__PURE__ */ Object.freeze({
185
185
  fromArray: Ao,
186
186
  fromRprBE: tc,
187
187
  fromRprLE: Yo,
188
- fromString: sn,
188
+ fromString: rn,
189
189
  geq: Wo,
190
190
  gt: Go,
191
191
  isNegative: Fo,
@@ -203,22 +203,22 @@ var oc = /* @__PURE__ */ Object.freeze({
203
203
  neq: jo,
204
204
  one: ic,
205
205
  pow: Do,
206
- shiftLeft: Za,
207
- shiftRight: Un,
206
+ shiftLeft: Wa,
207
+ shiftRight: jn,
208
208
  shl: wo,
209
209
  shr: Bo,
210
210
  square: qo,
211
211
  sub: Po,
212
212
  toArray: Io,
213
213
  toLEBuff: nc,
214
- toNumber: Wa,
214
+ toNumber: Xa,
215
215
  toRprBE: Ko,
216
- toRprLE: Va,
216
+ toRprLE: Ha,
217
217
  toString: ec,
218
218
  zero: ac
219
219
  });
220
220
  const ce = 1 << 30;
221
- let cc = class xn {
221
+ let cc = class Sn {
222
222
  constructor(t) {
223
223
  this.buffers = [], this.byteLength = t;
224
224
  for (let e = 0; e < t; e += ce) {
@@ -236,7 +236,7 @@ let cc = class xn {
236
236
  const o = C + l > ce ? ce - C : l, y = new Uint8Array(this.buffers[d].buffer, this.buffers[d].byteOffset + C, o);
237
237
  if (o == n)
238
238
  return y.slice();
239
- g || (n <= ce ? g = new Uint8Array(n) : g = new xn(n)), g.set(y, n - l), l = l - o, d++, C = 0;
239
+ g || (n <= ce ? g = new Uint8Array(n) : g = new Sn(n)), g.set(y, n - l), l = l - o, d++, C = 0;
240
240
  }
241
241
  return g;
242
242
  }
@@ -247,7 +247,7 @@ let cc = class xn {
247
247
  return;
248
248
  const a = Math.floor(e / ce), s = Math.floor((e + n - 1) / ce);
249
249
  if (a == s)
250
- return t instanceof xn && t.buffers.length == 1 ? this.buffers[a].set(t.buffers[0], e % ce) : this.buffers[a].set(t, e % ce);
250
+ return t instanceof Sn && t.buffers.length == 1 ? this.buffers[a].set(t.buffers[0], e % ce) : this.buffers[a].set(t, e % ce);
251
251
  let g = a, d = e % ce, C = n;
252
252
  for (; C > 0; ) {
253
253
  const l = d + C > ce ? ce - d : C, o = t.slice(n - C, n - C + l);
@@ -384,14 +384,16 @@ ve("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
384
384
  ve("21888242871839275222246405745257275088548364400416034343698204186575808495617");
385
385
  ve("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16);
386
386
  ve("21888242871839275222246405745257275088696311157297823662689037894645226208583");
387
- const Ha = oc;
388
- async function Qa(c, t, e, n) {
387
+ const Qa = oc;
388
+ var rc = sn();
389
+ const Ja = /* @__PURE__ */ ja(rc);
390
+ async function Ka(c, t, e, n) {
389
391
  if (e = e || 4096 * 64, typeof t != "number" && ["w+", "wx+", "r", "ax+", "a+"].indexOf(t) < 0)
390
392
  throw new Error("Invalid open option");
391
- const a = await Ua.promises.open(c, t), s = await a.stat();
392
- return new rc(a, s, e, n, c);
393
+ const a = await Ja.promises.open(c, t), s = await a.stat();
394
+ return new lc(a, s, e, n, c);
393
395
  }
394
- class rc {
396
+ class lc {
395
397
  constructor(t, e, n, a, s) {
396
398
  for (this.fileName = s, this.fd = t, this.pos = 0, this.pageSize = a || 256; this.pageSize < e.blksize; )
397
399
  this.pageSize *= 2;
@@ -564,7 +566,7 @@ class rc {
564
566
  });
565
567
  }
566
568
  async discard() {
567
- await this.close(), await Ua.promises.unlink(this.fileName);
569
+ await this.close(), await Ja.promises.unlink(this.fileName);
568
570
  }
569
571
  async writeULE32(t, e) {
570
572
  const n = this, a = new Uint8Array(4);
@@ -610,16 +612,16 @@ class rc {
610
612
  return g;
611
613
  }
612
614
  }
613
- function lc(c) {
614
- const t = c.initialSize || 1048576, e = new Ka();
615
+ function uc(c) {
616
+ const t = c.initialSize || 1048576, e = new ti();
615
617
  return e.o = c, e.o.data = new Uint8Array(t), e.allocSize = t, e.totalSize = 0, e.readOnly = !1, e.pos = 0, e;
616
618
  }
617
- function uc(c) {
618
- const t = new Ka();
619
+ function dc(c) {
620
+ const t = new ti();
619
621
  return t.o = c, t.allocSize = c.data.byteLength, t.totalSize = c.data.byteLength, t.readOnly = !0, t.pos = 0, t;
620
622
  }
621
- const Sn = new Uint8Array(4), oa = new DataView(Sn.buffer), Ja = new Uint8Array(8), ca = new DataView(Ja.buffer);
622
- class Ka {
623
+ const In = new Uint8Array(4), ca = new DataView(In.buffer), Ya = new Uint8Array(8), sa = new DataView(Ya.buffer);
624
+ class ti {
623
625
  constructor() {
624
626
  this.pageSize = 16384;
625
627
  }
@@ -656,15 +658,15 @@ class Ka {
656
658
  }
657
659
  async writeULE32(t, e) {
658
660
  const n = this;
659
- oa.setUint32(0, t, !0), await n.write(Sn, e);
661
+ ca.setUint32(0, t, !0), await n.write(In, e);
660
662
  }
661
663
  async writeUBE32(t, e) {
662
664
  const n = this;
663
- oa.setUint32(0, t, !1), await n.write(Sn, e);
665
+ ca.setUint32(0, t, !1), await n.write(In, e);
664
666
  }
665
667
  async writeULE64(t, e) {
666
668
  const n = this;
667
- ca.setUint32(0, t & 4294967295, !0), ca.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(Ja, e);
669
+ sa.setUint32(0, t & 4294967295, !0), sa.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(Ya, e);
668
670
  }
669
671
  async readULE32(t) {
670
672
  const n = await this.read(4, t);
@@ -696,8 +698,8 @@ class Ka {
696
698
  }
697
699
  }
698
700
  const ne = 1 << 22;
699
- function dc(c) {
700
- const t = c.initialSize || 0, e = new ti();
701
+ function fc(c) {
702
+ const t = c.initialSize || 0, e = new ni();
701
703
  e.o = c;
702
704
  const n = t ? Math.floor((t - 1) / ne) + 1 : 0;
703
705
  e.o.data = [];
@@ -705,12 +707,12 @@ function dc(c) {
705
707
  e.o.data.push(new Uint8Array(ne));
706
708
  return n && e.o.data.push(new Uint8Array(t - ne * (n - 1))), e.totalSize = 0, e.readOnly = !1, e.pos = 0, e;
707
709
  }
708
- function fc(c) {
709
- const t = new ti();
710
+ function _c(c) {
711
+ const t = new ni();
710
712
  return t.o = c, t.totalSize = (c.data.length - 1) * ne + c.data[c.data.length - 1].byteLength, t.readOnly = !0, t.pos = 0, t;
711
713
  }
712
- const In = new Uint8Array(4), sa = new DataView(In.buffer), Ya = new Uint8Array(8), ra = new DataView(Ya.buffer);
713
- class ti {
714
+ const On = new Uint8Array(4), ra = new DataView(On.buffer), ei = new Uint8Array(8), la = new DataView(ei.buffer);
715
+ class ni {
714
716
  constructor() {
715
717
  this.pageSize = 16384;
716
718
  }
@@ -760,15 +762,15 @@ class ti {
760
762
  }
761
763
  async writeULE32(t, e) {
762
764
  const n = this;
763
- sa.setUint32(0, t, !0), await n.write(In, e);
765
+ ra.setUint32(0, t, !0), await n.write(On, e);
764
766
  }
765
767
  async writeUBE32(t, e) {
766
768
  const n = this;
767
- sa.setUint32(0, t, !1), await n.write(In, e);
769
+ ra.setUint32(0, t, !1), await n.write(On, e);
768
770
  }
769
771
  async writeULE64(t, e) {
770
772
  const n = this;
771
- ra.setUint32(0, t & 4294967295, !0), ra.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(Ya, e);
773
+ la.setUint32(0, t & 4294967295, !0), la.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(ei, e);
772
774
  }
773
775
  async readULE32(t) {
774
776
  const n = await this.read(4, t);
@@ -803,22 +805,22 @@ class ti {
803
805
  return g;
804
806
  }
805
807
  }
806
- const _c = 0, gc = 2, pc = 512, hc = 1024, ei = 65536, ni = 8192;
807
- async function ai(c, t, e) {
808
+ const gc = 0, pc = 2, hc = 512, Lc = 1024, ai = 65536, ii = 8192;
809
+ async function oi(c, t, e) {
808
810
  if (typeof c == "string" && (c = {
809
811
  type: "file",
810
812
  fileName: c,
811
- cacheSize: t || ei,
812
- pageSize: e || ni
813
+ cacheSize: t || ai,
814
+ pageSize: e || ii
813
815
  }), c.type == "file")
814
- return await Qa(c.fileName, hc | pc | gc, c.cacheSize, c.pageSize);
816
+ return await Ka(c.fileName, Lc | hc | pc, c.cacheSize, c.pageSize);
815
817
  if (c.type == "mem")
816
- return lc(c);
818
+ return uc(c);
817
819
  if (c.type == "bigMem")
818
- return dc(c);
820
+ return fc(c);
819
821
  throw new Error("Invalid FastFile type: " + c.type);
820
822
  }
821
- async function ii(c, t, e) {
823
+ async function ci(c, t, e) {
822
824
  if (c instanceof Uint8Array && (c = {
823
825
  type: "mem",
824
826
  data: c
@@ -832,18 +834,18 @@ async function ii(c, t, e) {
832
834
  }) : typeof c == "string" && (c = {
833
835
  type: "file",
834
836
  fileName: c,
835
- cacheSize: t || ei,
836
- pageSize: e || ni
837
+ cacheSize: t || ai,
838
+ pageSize: e || ii
837
839
  }), c.type == "file")
838
- return await Qa(c.fileName, _c, c.cacheSize, c.pageSize);
840
+ return await Ka(c.fileName, gc, c.cacheSize, c.pageSize);
839
841
  if (c.type == "mem")
840
- return await uc(c);
842
+ return await dc(c);
841
843
  if (c.type == "bigMem")
842
- return await fc(c);
844
+ return await _c(c);
843
845
  throw new Error("Invalid FastFile type: " + c.type);
844
846
  }
845
- async function la(c, t, e, n, a) {
846
- const s = await ii(c, n, a), g = await s.read(4);
847
+ async function ua(c, t, e, n, a) {
848
+ const s = await ci(c, n, a), g = await s.read(4);
847
849
  let d = "";
848
850
  for (let y = 0; y < 4; y++)
849
851
  d += String.fromCharCode(g[y]);
@@ -862,20 +864,20 @@ async function la(c, t, e, n, a) {
862
864
  }
863
865
  return { fd: s, sections: o };
864
866
  }
865
- async function Lc(c, t, e, n, a, s) {
866
- const g = await ai(c, a, s), d = new Uint8Array(4);
867
+ async function mc(c, t, e, n, a, s) {
868
+ const g = await oi(c, a, s), d = new Uint8Array(4);
867
869
  for (let C = 0; C < 4; C++)
868
870
  d[C] = t.charCodeAt(C);
869
871
  return await g.write(d, 0), await g.writeULE32(e), await g.writeULE32(n), g;
870
872
  }
871
- async function ua(c, t) {
873
+ async function da(c, t) {
872
874
  if (typeof c.writingSection < "u")
873
875
  throw new Error("Already writing a section");
874
876
  await c.writeULE32(t), c.writingSection = {
875
877
  pSectionSize: c.pos
876
878
  }, await c.writeULE64(0);
877
879
  }
878
- async function da(c) {
880
+ async function fa(c) {
879
881
  if (typeof c.writingSection > "u")
880
882
  throw new Error("Not writing a section");
881
883
  const t = c.pos - c.writingSection.pSectionSize - 8, e = c.pos;
@@ -897,13 +899,13 @@ async function Xe(c, t) {
897
899
  throw new Error("Invalid section size reading");
898
900
  delete c.readingSection;
899
901
  }
900
- async function mc(c, t, e, n) {
902
+ async function bc(c, t, e, n) {
901
903
  const a = new Uint8Array(e);
902
- Ha.toRprLE(a, 0, t, e), await c.write(a, n);
904
+ Qa.toRprLE(a, 0, t, e), await c.write(a, n);
903
905
  }
904
906
  async function Be(c, t, e) {
905
907
  const n = await c.read(t, e);
906
- return Ha.fromRprLE(n, 0, t);
908
+ return Qa.fromRprLE(n, 0, t);
907
909
  }
908
910
  async function Fe(c, t, e, n, a) {
909
911
  if (n = typeof n > "u" ? 0 : n, a = typeof a > "u" ? t[e][0].size - n : a, n + a > t[e][0].size)
@@ -911,15 +913,15 @@ async function Fe(c, t, e, n, a) {
911
913
  let s;
912
914
  return a < 1 << 30 ? s = new Uint8Array(a) : s = new cc(a), await c.readToBuffer(s, 0, a, t[e][0].p + n), s;
913
915
  }
914
- const bc = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
915
- function rn(c, t) {
916
+ const yc = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
917
+ function ln(c, t) {
916
918
  if (!t || t == 10)
917
919
  return BigInt(c);
918
920
  if (t == 16)
919
921
  return c.slice(0, 2) == "0x" ? BigInt(c) : BigInt("0x" + c);
920
922
  }
921
- const ee = rn;
922
- function yc(c, t) {
923
+ const ee = ln;
924
+ function Cc(c, t) {
923
925
  let e = BigInt(0);
924
926
  t = BigInt(t);
925
927
  for (let n = 0; n < c.length; n++)
@@ -928,12 +930,12 @@ function yc(c, t) {
928
930
  }
929
931
  function Ve(c) {
930
932
  const t = c.toString(16);
931
- return (t.length - 1) * 4 + bc[parseInt(t[0], 16)];
933
+ return (t.length - 1) * 4 + yc[parseInt(t[0], 16)];
932
934
  }
933
- function oi(c) {
935
+ function si(c) {
934
936
  return BigInt(c) < BigInt(0);
935
937
  }
936
- function ci(c) {
938
+ function ri(c) {
937
939
  return !c;
938
940
  }
939
941
  function nn(c, t) {
@@ -942,11 +944,11 @@ function nn(c, t) {
942
944
  function Ie(c, t) {
943
945
  return BigInt(c) >> BigInt(t);
944
946
  }
945
- const Cc = nn, Ac = Ie;
946
- function jn(c) {
947
+ const Ac = nn, Fc = Ie;
948
+ function $n(c) {
947
949
  return (BigInt(c) & BigInt(1)) == BigInt(1);
948
950
  }
949
- function Fc(c) {
951
+ function Ec(c) {
950
952
  let t = BigInt(c);
951
953
  const e = [];
952
954
  for (; t; ) {
@@ -959,47 +961,47 @@ function Fc(c) {
959
961
  }
960
962
  return e;
961
963
  }
962
- function si(c) {
964
+ function li(c) {
963
965
  let t = BigInt(c);
964
966
  const e = [];
965
967
  for (; t; )
966
968
  t & BigInt(1) ? e.push(1) : e.push(0), t = t >> BigInt(1);
967
969
  return e;
968
970
  }
969
- function ri(c) {
971
+ function ui(c) {
970
972
  if (c > BigInt(Number.MAX_SAFE_INTEGER))
971
973
  throw new Error("Number too big");
972
974
  return Number(c);
973
975
  }
974
- function Ec(c, t) {
976
+ function wc(c, t) {
975
977
  const e = [];
976
978
  let n = BigInt(c);
977
979
  for (t = BigInt(t); n; )
978
980
  e.unshift(Number(n % t)), n = n / t;
979
981
  return e;
980
982
  }
981
- function $n(c, t) {
983
+ function Gn(c, t) {
982
984
  return BigInt(c) + BigInt(t);
983
985
  }
984
986
  function Le(c, t) {
985
987
  return BigInt(c) - BigInt(t);
986
988
  }
987
- function li(c) {
989
+ function di(c) {
988
990
  return -BigInt(c);
989
991
  }
990
- function ui(c, t) {
992
+ function fi(c, t) {
991
993
  return BigInt(c) * BigInt(t);
992
994
  }
993
- function wc(c) {
995
+ function Bc(c) {
994
996
  return BigInt(c) * BigInt(c);
995
997
  }
996
998
  function He(c, t) {
997
999
  return BigInt(c) ** BigInt(t);
998
1000
  }
999
- function Bc(c, t) {
1001
+ function vc(c, t) {
1000
1002
  return BigInt(c) ** BigInt(t);
1001
1003
  }
1002
- function vc(c) {
1004
+ function xc(c) {
1003
1005
  return BigInt(c) >= 0 ? BigInt(c) : -BigInt(c);
1004
1006
  }
1005
1007
  function Oe(c, t) {
@@ -1011,37 +1013,37 @@ function ge(c, t) {
1011
1013
  function Ee(c, t) {
1012
1014
  return BigInt(c) == BigInt(t);
1013
1015
  }
1014
- function xc(c, t) {
1016
+ function Sc(c, t) {
1015
1017
  return BigInt(c) != BigInt(t);
1016
1018
  }
1017
- function Sc(c, t) {
1019
+ function Ic(c, t) {
1018
1020
  return BigInt(c) < BigInt(t);
1019
1021
  }
1020
- function On(c, t) {
1022
+ function Pn(c, t) {
1021
1023
  return BigInt(c) > BigInt(t);
1022
1024
  }
1023
- function Ic(c, t) {
1025
+ function Oc(c, t) {
1024
1026
  return BigInt(c) <= BigInt(t);
1025
1027
  }
1026
- function di(c, t) {
1028
+ function _i(c, t) {
1027
1029
  return BigInt(c) >= BigInt(t);
1028
1030
  }
1029
- function Gn(c, t) {
1031
+ function Zn(c, t) {
1030
1032
  return BigInt(c) & BigInt(t);
1031
1033
  }
1032
- function Oc(c, t) {
1034
+ function Pc(c, t) {
1033
1035
  return BigInt(c) | BigInt(t);
1034
1036
  }
1035
- function Pc(c, t) {
1037
+ function kc(c, t) {
1036
1038
  return BigInt(c) ^ BigInt(t);
1037
1039
  }
1038
- function kc(c, t) {
1040
+ function Tc(c, t) {
1039
1041
  return BigInt(c) && BigInt(t);
1040
1042
  }
1041
- function Tc(c, t) {
1043
+ function qc(c, t) {
1042
1044
  return BigInt(c) || BigInt(t);
1043
1045
  }
1044
- function qc(c) {
1046
+ function Dc(c) {
1045
1047
  return !BigInt(c);
1046
1048
  }
1047
1049
  function Ge(c, t, e, n) {
@@ -1051,9 +1053,9 @@ function Ge(c, t, e, n) {
1051
1053
  for (let d = g; d < s.length; d++)
1052
1054
  s[d] = 0;
1053
1055
  for (let d = s.length * 4; d < n; d++)
1054
- c[d] = ri(Gn(Ie(e, d * 8), 255));
1056
+ c[d] = ui(Zn(Ie(e, d * 8), 255));
1055
1057
  }
1056
- function fi(c, t, e, n) {
1058
+ function gi(c, t, e, n) {
1057
1059
  const a = "0000000" + e.toString(16), s = new DataView(c.buffer, c.byteOffset + t, n), g = ((a.length - 7) * 4 - 1 >> 5) + 1;
1058
1060
  for (let d = 0; d < g; d++)
1059
1061
  s.setUint32(n - d * 4 - 4, parseInt(a.substring(a.length - 8 * d - 8, a.length - 8 * d), 16), !1);
@@ -1063,74 +1065,74 @@ function fi(c, t, e, n) {
1063
1065
  function Ze(c, t, e) {
1064
1066
  e = e || c.byteLength, t = t || 0;
1065
1067
  const n = new Uint32Array(c.buffer, t, e / 4), a = new Array(e / 4);
1066
- return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), rn(a.join(""), 16);
1068
+ return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), ln(a.join(""), 16);
1067
1069
  }
1068
- function _i(c, t, e) {
1070
+ function pi(c, t, e) {
1069
1071
  e = e || c.byteLength, t = t || 0;
1070
1072
  const n = new DataView(c.buffer, c.byteOffset + t, e), a = new Array(e / 4);
1071
1073
  for (let s = 0; s < e / 4; s++)
1072
1074
  a[s] = n.getUint32(s * 4, !1).toString(16).padStart(8, "0");
1073
- return rn(a.join(""), 16);
1075
+ return ln(a.join(""), 16);
1074
1076
  }
1075
- function gi(c, t) {
1077
+ function hi(c, t) {
1076
1078
  return c.toString(t);
1077
1079
  }
1078
1080
  function Pe(c) {
1079
1081
  const t = new Uint8Array(Math.floor((Ve(c) - 1) / 8) + 1);
1080
1082
  return Ge(t, 0, c, t.byteLength), t;
1081
1083
  }
1082
- const pi = ee(0), we = ee(1), Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1084
+ const Li = ee(0), we = ee(1), Mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1083
1085
  __proto__: null,
1084
- abs: vc,
1085
- add: $n,
1086
- band: Gn,
1086
+ abs: xc,
1087
+ add: Gn,
1088
+ band: Zn,
1087
1089
  bitLength: Ve,
1088
- bits: si,
1089
- bor: Oc,
1090
- bxor: Pc,
1090
+ bits: li,
1091
+ bor: Pc,
1092
+ bxor: kc,
1091
1093
  div: Oe,
1092
1094
  e: ee,
1093
1095
  eq: Ee,
1094
- exp: Bc,
1095
- fromArray: yc,
1096
- fromRprBE: _i,
1096
+ exp: vc,
1097
+ fromArray: Cc,
1098
+ fromRprBE: pi,
1097
1099
  fromRprLE: Ze,
1098
- fromString: rn,
1099
- geq: di,
1100
- gt: On,
1101
- isNegative: oi,
1102
- isOdd: jn,
1103
- isZero: ci,
1104
- land: kc,
1105
- leq: Ic,
1106
- lnot: qc,
1107
- lor: Tc,
1108
- lt: Sc,
1100
+ fromString: ln,
1101
+ geq: _i,
1102
+ gt: Pn,
1103
+ isNegative: si,
1104
+ isOdd: $n,
1105
+ isZero: ri,
1106
+ land: Tc,
1107
+ leq: Oc,
1108
+ lnot: Dc,
1109
+ lor: qc,
1110
+ lt: Ic,
1109
1111
  mod: ge,
1110
- mul: ui,
1111
- naf: Fc,
1112
- neg: li,
1113
- neq: xc,
1112
+ mul: fi,
1113
+ naf: Ec,
1114
+ neg: di,
1115
+ neq: Sc,
1114
1116
  one: we,
1115
1117
  pow: He,
1116
1118
  shiftLeft: nn,
1117
1119
  shiftRight: Ie,
1118
- shl: Cc,
1119
- shr: Ac,
1120
- square: wc,
1120
+ shl: Ac,
1121
+ shr: Fc,
1122
+ square: Bc,
1121
1123
  sub: Le,
1122
- toArray: Ec,
1124
+ toArray: wc,
1123
1125
  toLEBuff: Pe,
1124
- toNumber: ri,
1125
- toRprBE: fi,
1126
+ toNumber: ui,
1127
+ toRprBE: gi,
1126
1128
  toRprLE: Ge,
1127
- toString: gi,
1128
- zero: pi
1129
+ toString: hi,
1130
+ zero: Li
1129
1131
  }, Symbol.toStringTag, { value: "Module" }));
1130
- function fa(c, t, e) {
1131
- if (ci(e))
1132
+ function _a(c, t, e) {
1133
+ if (ri(e))
1132
1134
  return c.one;
1133
- const n = si(e);
1135
+ const n = li(e);
1134
1136
  if (n.length == 0)
1135
1137
  return c.one;
1136
1138
  let a = t;
@@ -1138,29 +1140,29 @@ function fa(c, t, e) {
1138
1140
  a = c.square(a), n[s] && (a = c.mul(a, t));
1139
1141
  return a;
1140
1142
  }
1141
- function Mc(c) {
1143
+ function Rc(c) {
1142
1144
  if (c.m % 2 == 1)
1143
1145
  if (Ee(ge(c.p, 4), 1))
1144
1146
  if (Ee(ge(c.p, 8), 1))
1145
1147
  if (Ee(ge(c.p, 16), 1))
1146
- Rc(c);
1147
- else if (Ee(ge(c.p, 16), 9))
1148
1148
  Nc(c);
1149
+ else if (Ee(ge(c.p, 16), 9))
1150
+ zc(c);
1149
1151
  else
1150
1152
  throw new Error("Field withot sqrt");
1151
1153
  else if (Ee(ge(c.p, 8), 5))
1152
- zc(c);
1154
+ Uc(c);
1153
1155
  else
1154
1156
  throw new Error("Field withot sqrt");
1155
1157
  else
1156
- Ee(ge(c.p, 4), 3) && Uc(c);
1158
+ Ee(ge(c.p, 4), 3) && jc(c);
1157
1159
  else {
1158
1160
  const t = ge(He(c.p, c.m / 2), 4);
1159
- t == 1 ? jc(c) : t == 3 ? $c(c) : Gc(c);
1161
+ t == 1 ? $c(c) : t == 3 ? Gc(c) : Zc(c);
1160
1162
  }
1161
1163
  }
1162
- function Rc(c) {
1163
- for (c.sqrt_q = He(c.p, c.m), c.sqrt_s = 0, c.sqrt_t = Le(c.sqrt_q, 1); !jn(c.sqrt_t); )
1164
+ function Nc(c) {
1165
+ for (c.sqrt_q = He(c.p, c.m), c.sqrt_s = 0, c.sqrt_t = Le(c.sqrt_q, 1); !$n(c.sqrt_t); )
1164
1166
  c.sqrt_s = c.sqrt_s + 1, c.sqrt_t = Oe(c.sqrt_t, 2);
1165
1167
  let t = c.one;
1166
1168
  for (; c.eq(t, c.one); ) {
@@ -1188,17 +1190,17 @@ function Rc(c) {
1188
1190
  return n.geq(d, n.zero) ? d : n.neg(d);
1189
1191
  };
1190
1192
  }
1191
- function Nc(c) {
1193
+ function zc(c) {
1192
1194
  c.sqrt = function() {
1193
1195
  throw new Error("Sqrt alg 4 not implemented");
1194
1196
  };
1195
1197
  }
1196
- function zc(c) {
1198
+ function Uc(c) {
1197
1199
  c.sqrt = function() {
1198
1200
  throw new Error("Sqrt alg 3 not implemented");
1199
1201
  };
1200
1202
  }
1201
- function Uc(c) {
1203
+ function jc(c) {
1202
1204
  c.sqrt_q = He(c.p, c.m), c.sqrt_e1 = Oe(Le(c.sqrt_q, 3), 4), c.sqrt = function(t) {
1203
1205
  if (this.isZero(t))
1204
1206
  return this.zero;
@@ -1209,12 +1211,12 @@ function Uc(c) {
1209
1211
  return c.geq(a, c.zero) ? a : c.neg(a);
1210
1212
  };
1211
1213
  }
1212
- function jc(c) {
1214
+ function $c(c) {
1213
1215
  c.sqrt = function() {
1214
1216
  throw new Error("Sqrt alg 10 not implemented");
1215
1217
  };
1216
1218
  }
1217
- function $c(c) {
1219
+ function Gc(c) {
1218
1220
  c.sqrt_q = He(c.p, c.m / 2), c.sqrt_e34 = Oe(Le(c.sqrt_q, 3), 4), c.sqrt_e12 = Oe(Le(c.sqrt_q, 1), 2), c.frobenius = function(t, e) {
1219
1221
  return t % 2 == 1 ? c.conjugate(e) : e;
1220
1222
  }, c.sqrt = function(t) {
@@ -1232,7 +1234,7 @@ function $c(c) {
1232
1234
  return e.geq(d, e.zero) ? d : e.neg(d);
1233
1235
  };
1234
1236
  }
1235
- function Gc(c) {
1237
+ function Zc(c) {
1236
1238
  c.sqrt = function() {
1237
1239
  throw new Error("Sqrt alg 8 not implemented");
1238
1240
  };
@@ -1240,10 +1242,10 @@ function Gc(c) {
1240
1242
  function me(c, t, e, n, a) {
1241
1243
  c[t] = c[t] + c[e] >>> 0, c[a] = (c[a] ^ c[t]) >>> 0, c[a] = (c[a] << 16 | c[a] >>> 16 & 65535) >>> 0, c[n] = c[n] + c[a] >>> 0, c[e] = (c[e] ^ c[n]) >>> 0, c[e] = (c[e] << 12 | c[e] >>> 20 & 4095) >>> 0, c[t] = c[t] + c[e] >>> 0, c[a] = (c[a] ^ c[t]) >>> 0, c[a] = (c[a] << 8 | c[a] >>> 24 & 255) >>> 0, c[n] = c[n] + c[a] >>> 0, c[e] = (c[e] ^ c[n]) >>> 0, c[e] = (c[e] << 7 | c[e] >>> 25 & 127) >>> 0;
1242
1244
  }
1243
- function Zc(c) {
1245
+ function Wc(c) {
1244
1246
  me(c, 0, 4, 8, 12), me(c, 1, 5, 9, 13), me(c, 2, 6, 10, 14), me(c, 3, 7, 11, 15), me(c, 0, 5, 10, 15), me(c, 1, 6, 11, 12), me(c, 2, 7, 8, 13), me(c, 3, 4, 9, 14);
1245
1247
  }
1246
- class Wc {
1248
+ class Xc {
1247
1249
  constructor(t) {
1248
1250
  t = t || [0, 0, 0, 0, 0, 0, 0, 0], this.state = [
1249
1251
  1634760805,
@@ -1268,7 +1270,7 @@ class Wc {
1268
1270
  return this.idx == 16 && this.update(), this.buff[this.idx++];
1269
1271
  }
1270
1272
  nextU64() {
1271
- return $n(ui(this.nextU32(), 4294967296), this.nextU32());
1273
+ return Gn(fi(this.nextU32(), 4294967296), this.nextU32());
1272
1274
  }
1273
1275
  nextBool() {
1274
1276
  return (this.nextU32() & 1) == 1;
@@ -1277,15 +1279,15 @@ class Wc {
1277
1279
  for (let t = 0; t < 16; t++)
1278
1280
  this.buff[t] = this.state[t];
1279
1281
  for (let t = 0; t < 10; t++)
1280
- Zc(this.buff);
1282
+ Wc(this.buff);
1281
1283
  for (let t = 0; t < 16; t++)
1282
1284
  this.buff[t] = this.buff[t] + this.state[t] >>> 0;
1283
1285
  this.idx = 0, this.state[12] = this.state[12] + 1 >>> 0, this.state[12] == 0 && (this.state[13] = this.state[13] + 1 >>> 0, this.state[13] == 0 && (this.state[14] = this.state[14] + 1 >>> 0, this.state[14] == 0 && (this.state[15] = this.state[15] + 1 >>> 0)));
1284
1286
  }
1285
1287
  }
1286
- var Xc = po();
1287
- const Vc = /* @__PURE__ */ ho(Xc);
1288
- function hi(c) {
1288
+ var Vc = Lo();
1289
+ const Hc = /* @__PURE__ */ ja(Vc);
1290
+ function mi(c) {
1289
1291
  let t = new Uint8Array(c);
1290
1292
  if (Se.browser)
1291
1293
  if (typeof globalThis.crypto < "u")
@@ -1294,20 +1296,20 @@ function hi(c) {
1294
1296
  for (let e = 0; e < c; e++)
1295
1297
  t[e] = Math.random() * 4294967296 >>> 0;
1296
1298
  else
1297
- Vc.randomFillSync(t);
1299
+ Hc.randomFillSync(t);
1298
1300
  return t;
1299
1301
  }
1300
- function Hc() {
1301
- const c = hi(32), t = new Uint32Array(c.buffer), e = [];
1302
+ function Qc() {
1303
+ const c = mi(32), t = new Uint32Array(c.buffer), e = [];
1302
1304
  for (let n = 0; n < 8; n++)
1303
1305
  e.push(t[n]);
1304
1306
  return e;
1305
1307
  }
1306
1308
  let Ke = null;
1307
- function Zn() {
1308
- return Ke || (Ke = new Wc(Hc()), Ke);
1309
+ function Wn() {
1310
+ return Ke || (Ke = new Xc(Qc()), Ke);
1309
1311
  }
1310
- class Qc {
1312
+ class Jc {
1311
1313
  constructor(t, e, n) {
1312
1314
  this.F = e, this.G = t, this.opMulGF = n;
1313
1315
  let a = e.sqrt_t || e.t, s = e.sqrt_s || e.s, g = e.one;
@@ -1331,7 +1333,7 @@ class Qc {
1331
1333
  fft(t) {
1332
1334
  if (t.length <= 1)
1333
1335
  return t;
1334
- const e = _a(t.length - 1) + 1;
1336
+ const e = ga(t.length - 1) + 1;
1335
1337
  this._setRoots(e);
1336
1338
  const n = 1 << e;
1337
1339
  if (t.length != n)
@@ -1341,7 +1343,7 @@ class Qc {
1341
1343
  ifft(t) {
1342
1344
  if (t.length <= 1)
1343
1345
  return t;
1344
- const e = _a(t.length - 1) + 1;
1346
+ const e = ga(t.length - 1) + 1;
1345
1347
  this._setRoots(e);
1346
1348
  const n = 1 << e;
1347
1349
  if (t.length != n)
@@ -1352,7 +1354,7 @@ class Qc {
1352
1354
  return g;
1353
1355
  }
1354
1356
  }
1355
- function _a(c) {
1357
+ function ga(c) {
1356
1358
  return (c & 4294901760 ? (c &= 4294901760, 16) : 0) | (c & 4278255360 ? (c &= 4278255360, 8) : 0) | (c & 4042322160 ? (c &= 4042322160, 4) : 0) | (c & 3435973836 ? (c &= 3435973836, 2) : 0) | (c & 2863311530) !== 0;
1357
1359
  }
1358
1360
  function an(c, t, e, n, a) {
@@ -1369,7 +1371,7 @@ function an(c, t, e, n, a) {
1369
1371
  l[o] = c.G.add(d[o], c.opMulGF(C[o], c.roots[e][o])), l[o + g] = c.G.sub(d[o], c.opMulGF(C[o], c.roots[e][o]));
1370
1372
  return l;
1371
1373
  }
1372
- class Jc {
1374
+ class Kc {
1373
1375
  constructor(t) {
1374
1376
  this.type = "F1", this.one = BigInt(1), this.zero = BigInt(0), this.p = BigInt(t), this.m = 1, this.negone = this.p - this.one, this.two = BigInt(2), this.half = this.p >> this.one, this.bitLength = Ve(this.p), this.mask = (this.one << BigInt(this.bitLength)) - this.one, this.n64 = Math.floor((this.bitLength - 1) / 64) + 1, this.n32 = this.n64 * 2, this.n8 = this.n64 * 8, this.R = this.e(this.one << BigInt(this.n64 * 64)), this.Ri = this.inv(this.R);
1375
1377
  const e = this.negone >> this.one;
@@ -1379,7 +1381,7 @@ class Jc {
1379
1381
  this.nqr = this.nqr + this.one, n = this.pow(this.nqr, e);
1380
1382
  for (this.s = 0, this.t = this.negone; (this.t & this.one) == this.zero; )
1381
1383
  this.s = this.s + 1, this.t = this.t >> this.one;
1382
- this.nqr_to_t = this.pow(this.nqr, this.t), Mc(this), this.FFT = new Qc(this, this, this.mul.bind(this)), this.fft = this.FFT.fft.bind(this.FFT), this.ifft = this.FFT.ifft.bind(this.FFT), this.w = this.FFT.w, this.wi = this.FFT.wi, this.shift = this.square(this.nqr), this.k = this.exp(this.nqr, 2 ** this.s);
1384
+ this.nqr_to_t = this.pow(this.nqr, this.t), Rc(this), this.FFT = new Jc(this, this, this.mul.bind(this)), this.fft = this.FFT.fft.bind(this.FFT), this.ifft = this.FFT.ifft.bind(this.FFT), this.w = this.FFT.w, this.wi = this.FFT.wi, this.shift = this.square(this.nqr), this.k = this.exp(this.nqr, 2 ** this.s);
1383
1385
  }
1384
1386
  e(t, e) {
1385
1387
  let n;
@@ -1452,10 +1454,10 @@ class Jc {
1452
1454
  return t % e;
1453
1455
  }
1454
1456
  pow(t, e) {
1455
- return fa(this, t, e);
1457
+ return _a(this, t, e);
1456
1458
  }
1457
1459
  exp(t, e) {
1458
- return fa(this, t, e);
1460
+ return _a(this, t, e);
1459
1461
  }
1460
1462
  band(t, e) {
1461
1463
  const n = t & e & this.mask;
@@ -1531,7 +1533,7 @@ class Jc {
1531
1533
  const t = this.bitLength * 2 / 8;
1532
1534
  let e = this.zero;
1533
1535
  for (let n = 0; n < t; n++)
1534
- e = (e << BigInt(8)) + BigInt(hi(1)[0]);
1536
+ e = (e << BigInt(8)) + BigInt(mi(1)[0]);
1535
1537
  return e % this.p;
1536
1538
  }
1537
1539
  toString(t, e) {
@@ -1564,7 +1566,7 @@ class Jc {
1564
1566
  }
1565
1567
  // Returns a buffer with Big Endian Representation
1566
1568
  toRprBE(t, e, n) {
1567
- fi(t, e, n, this.n64 * 8);
1569
+ gi(t, e, n, this.n64 * 8);
1568
1570
  }
1569
1571
  // Returns a buffer with Big Endian Montgomery Representation
1570
1572
  toRprBEM(t, e, n) {
@@ -1579,7 +1581,7 @@ class Jc {
1579
1581
  }
1580
1582
  // Pases a buffer with Big Endian Representation
1581
1583
  fromRprBE(t, e) {
1582
- return _i(t, e, this.n8);
1584
+ return pi(t, e, this.n8);
1583
1585
  }
1584
1586
  fromRprLEM(t, e) {
1585
1587
  return this.mul(this.fromRprLE(t, e), this.Ri);
@@ -1609,7 +1611,7 @@ ye.bigInt2U32LE = function(t, e) {
1609
1611
  ye.isOcamNum = function(c) {
1610
1612
  return !(!Array.isArray(c) || c.length != 3 || typeof c[0] != "number" || typeof c[1] != "number" || !Array.isArray(c[2]));
1611
1613
  };
1612
- var Kc = function(t, e, n) {
1614
+ var Yc = function(t, e, n) {
1613
1615
  const a = n || "int";
1614
1616
  if (t.modules[a])
1615
1617
  return a;
@@ -2335,7 +2337,7 @@ var Kc = function(t, e, n) {
2335
2337
  ));
2336
2338
  }
2337
2339
  return d(), C(), o(), l(), y(), E(), m(), x(), O(), L(), I(), w(), S(), t.exportFunction(a + "_copy"), t.exportFunction(a + "_zero"), t.exportFunction(a + "_one"), t.exportFunction(a + "_isZero"), t.exportFunction(a + "_eq"), t.exportFunction(a + "_gte"), t.exportFunction(a + "_add"), t.exportFunction(a + "_sub"), t.exportFunction(a + "_mul"), t.exportFunction(a + "_square"), t.exportFunction(a + "_squareOld"), t.exportFunction(a + "_div"), t.exportFunction(a + "_inverseMod"), a;
2338
- }, Wn = function(t, e, n, a, s, g, d) {
2340
+ }, Xn = function(t, e, n, a, s, g, d) {
2339
2341
  const C = t.addFunction(e);
2340
2342
  C.addParam("base", "i32"), C.addParam("scalar", "i32"), C.addParam("scalarLength", "i32"), C.addParam("r", "i32"), C.addLocal("i", "i32"), C.addLocal("b", "i32");
2341
2343
  const l = C.getCodeBuilder(), o = l.i32_const(t.alloc(n));
@@ -2383,8 +2385,8 @@ var Kc = function(t, e, n) {
2383
2385
  );
2384
2386
  return E;
2385
2387
  }
2386
- }, Xn = Yc;
2387
- function Yc(c, t) {
2388
+ }, Vn = ts;
2389
+ function ts(c, t) {
2388
2390
  const e = c.modules[t].n64 * 8, n = c.addFunction(t + "_batchInverse");
2389
2391
  n.addParam("pIn", "i32"), n.addParam("inStep", "i32"), n.addParam("n", "i32"), n.addParam("pOut", "i32"), n.addParam("outStep", "i32"), n.addLocal("itAux", "i32"), n.addLocal("itIn", "i32"), n.addLocal("itOut", "i32"), n.addLocal("i", "i32");
2390
2392
  const a = n.getCodeBuilder(), s = a.i32_const(c.alloc(e));
@@ -2491,8 +2493,8 @@ function Yc(c, t) {
2491
2493
  )
2492
2494
  );
2493
2495
  }
2494
- var Li = ts;
2495
- function ts(c, t, e, n, a, s) {
2496
+ var bi = es;
2497
+ function es(c, t, e, n, a, s) {
2496
2498
  typeof s > "u" && (n < a ? s = !0 : s = !1);
2497
2499
  const g = c.addFunction(t);
2498
2500
  g.addParam("pIn", "i32"), g.addParam("n", "i32"), g.addParam("pOut", "i32"), g.addLocal("i", "i32"), g.addLocal("itIn", "i32"), g.addLocal("itOut", "i32");
@@ -2547,8 +2549,8 @@ function ts(c, t, e, n, a, s) {
2547
2549
  ))
2548
2550
  );
2549
2551
  }
2550
- var es = ns;
2551
- function ns(c, t, e, n, a, s) {
2552
+ var ns = as;
2553
+ function as(c, t, e, n, a, s) {
2552
2554
  typeof s > "u" && (n < a ? s = !0 : s = !1);
2553
2555
  const g = c.addFunction(t);
2554
2556
  g.addParam("pIn1", "i32"), g.addParam("pIn2", "i32"), g.addParam("n", "i32"), g.addParam("pOut", "i32"), g.addLocal("i", "i32"), g.addLocal("itIn1", "i32"), g.addLocal("itIn2", "i32"), g.addLocal("itOut", "i32");
@@ -2620,26 +2622,26 @@ function ns(c, t, e, n, a, s) {
2620
2622
  );
2621
2623
  }
2622
2624
  var le = {};
2623
- function mi(c, t) {
2625
+ function yi(c, t) {
2624
2626
  return c === t ? 0 : c > t ? 1 : -1;
2625
2627
  }
2626
- function Vn(c) {
2628
+ function Hn(c) {
2627
2629
  return c * c;
2628
2630
  }
2629
- function bi(c) {
2631
+ function Ci(c) {
2630
2632
  return c % 2n !== 0n;
2631
2633
  }
2632
- function Hn(c) {
2634
+ function Qn(c) {
2633
2635
  return c % 2n === 0n;
2634
2636
  }
2635
- function ln(c) {
2637
+ function un(c) {
2636
2638
  return c < 0n;
2637
2639
  }
2638
- function as(c) {
2640
+ function is(c) {
2639
2641
  return c > 0n;
2640
2642
  }
2641
- function yi(c) {
2642
- return ln(c) ? c.toString(2).length - 1 : c.toString(2).length;
2643
+ function Ai(c) {
2644
+ return un(c) ? c.toString(2).length - 1 : c.toString(2).length;
2643
2645
  }
2644
2646
  function Qe(c) {
2645
2647
  return c < 0n ? -c : c;
@@ -2647,52 +2649,52 @@ function Qe(c) {
2647
2649
  function ke(c) {
2648
2650
  return Qe(c) === 1n;
2649
2651
  }
2650
- function Ci(c, t) {
2652
+ function Fi(c, t) {
2651
2653
  for (var e = 0n, n = 1n, a = t, s = Qe(c), g, d, C; s !== 0n; )
2652
2654
  g = a / s, d = e, C = a, e = n, a = s, n = d - g * n, s = C - g * s;
2653
2655
  if (!ke(a))
2654
2656
  throw new Error(c.toString() + " and " + t.toString() + " are not co-prime");
2655
- return mi(e, 0n) === -1 && (e = e + t), ln(c) ? -e : e;
2657
+ return yi(e, 0n) === -1 && (e = e + t), un(c) ? -e : e;
2656
2658
  }
2657
- function Ai(c, t, e) {
2659
+ function Ei(c, t, e) {
2658
2660
  if (e === 0n)
2659
2661
  throw new Error("Cannot take modPow with modulus 0");
2660
2662
  var n = 1n, a = c % e;
2661
- for (ln(t) && (t = t * -1n, a = Ci(a, e)); as(t); ) {
2663
+ for (un(t) && (t = t * -1n, a = Fi(a, e)); is(t); ) {
2662
2664
  if (a === 0n)
2663
2665
  return 0n;
2664
- bi(t) && (n = n * a % e), t = t / 2n, a = Vn(a) % e;
2666
+ Ci(t) && (n = n * a % e), t = t / 2n, a = Hn(a) % e;
2665
2667
  }
2666
2668
  return n;
2667
2669
  }
2668
- function is(c, t) {
2670
+ function os(c, t) {
2669
2671
  return c = c >= 0n ? c : -c, t = t >= 0n ? t : -t, c === t ? 0 : c > t ? 1 : -1;
2670
2672
  }
2671
- function ga(c, t) {
2672
- return t === 0n ? !1 : ke(t) ? !0 : is(t, 2n) === 0 ? Hn(c) : c % t === 0n;
2673
+ function pa(c, t) {
2674
+ return t === 0n ? !1 : ke(t) ? !0 : os(t, 2n) === 0 ? Qn(c) : c % t === 0n;
2673
2675
  }
2674
- function os(c) {
2676
+ function cs(c) {
2675
2677
  var t = Qe(c);
2676
2678
  if (ke(t))
2677
2679
  return !1;
2678
2680
  if (t === 2n || t === 3n || t === 5n)
2679
2681
  return !0;
2680
- if (Hn(t) || ga(t, 3n) || ga(t, 5n))
2682
+ if (Qn(t) || pa(t, 3n) || pa(t, 5n))
2681
2683
  return !1;
2682
2684
  if (t < 49n)
2683
2685
  return !0;
2684
2686
  }
2685
- function cs(c) {
2687
+ function ss(c) {
2686
2688
  return c - 1n;
2687
2689
  }
2688
- function pa(c, t) {
2689
- for (var e = cs(c), n = e, a = 0, s, g, d; Hn(n); )
2690
+ function ha(c, t) {
2691
+ for (var e = ss(c), n = e, a = 0, s, g, d; Qn(n); )
2690
2692
  n = n / 2n, a++;
2691
2693
  t:
2692
2694
  for (g = 0; g < t.length; g++)
2693
- if (!(c < t[g]) && (d = Ai(BigInt(t[g]), n, c), !(ke(d) || d === e))) {
2695
+ if (!(c < t[g]) && (d = Ei(BigInt(t[g]), n, c), !(ke(d) || d === e))) {
2694
2696
  for (s = a - 1; s != 0; s--) {
2695
- if (d = Vn(d) % c, ke(d))
2697
+ if (d = Hn(d) % c, ke(d))
2696
2698
  return !1;
2697
2699
  if (d === e)
2698
2700
  continue t;
@@ -2701,33 +2703,33 @@ function pa(c, t) {
2701
2703
  }
2702
2704
  return !0;
2703
2705
  }
2704
- function ss(c) {
2705
- var t = os(c);
2706
+ function rs(c) {
2707
+ var t = cs(c);
2706
2708
  if (t !== void 0)
2707
2709
  return t;
2708
- var e = Qe(c), n = yi(e);
2710
+ var e = Qe(c), n = Ai(e);
2709
2711
  if (n <= 64)
2710
- return pa(e, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
2712
+ return ha(e, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
2711
2713
  for (var a = Math.log(2) * Number(n), s = Math.ceil(a), g = [], d = 0; d < s; d++)
2712
2714
  g.push(BigInt(d + 2));
2713
- return pa(e, g);
2715
+ return ha(e, g);
2714
2716
  }
2715
- le.bitLength = yi;
2716
- le.isOdd = bi;
2717
- le.isNegative = ln;
2717
+ le.bitLength = Ai;
2718
+ le.isOdd = Ci;
2719
+ le.isNegative = un;
2718
2720
  le.abs = Qe;
2719
2721
  le.isUnit = ke;
2720
- le.compare = mi;
2721
- le.modInv = Ci;
2722
- le.modPow = Ai;
2723
- le.isPrime = ss;
2724
- le.square = Vn;
2725
- const rs = Kc, pe = ye, ls = Wn, us = Xn, hn = Li, Ln = es, { bitLength: ds, modInv: mn, modPow: ha, isPrime: La, isOdd: fs, square: _s } = le;
2726
- var Qn = function(t, e, n, a) {
2727
- const s = BigInt(e), g = Math.floor((ds(s - 1n) - 1) / 64) + 1, d = g * 2, C = g * 8, l = n || "f1m";
2722
+ le.compare = yi;
2723
+ le.modInv = Fi;
2724
+ le.modPow = Ei;
2725
+ le.isPrime = rs;
2726
+ le.square = Hn;
2727
+ const ls = Yc, pe = ye, us = Xn, ds = Vn, Ln = bi, mn = ns, { bitLength: fs, modInv: bn, modPow: La, isPrime: ma, isOdd: _s, square: gs } = le;
2728
+ var Jn = function(t, e, n, a) {
2729
+ const s = BigInt(e), g = Math.floor((fs(s - 1n) - 1) / 64) + 1, d = g * 2, C = g * 8, l = n || "f1m";
2728
2730
  if (t.modules[l])
2729
2731
  return l;
2730
- const o = rs(t, g, a), y = t.alloc(C, pe.bigInt2BytesLE(s, C)), E = t.alloc(pe.bigInt2BytesLE(_s(1n << BigInt(g * 64)) % s, C)), m = t.alloc(pe.bigInt2BytesLE((1n << BigInt(g * 64)) % s, C)), x = t.alloc(pe.bigInt2BytesLE(0n, C)), O = s - 1n, L = O >> 1n, I = t.alloc(C, pe.bigInt2BytesLE(L, C)), v = L + 1n, U = t.alloc(C, pe.bigInt2BytesLE(v, C));
2732
+ const o = ls(t, g, a), y = t.alloc(C, pe.bigInt2BytesLE(s, C)), E = t.alloc(pe.bigInt2BytesLE(gs(1n << BigInt(g * 64)) % s, C)), m = t.alloc(pe.bigInt2BytesLE((1n << BigInt(g * 64)) % s, C)), x = t.alloc(pe.bigInt2BytesLE(0n, C)), O = s - 1n, L = O >> 1n, I = t.alloc(C, pe.bigInt2BytesLE(L, C)), v = L + 1n, U = t.alloc(C, pe.bigInt2BytesLE(v, C));
2731
2733
  t.modules[l] = {
2732
2734
  pq: y,
2733
2735
  pR2: E,
@@ -2806,7 +2808,7 @@ var Qn = function(t, e, n, a) {
2806
2808
  function j() {
2807
2809
  const z = t.alloc(d * d * 8), b = t.addFunction(l + "_mReduct");
2808
2810
  b.addParam("t", "i32"), b.addParam("r", "i32"), b.addLocal("np32", "i64"), b.addLocal("c", "i64"), b.addLocal("m", "i64");
2809
- const it = b.getCodeBuilder(), At = Number(0x100000000n - mn(s, 0x100000000n));
2811
+ const it = b.getCodeBuilder(), At = Number(0x100000000n - bn(s, 0x100000000n));
2810
2812
  b.addCode(it.setLocal("np32", it.i64_const(At)));
2811
2813
  for (let Lt = 0; Lt < d; Lt++) {
2812
2814
  b.addCode(it.setLocal("c", it.i64_const(0))), b.addCode(
@@ -2868,7 +2870,7 @@ var Qn = function(t, e, n, a) {
2868
2870
  z.addParam("x", "i32"), z.addParam("y", "i32"), z.addParam("r", "i32"), z.addLocal("c0", "i64"), z.addLocal("c1", "i64"), z.addLocal("np32", "i64");
2869
2871
  for (let Et = 0; Et < d; Et++)
2870
2872
  z.addLocal("x" + Et, "i64"), z.addLocal("y" + Et, "i64"), z.addLocal("m" + Et, "i64"), z.addLocal("q" + Et, "i64");
2871
- const b = z.getCodeBuilder(), it = Number(0x100000000n - mn(s, 0x100000000n));
2873
+ const b = z.getCodeBuilder(), it = Number(0x100000000n - bn(s, 0x100000000n));
2872
2874
  z.addCode(b.setLocal("np32", b.i64_const(it)));
2873
2875
  const At = [], Lt = [], yt = [];
2874
2876
  function It(Et, bt) {
@@ -3007,7 +3009,7 @@ var Qn = function(t, e, n, a) {
3007
3009
  z.addParam("x", "i32"), z.addParam("r", "i32"), z.addLocal("c0", "i64"), z.addLocal("c1", "i64"), z.addLocal("c0_old", "i64"), z.addLocal("c1_old", "i64"), z.addLocal("np32", "i64");
3008
3010
  for (let bt = 0; bt < d; bt++)
3009
3011
  z.addLocal("x" + bt, "i64"), z.addLocal("m" + bt, "i64"), z.addLocal("q" + bt, "i64");
3010
- const b = z.getCodeBuilder(), it = Number(0x100000000n - mn(s, 0x100000000n));
3012
+ const b = z.getCodeBuilder(), it = Number(0x100000000n - bn(s, 0x100000000n));
3011
3013
  z.addCode(b.setLocal("np32", b.i64_const(it)));
3012
3014
  const At = [], Lt = [];
3013
3015
  function yt(bt, pt) {
@@ -3250,13 +3252,13 @@ var Qn = function(t, e, n, a) {
3250
3252
  z.addCode(b.call(l + "_fromMontgomery", b.getLocal("x"), b.getLocal("r"))), z.addCode(b.call(o + "_inverseMod", b.getLocal("r"), b.i32_const(y), b.getLocal("r"))), z.addCode(b.call(l + "_toMontgomery", b.getLocal("r"), b.getLocal("r")));
3251
3253
  }
3252
3254
  let nt = 2n;
3253
- if (La(s))
3254
- for (; ha(nt, L, s) !== O; )
3255
+ if (ma(s))
3256
+ for (; La(nt, L, s) !== O; )
3255
3257
  nt = nt + 1n;
3256
3258
  let J = 0, ft = O;
3257
- for (; !fs(ft) && ft !== 0n; )
3259
+ for (; !_s(ft) && ft !== 0n; )
3258
3260
  J++, ft = ft >> 1n;
3259
- const at = t.alloc(C, pe.bigInt2BytesLE(ft, C)), _t = ha(nt, ft, s), zt = t.alloc(pe.bigInt2BytesLE((_t << BigInt(g * 64)) % s, C)), G = ft + 1n >> 1n, K = t.alloc(C, pe.bigInt2BytesLE(G, C));
3261
+ const at = t.alloc(C, pe.bigInt2BytesLE(ft, C)), _t = La(nt, ft, s), zt = t.alloc(pe.bigInt2BytesLE((_t << BigInt(g * 64)) % s, C)), G = ft + 1n >> 1n, K = t.alloc(C, pe.bigInt2BytesLE(G, C));
3260
3262
  function P() {
3261
3263
  const z = t.addFunction(l + "_sqrt");
3262
3264
  z.addParam("n", "i32"), z.addParam("r", "i32"), z.addLocal("m", "i32"), z.addLocal("i", "i32"), z.addLocal("j", "i32");
@@ -3380,7 +3382,7 @@ var Qn = function(t, e, n, a) {
3380
3382
  b.ret(b.call(o + "_eq", b.getLocal("x"), b.i32_const(m)))
3381
3383
  );
3382
3384
  }
3383
- return t.exportFunction(o + "_copy", l + "_copy"), t.exportFunction(o + "_zero", l + "_zero"), t.exportFunction(o + "_isZero", l + "_isZero"), t.exportFunction(o + "_eq", l + "_eq"), W(), S(), F(), r(), j(), T(), D(), A(), M(), H(), h(), R(), ut(), w(), q(), u(), us(t, l), hn(t, l + "_batchToMontgomery", l + "_toMontgomery", C, C), hn(t, l + "_batchFromMontgomery", l + "_fromMontgomery", C, C), hn(t, l + "_batchNeg", l + "_neg", C, C), Ln(t, l + "_batchAdd", l + "_add", C, C), Ln(t, l + "_batchSub", l + "_sub", C, C), Ln(t, l + "_batchMul", l + "_mul", C, C), t.exportFunction(l + "_add"), t.exportFunction(l + "_sub"), t.exportFunction(l + "_neg"), t.exportFunction(l + "_isNegative"), t.exportFunction(l + "_isOne"), t.exportFunction(l + "_sign"), t.exportFunction(l + "_mReduct"), t.exportFunction(l + "_mul"), t.exportFunction(l + "_square"), t.exportFunction(l + "_squareOld"), t.exportFunction(l + "_fromMontgomery"), t.exportFunction(l + "_toMontgomery"), t.exportFunction(l + "_inverse"), t.exportFunction(l + "_one"), t.exportFunction(l + "_load"), t.exportFunction(l + "_timesScalar"), ls(
3385
+ return t.exportFunction(o + "_copy", l + "_copy"), t.exportFunction(o + "_zero", l + "_zero"), t.exportFunction(o + "_isZero", l + "_isZero"), t.exportFunction(o + "_eq", l + "_eq"), W(), S(), F(), r(), j(), T(), D(), A(), M(), H(), h(), R(), ut(), w(), q(), u(), ds(t, l), Ln(t, l + "_batchToMontgomery", l + "_toMontgomery", C, C), Ln(t, l + "_batchFromMontgomery", l + "_fromMontgomery", C, C), Ln(t, l + "_batchNeg", l + "_neg", C, C), mn(t, l + "_batchAdd", l + "_add", C, C), mn(t, l + "_batchSub", l + "_sub", C, C), mn(t, l + "_batchMul", l + "_mul", C, C), t.exportFunction(l + "_add"), t.exportFunction(l + "_sub"), t.exportFunction(l + "_neg"), t.exportFunction(l + "_isNegative"), t.exportFunction(l + "_isOne"), t.exportFunction(l + "_sign"), t.exportFunction(l + "_mReduct"), t.exportFunction(l + "_mul"), t.exportFunction(l + "_square"), t.exportFunction(l + "_squareOld"), t.exportFunction(l + "_fromMontgomery"), t.exportFunction(l + "_toMontgomery"), t.exportFunction(l + "_inverse"), t.exportFunction(l + "_one"), t.exportFunction(l + "_load"), t.exportFunction(l + "_timesScalar"), us(
3384
3386
  t,
3385
3387
  l + "_exp",
3386
3388
  C,
@@ -3388,17 +3390,17 @@ var Qn = function(t, e, n, a) {
3388
3390
  l + "_square",
3389
3391
  o + "_copy",
3390
3392
  l + "_one"
3391
- ), t.exportFunction(l + "_exp"), t.exportFunction(l + "_batchInverse"), La(s) && (P(), i(), t.exportFunction(l + "_sqrt"), t.exportFunction(l + "_isSquare")), t.exportFunction(l + "_batchToMontgomery"), t.exportFunction(l + "_batchFromMontgomery"), l;
3393
+ ), t.exportFunction(l + "_exp"), t.exportFunction(l + "_batchInverse"), ma(s) && (P(), i(), t.exportFunction(l + "_sqrt"), t.exportFunction(l + "_isSquare")), t.exportFunction(l + "_batchToMontgomery"), t.exportFunction(l + "_batchFromMontgomery"), l;
3392
3394
  };
3393
- const gs = Qn, { bitLength: ps } = le;
3394
- var Fi = function(t, e, n, a, s) {
3395
- const g = BigInt(e), d = Math.floor((ps(g - 1n) - 1) / 64) + 1, C = d * 8, l = n || "f1";
3395
+ const ps = Jn, { bitLength: hs } = le;
3396
+ var wi = function(t, e, n, a, s) {
3397
+ const g = BigInt(e), d = Math.floor((hs(g - 1n) - 1) / 64) + 1, C = d * 8, l = n || "f1";
3396
3398
  if (t.modules[l])
3397
3399
  return l;
3398
3400
  t.modules[l] = {
3399
3401
  n64: d
3400
3402
  };
3401
- const o = s || "int", y = gs(t, g, a, o), E = t.modules[y].pR2, m = t.modules[y].pq, x = t.modules[y].pePlusOne;
3403
+ const o = s || "int", y = ps(t, g, a, o), E = t.modules[y].pR2, m = t.modules[y].pq, x = t.modules[y].pePlusOne;
3402
3404
  function O() {
3403
3405
  const U = t.alloc(C), w = t.addFunction(l + "_mul");
3404
3406
  w.addParam("x", "i32"), w.addParam("y", "i32"), w.addParam("r", "i32");
@@ -3427,8 +3429,8 @@ var Fi = function(t, e, n, a, s) {
3427
3429
  }
3428
3430
  return O(), L(), I(), v(), t.exportFunction(y + "_add", l + "_add"), t.exportFunction(y + "_sub", l + "_sub"), t.exportFunction(y + "_neg", l + "_neg"), t.exportFunction(l + "_mul"), t.exportFunction(l + "_square"), t.exportFunction(l + "_inverse"), t.exportFunction(l + "_isNegative"), t.exportFunction(y + "_copy", l + "_copy"), t.exportFunction(y + "_zero", l + "_zero"), t.exportFunction(y + "_one", l + "_one"), t.exportFunction(y + "_isZero", l + "_isZero"), t.exportFunction(y + "_eq", l + "_eq"), l;
3429
3431
  };
3430
- const hs = Wn, Ls = Xn, bn = ye;
3431
- var Ei = function(t, e, n, a) {
3432
+ const Ls = Xn, ms = Vn, yn = ye;
3433
+ var Bi = function(t, e, n, a) {
3432
3434
  if (t.modules[n])
3433
3435
  return n;
3434
3436
  const s = t.modules[a].n64 * 8, g = t.modules[a].q;
@@ -3661,7 +3663,7 @@ var Ei = function(t, e, n, a) {
3661
3663
  function j() {
3662
3664
  const D = t.addFunction(n + "_sqrt");
3663
3665
  D.addParam("a", "i32"), D.addParam("pr", "i32");
3664
- const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(bn.bigInt2BytesLE((BigInt(g || 0) - 3n) / 4n, s))), H = A.i32_const(t.alloc(bn.bigInt2BytesLE((BigInt(g || 0) - 1n) / 2n, s))), ut = A.getLocal("a"), nt = A.i32_const(t.alloc(s * 2)), J = A.i32_const(t.alloc(s * 2)), ft = A.i32_const(t.alloc(s * 2)), at = t.alloc(s * 2), _t = A.i32_const(at), zt = A.i32_const(at), G = A.i32_const(at + s), K = A.i32_const(t.alloc(s * 2)), P = A.i32_const(t.alloc(s * 2));
3666
+ const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(yn.bigInt2BytesLE((BigInt(g || 0) - 3n) / 4n, s))), H = A.i32_const(t.alloc(yn.bigInt2BytesLE((BigInt(g || 0) - 1n) / 2n, s))), ut = A.getLocal("a"), nt = A.i32_const(t.alloc(s * 2)), J = A.i32_const(t.alloc(s * 2)), ft = A.i32_const(t.alloc(s * 2)), at = t.alloc(s * 2), _t = A.i32_const(at), zt = A.i32_const(at), G = A.i32_const(at + s), K = A.i32_const(t.alloc(s * 2)), P = A.i32_const(t.alloc(s * 2));
3665
3667
  D.addCode(
3666
3668
  A.call(n + "_one", _t),
3667
3669
  A.call(n + "_neg", _t, _t),
@@ -3700,7 +3702,7 @@ var Ei = function(t, e, n, a) {
3700
3702
  function T() {
3701
3703
  const D = t.addFunction(n + "_isSquare");
3702
3704
  D.addParam("a", "i32"), D.setReturnType("i32");
3703
- const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(bn.bigInt2BytesLE((BigInt(g || 0) - 3n) / 4n, s))), H = A.getLocal("a"), ut = A.i32_const(t.alloc(s * 2)), nt = A.i32_const(t.alloc(s * 2)), J = A.i32_const(t.alloc(s * 2)), ft = t.alloc(s * 2), at = A.i32_const(ft);
3705
+ const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(yn.bigInt2BytesLE((BigInt(g || 0) - 3n) / 4n, s))), H = A.getLocal("a"), ut = A.i32_const(t.alloc(s * 2)), nt = A.i32_const(t.alloc(s * 2)), J = A.i32_const(t.alloc(s * 2)), ft = t.alloc(s * 2), at = A.i32_const(ft);
3704
3706
  D.addCode(
3705
3707
  A.call(n + "_one", at),
3706
3708
  A.call(n + "_neg", at, at),
@@ -3724,7 +3726,7 @@ var Ei = function(t, e, n, a) {
3724
3726
  A.ret(A.i32_const(1))
3725
3727
  );
3726
3728
  }
3727
- return F(), R(), U(), w(), v(), m(), x(), O(), d(), l(), o(), y(), L(), I(), S(), r(), C(), h(), E(), t.exportFunction(n + "_isZero"), t.exportFunction(n + "_isOne"), t.exportFunction(n + "_zero"), t.exportFunction(n + "_one"), t.exportFunction(n + "_copy"), t.exportFunction(n + "_mul"), t.exportFunction(n + "_mul1"), t.exportFunction(n + "_square"), t.exportFunction(n + "_add"), t.exportFunction(n + "_sub"), t.exportFunction(n + "_neg"), t.exportFunction(n + "_sign"), t.exportFunction(n + "_conjugate"), t.exportFunction(n + "_fromMontgomery"), t.exportFunction(n + "_toMontgomery"), t.exportFunction(n + "_eq"), t.exportFunction(n + "_inverse"), Ls(t, n), hs(
3729
+ return F(), R(), U(), w(), v(), m(), x(), O(), d(), l(), o(), y(), L(), I(), S(), r(), C(), h(), E(), t.exportFunction(n + "_isZero"), t.exportFunction(n + "_isOne"), t.exportFunction(n + "_zero"), t.exportFunction(n + "_one"), t.exportFunction(n + "_copy"), t.exportFunction(n + "_mul"), t.exportFunction(n + "_mul1"), t.exportFunction(n + "_square"), t.exportFunction(n + "_add"), t.exportFunction(n + "_sub"), t.exportFunction(n + "_neg"), t.exportFunction(n + "_sign"), t.exportFunction(n + "_conjugate"), t.exportFunction(n + "_fromMontgomery"), t.exportFunction(n + "_toMontgomery"), t.exportFunction(n + "_eq"), t.exportFunction(n + "_inverse"), ms(t, n), Ls(
3728
3730
  t,
3729
3731
  n + "_exp",
3730
3732
  s * 2,
@@ -3734,8 +3736,8 @@ var Ei = function(t, e, n, a) {
3734
3736
  n + "_one"
3735
3737
  ), j(), T(), t.exportFunction(n + "_exp"), t.exportFunction(n + "_timesScalar"), t.exportFunction(n + "_batchInverse"), t.exportFunction(n + "_sqrt"), t.exportFunction(n + "_isSquare"), t.exportFunction(n + "_isNegative"), n;
3736
3738
  };
3737
- const ms = Wn, bs = Xn;
3738
- var wi = function(t, e, n, a) {
3739
+ const bs = Xn, ys = Vn;
3740
+ var vi = function(t, e, n, a) {
3739
3741
  if (t.modules[n])
3740
3742
  return n;
3741
3743
  const s = t.modules[a].n64 * 8;
@@ -3992,7 +3994,7 @@ var wi = function(t, e, n, a) {
3992
3994
  )
3993
3995
  );
3994
3996
  }
3995
- return U(), F(), L(), I(), O(), y(), E(), g(), C(), l(), S(), m(), x(), v(), w(), d(), o(), t.exportFunction(n + "_isZero"), t.exportFunction(n + "_isOne"), t.exportFunction(n + "_zero"), t.exportFunction(n + "_one"), t.exportFunction(n + "_copy"), t.exportFunction(n + "_mul"), t.exportFunction(n + "_square"), t.exportFunction(n + "_add"), t.exportFunction(n + "_sub"), t.exportFunction(n + "_neg"), t.exportFunction(n + "_sign"), t.exportFunction(n + "_fromMontgomery"), t.exportFunction(n + "_toMontgomery"), t.exportFunction(n + "_eq"), t.exportFunction(n + "_inverse"), bs(t, n), ms(
3997
+ return U(), F(), L(), I(), O(), y(), E(), g(), C(), l(), S(), m(), x(), v(), w(), d(), o(), t.exportFunction(n + "_isZero"), t.exportFunction(n + "_isOne"), t.exportFunction(n + "_zero"), t.exportFunction(n + "_one"), t.exportFunction(n + "_copy"), t.exportFunction(n + "_mul"), t.exportFunction(n + "_square"), t.exportFunction(n + "_add"), t.exportFunction(n + "_sub"), t.exportFunction(n + "_neg"), t.exportFunction(n + "_sign"), t.exportFunction(n + "_fromMontgomery"), t.exportFunction(n + "_toMontgomery"), t.exportFunction(n + "_eq"), t.exportFunction(n + "_inverse"), ys(t, n), bs(
3996
3998
  t,
3997
3999
  n + "_exp",
3998
4000
  s * 3,
@@ -4001,7 +4003,7 @@ var wi = function(t, e, n, a) {
4001
4003
  n + "_copy",
4002
4004
  n + "_one"
4003
4005
  ), t.exportFunction(n + "_exp"), t.exportFunction(n + "_timesScalar"), t.exportFunction(n + "_batchInverse"), t.exportFunction(n + "_isNegative"), n;
4004
- }, ys = function(t, e, n, a, s, g, d, C) {
4006
+ }, Cs = function(t, e, n, a, s, g, d, C) {
4005
4007
  const l = t.addFunction(e);
4006
4008
  l.addParam("base", "i32"), l.addParam("scalar", "i32"), l.addParam("scalarLength", "i32"), l.addParam("r", "i32"), l.addLocal("old0", "i32"), l.addLocal("nbits", "i32"), l.addLocal("i", "i32"), l.addLocal("last", "i32"), l.addLocal("cur", "i32"), l.addLocal("carry", "i32"), l.addLocal("p", "i32");
4007
4009
  const o = l.getCodeBuilder(), y = o.i32_const(t.alloc(n));
@@ -4184,7 +4186,7 @@ var wi = function(t, e, n, a) {
4184
4186
  )),
4185
4187
  o.i32_store(o.i32_const(0), o.getLocal("old0"))
4186
4188
  );
4187
- }, Cs = function(t, e, n, a, s) {
4189
+ }, As = function(t, e, n, a, s) {
4188
4190
  const d = t.modules[e].n64 * 8;
4189
4191
  function C() {
4190
4192
  const E = t.addFunction(n + "_getChunk");
@@ -4576,8 +4578,8 @@ var wi = function(t, e, n, a) {
4576
4578
  }
4577
4579
  C(), y(), l(), o(), t.exportFunction(n), t.exportFunction(n + "_chunk");
4578
4580
  };
4579
- const ma = ys, Me = Li, ba = Cs;
4580
- var Bi = function(t, e, n, a) {
4581
+ const ba = Cs, Me = bi, ya = As;
4582
+ var xi = function(t, e, n, a) {
4581
4583
  const s = t.modules[n].n64, g = s * 8;
4582
4584
  if (t.modules[e])
4583
4585
  return e;
@@ -5475,7 +5477,7 @@ var Bi = function(t, e, n, a) {
5475
5477
  )
5476
5478
  );
5477
5479
  }
5478
- return C(), d(), E(), y(), o(), l(), ut(), I(), x(), m(), L(), O(), h(), r(), F(), j(), R(), A(), D(), T(), S(), w(), U(), v(), H(), G(), K(), nt(), M(), J(), at(), ft(), _t(), zt(), Me(t, e + "_batchLEMtoU", e + "_LEMtoU", g * 2, g * 2), Me(t, e + "_batchLEMtoC", e + "_LEMtoC", g * 2, g), Me(t, e + "_batchUtoLEM", e + "_UtoLEM", g * 2, g * 2), Me(t, e + "_batchCtoLEM", e + "_CtoLEM", g, g * 2, !0), Me(t, e + "_batchToJacobian", e + "_toJacobian", g * 2, g * 3, !0), ba(t, e, e + "_multiexp", e + "_add", g * 3), ba(t, e, e + "_multiexpAffine", e + "_addMixed", g * 2), ma(
5480
+ return C(), d(), E(), y(), o(), l(), ut(), I(), x(), m(), L(), O(), h(), r(), F(), j(), R(), A(), D(), T(), S(), w(), U(), v(), H(), G(), K(), nt(), M(), J(), at(), ft(), _t(), zt(), Me(t, e + "_batchLEMtoU", e + "_LEMtoU", g * 2, g * 2), Me(t, e + "_batchLEMtoC", e + "_LEMtoC", g * 2, g), Me(t, e + "_batchUtoLEM", e + "_UtoLEM", g * 2, g * 2), Me(t, e + "_batchCtoLEM", e + "_CtoLEM", g, g * 2, !0), Me(t, e + "_batchToJacobian", e + "_toJacobian", g * 2, g * 3, !0), ya(t, e, e + "_multiexp", e + "_add", g * 3), ya(t, e, e + "_multiexpAffine", e + "_addMixed", g * 2), ba(
5479
5481
  t,
5480
5482
  e + "_timesScalar",
5481
5483
  g * 3,
@@ -5484,7 +5486,7 @@ var Bi = function(t, e, n, a) {
5484
5486
  e + "_sub",
5485
5487
  e + "_copy",
5486
5488
  e + "_zero"
5487
- ), ma(
5489
+ ), ba(
5488
5490
  t,
5489
5491
  e + "_timesScalarAffine",
5490
5492
  g * 2,
@@ -5495,11 +5497,11 @@ var Bi = function(t, e, n, a) {
5495
5497
  e + "_zero"
5496
5498
  ), t.exportFunction(e + "_isZero"), t.exportFunction(e + "_isZeroAffine"), t.exportFunction(e + "_eq"), t.exportFunction(e + "_eqMixed"), t.exportFunction(e + "_eqAffine"), t.exportFunction(e + "_copy"), t.exportFunction(e + "_copyAffine"), t.exportFunction(e + "_zero"), t.exportFunction(e + "_zeroAffine"), t.exportFunction(e + "_double"), t.exportFunction(e + "_doubleAffine"), t.exportFunction(e + "_add"), t.exportFunction(e + "_addMixed"), t.exportFunction(e + "_addAffine"), t.exportFunction(e + "_neg"), t.exportFunction(e + "_negAffine"), t.exportFunction(e + "_sub"), t.exportFunction(e + "_subMixed"), t.exportFunction(e + "_subAffine"), t.exportFunction(e + "_fromMontgomery"), t.exportFunction(e + "_fromMontgomeryAffine"), t.exportFunction(e + "_toMontgomery"), t.exportFunction(e + "_toMontgomeryAffine"), t.exportFunction(e + "_timesScalar"), t.exportFunction(e + "_timesScalarAffine"), t.exportFunction(e + "_normalize"), t.exportFunction(e + "_LEMtoU"), t.exportFunction(e + "_LEMtoC"), t.exportFunction(e + "_UtoLEM"), t.exportFunction(e + "_CtoLEM"), t.exportFunction(e + "_batchLEMtoU"), t.exportFunction(e + "_batchLEMtoC"), t.exportFunction(e + "_batchUtoLEM"), t.exportFunction(e + "_batchCtoLEM"), t.exportFunction(e + "_toAffine"), t.exportFunction(e + "_toJacobian"), t.exportFunction(e + "_batchToAffine"), t.exportFunction(e + "_batchToJacobian"), t.exportFunction(e + "_inCurve"), t.exportFunction(e + "_inCurveAffine"), e;
5497
5499
  };
5498
- const { isOdd: As, modInv: ya, modPow: Re } = le, Ye = ye;
5499
- var vi = function(t, e, n, a, s) {
5500
+ const { isOdd: Fs, modInv: Ca, modPow: Re } = le, Ye = ye;
5501
+ var Si = function(t, e, n, a, s) {
5500
5502
  const d = t.modules[a].n64 * 8, l = t.modules[n].n64 * 8, o = t.modules[a].q;
5501
5503
  let y = o - 1n, E = 0;
5502
- for (; !As(y); )
5504
+ for (; !Fs(y); )
5503
5505
  E++, y = y >> 1n;
5504
5506
  let m = 2n;
5505
5507
  for (; Re(m, o >> 1n, o) === 1n; )
@@ -5520,12 +5522,12 @@ var vi = function(t, e, n, a, s) {
5520
5522
  U[q] = U[q - 1] * 2n;
5521
5523
  const w = [];
5522
5524
  for (let q = 0; q <= E; q++) {
5523
- const u = ya(U[q], o) * I % o;
5525
+ const u = Ca(U[q], o) * I % o;
5524
5526
  w.push(...Ye.bigInt2BytesLE(u, d));
5525
5527
  }
5526
5528
  const S = t.alloc(w), F = Re(m, 2n, o), r = [], h = [];
5527
5529
  for (let q = 0; q <= E; q++) {
5528
- const u = Re(F, 2n ** BigInt(q), o), W = ya(o + 1n - u, o);
5530
+ const u = Re(F, 2n ** BigInt(q), o), W = Ca(o + 1n - u, o);
5529
5531
  r.push(...Ye.bigInt2BytesLE(u * I % o, d)), h.push(...Ye.bigInt2BytesLE(W * I % o, d));
5530
5532
  }
5531
5533
  const R = t.alloc(r), j = t.alloc(h);
@@ -6518,7 +6520,7 @@ var vi = function(t, e, n, a, s) {
6518
6520
  );
6519
6521
  }
6520
6522
  at(), ft(), J(), nt(), M(), H(), ut(), _t(), zt(), G(), P(), i(), K(), t.exportFunction(e + "_fft"), t.exportFunction(e + "_ifft"), t.exportFunction(e + "_rawfft"), t.exportFunction(e + "_fftJoin"), t.exportFunction(e + "_fftJoinExt"), t.exportFunction(e + "_fftJoinExtInv"), t.exportFunction(e + "_fftMix"), t.exportFunction(e + "_fftFinal"), t.exportFunction(e + "_prepareLagrangeEvaluation");
6521
- }, xi = function(t, e, n) {
6523
+ }, Ii = function(t, e, n) {
6522
6524
  const s = t.modules[n].n64 * 8;
6523
6525
  function g() {
6524
6526
  const C = t.addFunction(e + "_zero");
@@ -6611,7 +6613,7 @@ var vi = function(t, e, n, a, s) {
6611
6613
  );
6612
6614
  }
6613
6615
  return g(), d(), t.exportFunction(e + "_zero"), t.exportFunction(e + "_constructLC"), e;
6614
- }, Si = function(t, e, n) {
6616
+ }, Oi = function(t, e, n) {
6615
6617
  const s = t.modules[n].n64 * 8;
6616
6618
  function g() {
6617
6619
  const l = t.addFunction(e + "_buildABC");
@@ -6881,7 +6883,7 @@ var vi = function(t, e, n, a, s) {
6881
6883
  );
6882
6884
  }
6883
6885
  return g(), d(), C(), t.exportFunction(e + "_buildABC"), t.exportFunction(e + "_joinABC"), t.exportFunction(e + "_batchAdd"), e;
6884
- }, Ii = function(t, e, n, a, s, g, d, C) {
6886
+ }, Pi = function(t, e, n, a, s, g, d, C) {
6885
6887
  const l = t.addFunction(e);
6886
6888
  l.addParam("pIn", "i32"), l.addParam("n", "i32"), l.addParam("pFirst", "i32"), l.addParam("pInc", "i32"), l.addParam("pOut", "i32"), l.addLocal("pOldFree", "i32"), l.addLocal("i", "i32"), l.addLocal("pFrom", "i32"), l.addLocal("pTo", "i32");
6887
6889
  const o = l.getCodeBuilder(), y = o.i32_const(t.alloc(d));
@@ -6918,19 +6920,19 @@ var vi = function(t, e, n, a, s) {
6918
6920
  ))
6919
6921
  ), t.exportFunction(e);
6920
6922
  };
6921
- const Nt = ye, Fs = Qn, Es = Fi, Ca = Ei, ws = wi, Aa = Bi, yn = vi, Bs = xi, vs = Si, Ne = Ii, { bitLength: xs, modInv: Ss, isOdd: Fa, isNegative: Is } = le;
6922
- var Os = function(t, e) {
6923
+ const Nt = ye, Es = Jn, ws = wi, Aa = Bi, Bs = vi, Fa = xi, Cn = Si, vs = Ii, xs = Oi, Ne = Pi, { bitLength: Ss, modInv: Is, isOdd: Ea, isNegative: Os } = le;
6924
+ var Ps = function(t, e) {
6923
6925
  const n = e || "bn128";
6924
6926
  if (t.modules[n])
6925
6927
  return n;
6926
- const a = 21888242871839275222246405745257275088696311157297823662689037894645226208583n, s = 21888242871839275222246405745257275088548364400416034343698204186575808495617n, g = Math.floor((xs(a - 1n) - 1) / 64) + 1, d = g * 8, C = d, l = d, o = l * 2, y = l * 12, E = t.alloc(Nt.bigInt2BytesLE(s, C)), m = Fs(t, a, "f1m");
6927
- Es(t, s, "fr", "frm");
6928
- const x = t.alloc(Nt.bigInt2BytesLE(w(3n), l)), O = Aa(t, "g1m", "f1m", x);
6929
- yn(t, "frm", "frm", "frm", "frm_mul"), Bs(t, "pol", "frm"), vs(t, "qap", "frm");
6930
- const L = Ca(t, "f1m_neg", "f2m", "f1m"), I = t.alloc([
6928
+ const a = 21888242871839275222246405745257275088696311157297823662689037894645226208583n, s = 21888242871839275222246405745257275088548364400416034343698204186575808495617n, g = Math.floor((Ss(a - 1n) - 1) / 64) + 1, d = g * 8, C = d, l = d, o = l * 2, y = l * 12, E = t.alloc(Nt.bigInt2BytesLE(s, C)), m = Es(t, a, "f1m");
6929
+ ws(t, s, "fr", "frm");
6930
+ const x = t.alloc(Nt.bigInt2BytesLE(w(3n), l)), O = Fa(t, "g1m", "f1m", x);
6931
+ Cn(t, "frm", "frm", "frm", "frm_mul"), vs(t, "pol", "frm"), xs(t, "qap", "frm");
6932
+ const L = Aa(t, "f1m_neg", "f2m", "f1m"), I = t.alloc([
6931
6933
  ...Nt.bigInt2BytesLE(w(19485874751759354771024239261021720505790618469301721065564631296452457478373n), l),
6932
6934
  ...Nt.bigInt2BytesLE(w(266929791119991161246907387137283842545076965332900288569378510910307636690n), l)
6933
- ]), v = Aa(t, "g2m", "f2m", I);
6935
+ ]), v = Fa(t, "g2m", "f2m", I);
6934
6936
  function U(Y, f) {
6935
6937
  const _ = t.addFunction(Y);
6936
6938
  _.addParam("pG", "i32"), _.addParam("pFr", "i32"), _.addParam("pr", "i32");
@@ -6946,7 +6948,7 @@ var Os = function(t, e) {
6946
6948
  )
6947
6949
  ), t.exportFunction(Y);
6948
6950
  }
6949
- U("g1m_timesFr", "g1m_timesScalar"), yn(t, "g1m", "g1m", "frm", "g1m_timesFr"), U("g2m_timesFr", "g2m_timesScalar"), yn(t, "g2m", "g2m", "frm", "g2m_timesFr"), U("g1m_timesFrAffine", "g1m_timesScalarAffine"), U("g2m_timesFrAffine", "g2m_timesScalarAffine"), Ne(t, "frm_batchApplyKey", "fmr", "frm", d, d, d, "frm_mul"), Ne(t, "g1m_batchApplyKey", "g1m", "frm", d * 3, d * 3, d, "g1m_timesFr"), Ne(t, "g1m_batchApplyKeyMixed", "g1m", "frm", d * 2, d * 3, d, "g1m_timesFrAffine"), Ne(t, "g2m_batchApplyKey", "g2m", "frm", d * 2 * 3, d * 3 * 2, d, "g2m_timesFr"), Ne(t, "g2m_batchApplyKeyMixed", "g2m", "frm", d * 2 * 2, d * 3 * 2, d, "g2m_timesFrAffine");
6951
+ U("g1m_timesFr", "g1m_timesScalar"), Cn(t, "g1m", "g1m", "frm", "g1m_timesFr"), U("g2m_timesFr", "g2m_timesScalar"), Cn(t, "g2m", "g2m", "frm", "g2m_timesFr"), U("g1m_timesFrAffine", "g1m_timesScalarAffine"), U("g2m_timesFrAffine", "g2m_timesScalarAffine"), Ne(t, "frm_batchApplyKey", "fmr", "frm", d, d, d, "frm_mul"), Ne(t, "g1m_batchApplyKey", "g1m", "frm", d * 3, d * 3, d, "g1m_timesFr"), Ne(t, "g1m_batchApplyKeyMixed", "g1m", "frm", d * 2, d * 3, d, "g1m_timesFrAffine"), Ne(t, "g2m_batchApplyKey", "g2m", "frm", d * 2 * 3, d * 3 * 2, d, "g2m_timesFr"), Ne(t, "g2m_batchApplyKeyMixed", "g2m", "frm", d * 2 * 2, d * 3 * 2, d, "g2m_timesFrAffine");
6950
6952
  function w(Y) {
6951
6953
  return BigInt(Y) * (1n << BigInt(l * 8)) % a;
6952
6954
  }
@@ -7031,7 +7033,7 @@ var Os = function(t, e) {
7031
7033
  ...Nt.bigInt2BytesLE(w(9), l),
7032
7034
  ...Nt.bigInt2BytesLE(w(1), l)
7033
7035
  ]), H = t.alloc([
7034
- ...Nt.bigInt2BytesLE(w(Ss(2n, a)), l),
7036
+ ...Nt.bigInt2BytesLE(w(Is(2n, a)), l),
7035
7037
  ...Nt.bigInt2BytesLE(0n, l)
7036
7038
  ]), ut = M, nt = t.alloc([
7037
7039
  ...Nt.bigInt2BytesLE(w(19485874751759354771024239261021720505790618469301721065564631296452457478373n), l),
@@ -7051,7 +7053,7 @@ var Os = function(t, e) {
7051
7053
  );
7052
7054
  }
7053
7055
  J();
7054
- const ft = ws(t, n + "_mulNR6", "f6m", "f2m");
7056
+ const ft = Bs(t, n + "_mulNR6", "f6m", "f2m");
7055
7057
  function at() {
7056
7058
  const Y = t.addFunction(n + "_mulNR12");
7057
7059
  Y.addParam("x", "i32"), Y.addParam("pr", "i32");
@@ -7076,7 +7078,7 @@ var Os = function(t, e) {
7076
7078
  );
7077
7079
  }
7078
7080
  at();
7079
- const _t = Ca(t, n + "_mulNR12", "ftm", ft), G = At(29793968203157093288n), K = t.alloc(G), P = 3 * o, i = G.length - 1, u = G.reduce((Y, f) => Y + (f != 0 ? 1 : 0), 0) + i + 1, W = 3 * 2 * d, z = 3 * d * 2 + u * P;
7081
+ const _t = Aa(t, n + "_mulNR12", "ftm", ft), G = At(29793968203157093288n), K = t.alloc(G), P = 3 * o, i = G.length - 1, u = G.reduce((Y, f) => Y + (f != 0 ? 1 : 0), 0) + i + 1, W = 3 * 2 * d, z = 3 * d * 2 + u * P;
7080
7082
  t.modules[n] = {
7081
7083
  n64: g,
7082
7084
  pG1gen: F,
@@ -7098,7 +7100,7 @@ var Os = function(t, e) {
7098
7100
  let f = Y;
7099
7101
  const _ = [];
7100
7102
  for (; f > 0n; ) {
7101
- if (Fa(f)) {
7103
+ if (Ea(f)) {
7102
7104
  const Z = 2 - Number(f % 4n);
7103
7105
  _.push(Z), f = f - BigInt(Z);
7104
7106
  } else
@@ -7111,7 +7113,7 @@ var Os = function(t, e) {
7111
7113
  let f = Y;
7112
7114
  const _ = [];
7113
7115
  for (; f > 0n; )
7114
- Fa(f) ? _.push(1) : _.push(0), f = f >> 1n;
7116
+ Ea(f) ? _.push(1) : _.push(0), f = f >> 1n;
7115
7117
  return _;
7116
7118
  }
7117
7119
  function Lt() {
@@ -7505,7 +7507,7 @@ var Os = function(t, e) {
7505
7507
  (ct * rt - st * ot) % a,
7506
7508
  (ct * ot + st * rt) % a
7507
7509
  ];
7508
- return Is(gt[0]) && (gt[0] = gt[0] + a), gt;
7510
+ return Os(gt[0]) && (gt[0] = gt[0] + a), gt;
7509
7511
  }
7510
7512
  }
7511
7513
  function $t() {
@@ -7738,19 +7740,19 @@ var Os = function(t, e) {
7738
7740
  Wt(Y), t.exportFunction(n + "_pairingEq" + Y);
7739
7741
  wt(), t.exportFunction(n + "_pairing"), t.exportFunction(n + "_prepareG1"), t.exportFunction(n + "_prepareG2"), t.exportFunction(n + "_millerLoop"), t.exportFunction(n + "_finalExponentiation"), t.exportFunction(n + "_finalExponentiationOld"), t.exportFunction(n + "__mulBy024"), t.exportFunction(n + "__mulBy024Old"), t.exportFunction(n + "__cyclotomicSquare"), t.exportFunction(n + "__cyclotomicExp_w0");
7740
7742
  };
7741
- const Mt = ye, Ps = Qn, ks = Fi, Ea = Ei, Ts = wi, wa = Bi, Cn = vi, qs = xi, Ds = Si, ze = Ii, { bitLength: Ba, isOdd: va, isNegative: Ms } = le;
7742
- var Rs = function(t, e) {
7743
+ const Mt = ye, ks = Jn, Ts = wi, wa = Bi, qs = vi, Ba = xi, An = Si, Ds = Ii, Ms = Oi, ze = Pi, { bitLength: va, isOdd: xa, isNegative: Rs } = le;
7744
+ var Ns = function(t, e) {
7743
7745
  const n = e || "bls12381";
7744
7746
  if (t.modules[n])
7745
7747
  return n;
7746
- const a = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn, s = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n, g = Math.floor((Ba(a - 1n) - 1) / 64) + 1, d = g * 8, C = d, l = C * 2, o = C * 12, y = Math.floor((Ba(s - 1n) - 1) / 64) + 1, E = y * 8, m = E, x = t.alloc(Mt.bigInt2BytesLE(s, m)), O = Ps(t, a, "f1m", "intq");
7747
- ks(t, s, "fr", "frm", "intr");
7748
- const L = t.alloc(Mt.bigInt2BytesLE(F(4n), C)), I = wa(t, "g1m", "f1m", L);
7749
- Cn(t, "frm", "frm", "frm", "frm_mul"), qs(t, "pol", "frm"), Ds(t, "qap", "frm");
7750
- const v = Ea(t, "f1m_neg", "f2m", "f1m"), U = t.alloc([
7748
+ const a = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn, s = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n, g = Math.floor((va(a - 1n) - 1) / 64) + 1, d = g * 8, C = d, l = C * 2, o = C * 12, y = Math.floor((va(s - 1n) - 1) / 64) + 1, E = y * 8, m = E, x = t.alloc(Mt.bigInt2BytesLE(s, m)), O = ks(t, a, "f1m", "intq");
7749
+ Ts(t, s, "fr", "frm", "intr");
7750
+ const L = t.alloc(Mt.bigInt2BytesLE(F(4n), C)), I = Ba(t, "g1m", "f1m", L);
7751
+ An(t, "frm", "frm", "frm", "frm_mul"), Ds(t, "pol", "frm"), Ms(t, "qap", "frm");
7752
+ const v = wa(t, "f1m_neg", "f2m", "f1m"), U = t.alloc([
7751
7753
  ...Mt.bigInt2BytesLE(F(4n), C),
7752
7754
  ...Mt.bigInt2BytesLE(F(4n), C)
7753
- ]), w = wa(t, "g2m", "f2m", U);
7755
+ ]), w = Ba(t, "g2m", "f2m", U);
7754
7756
  function S(f, _) {
7755
7757
  const Z = t.addFunction(f);
7756
7758
  Z.addParam("pG", "i32"), Z.addParam("pFr", "i32"), Z.addParam("pr", "i32");
@@ -7766,7 +7768,7 @@ var Rs = function(t, e) {
7766
7768
  )
7767
7769
  ), t.exportFunction(f);
7768
7770
  }
7769
- S("g1m_timesFr", "g1m_timesScalar"), Cn(t, "g1m", "g1m", "frm", "g1m_timesFr"), S("g2m_timesFr", "g2m_timesScalar"), Cn(t, "g2m", "g2m", "frm", "g2m_timesFr"), S("g1m_timesFrAffine", "g1m_timesScalarAffine"), S("g2m_timesFrAffine", "g2m_timesScalarAffine"), ze(t, "frm_batchApplyKey", "fmr", "frm", E, E, E, "frm_mul"), ze(t, "g1m_batchApplyKey", "g1m", "frm", d * 3, d * 3, E, "g1m_timesFr"), ze(t, "g1m_batchApplyKeyMixed", "g1m", "frm", d * 2, d * 3, E, "g1m_timesFrAffine"), ze(t, "g2m_batchApplyKey", "g2m", "frm", d * 2 * 3, d * 3 * 2, E, "g2m_timesFr"), ze(t, "g2m_batchApplyKeyMixed", "g2m", "frm", d * 2 * 2, d * 3 * 2, E, "g2m_timesFrAffine");
7771
+ S("g1m_timesFr", "g1m_timesScalar"), An(t, "g1m", "g1m", "frm", "g1m_timesFr"), S("g2m_timesFr", "g2m_timesScalar"), An(t, "g2m", "g2m", "frm", "g2m_timesFr"), S("g1m_timesFrAffine", "g1m_timesScalarAffine"), S("g2m_timesFrAffine", "g2m_timesScalarAffine"), ze(t, "frm_batchApplyKey", "fmr", "frm", E, E, E, "frm_mul"), ze(t, "g1m_batchApplyKey", "g1m", "frm", d * 3, d * 3, E, "g1m_timesFr"), ze(t, "g1m_batchApplyKeyMixed", "g1m", "frm", d * 2, d * 3, E, "g1m_timesFrAffine"), ze(t, "g2m_batchApplyKey", "g2m", "frm", d * 2 * 3, d * 3 * 2, E, "g2m_timesFr"), ze(t, "g2m_batchApplyKeyMixed", "g2m", "frm", d * 2 * 2, d * 3 * 2, E, "g2m_timesFrAffine");
7770
7772
  function F(f) {
7771
7773
  return BigInt(f) * (1n << BigInt(C * 8)) % a;
7772
7774
  }
@@ -7862,7 +7864,7 @@ var Rs = function(t, e) {
7862
7864
  );
7863
7865
  }
7864
7866
  nt();
7865
- const J = Ts(t, v + "_mulNR", "f6m", "f2m");
7867
+ const J = qs(t, v + "_mulNR", "f6m", "f2m");
7866
7868
  function ft() {
7867
7869
  const f = t.addFunction(J + "_mulNR");
7868
7870
  f.addParam("x", "i32"), f.addParam("pr", "i32");
@@ -7891,7 +7893,7 @@ var Rs = function(t, e) {
7891
7893
  );
7892
7894
  }
7893
7895
  ft();
7894
- const at = Ea(t, J + "_mulNR", "ftm", J), zt = At(0xd201000000010000n), G = t.alloc(zt), K = 3 * l, P = zt.length - 1, q = zt.reduce((f, _) => f + (_ != 0 ? 1 : 0), 0) + P + 1, u = 3 * 2 * d, W = 3 * d * 2 + q * K, z = !0, b = 15132376222941642752n;
7896
+ const at = wa(t, J + "_mulNR", "ftm", J), zt = At(0xd201000000010000n), G = t.alloc(zt), K = 3 * l, P = zt.length - 1, q = zt.reduce((f, _) => f + (_ != 0 ? 1 : 0), 0) + P + 1, u = 3 * 2 * d, W = 3 * d * 2 + q * K, z = !0, b = 15132376222941642752n;
7895
7897
  t.modules[n] = {
7896
7898
  n64q: g,
7897
7899
  n64r: y,
@@ -7915,7 +7917,7 @@ var Rs = function(t, e) {
7915
7917
  let _ = f;
7916
7918
  const Z = [];
7917
7919
  for (; _ > 0n; ) {
7918
- if (va(_)) {
7920
+ if (xa(_)) {
7919
7921
  const Q = 2 - Number(_ % 4n);
7920
7922
  Z.push(Q), _ = _ - BigInt(Q);
7921
7923
  } else
@@ -7928,7 +7930,7 @@ var Rs = function(t, e) {
7928
7930
  let _ = f;
7929
7931
  const Z = [];
7930
7932
  for (; _ > 0n; )
7931
- va(_) ? Z.push(1) : Z.push(0), _ = _ >> 1n;
7933
+ xa(_) ? Z.push(1) : Z.push(0), _ = _ >> 1n;
7932
7934
  return Z;
7933
7935
  }
7934
7936
  function Lt() {
@@ -8321,7 +8323,7 @@ var Rs = function(t, e) {
8321
8323
  (st * ot - rt * gt) % a,
8322
8324
  (st * gt + rt * ot) % a
8323
8325
  ];
8324
- return Ms(Bt[0]) && (Bt[0] = Bt[0] + a), Bt;
8326
+ return Rs(Bt[0]) && (Bt[0] = Bt[0] + a), Bt;
8325
8327
  }
8326
8328
  }
8327
8329
  function Jt() {
@@ -8552,7 +8554,7 @@ var Rs = function(t, e) {
8552
8554
  ])), V = _.i32_const(t.alloc(Mt.bigInt2BytesLE(F(Q), d))), ct = _.i32_const(t.alloc([
8553
8555
  ...Mt.bigInt2BytesLE(F($[0]), d),
8554
8556
  ...Mt.bigInt2BytesLE(F($[1]), d)
8555
- ])), st = _.i32_const(t.alloc(Mt.bigInt2BytesLE(b, 8))), rt = _.getLocal("p"), ot = _.i32_add(_.getLocal("p"), _.i32_const(l)), gt = _.i32_const(t.alloc(C)), Bt = _.i32_const(t.alloc(l)), Ft = _.i32_const(t.alloc(l)), ht = t.alloc(l * 2), xt = _.i32_const(ht), Tt = _.i32_const(ht), Ut = _.i32_const(ht), St = _.i32_const(ht + C), kt = _.i32_const(ht + l), k = _.i32_const(ht + l), et = _.i32_const(ht + l + C), dt = t.alloc(l * 3), qt = _.i32_const(dt), Ht = _.i32_const(dt), Qt = _.i32_const(dt), Kt = _.i32_const(dt + C), fe = _.i32_const(dt + l), Ce = _.i32_const(dt + l), qe = _.i32_const(dt + l + C), gn = _.i32_const(dt + l * 2);
8557
+ ])), st = _.i32_const(t.alloc(Mt.bigInt2BytesLE(b, 8))), rt = _.getLocal("p"), ot = _.i32_add(_.getLocal("p"), _.i32_const(l)), gt = _.i32_const(t.alloc(C)), Bt = _.i32_const(t.alloc(l)), Ft = _.i32_const(t.alloc(l)), ht = t.alloc(l * 2), xt = _.i32_const(ht), Tt = _.i32_const(ht), Ut = _.i32_const(ht), St = _.i32_const(ht + C), kt = _.i32_const(ht + l), k = _.i32_const(ht + l), et = _.i32_const(ht + l + C), dt = t.alloc(l * 3), qt = _.i32_const(dt), Ht = _.i32_const(dt), Qt = _.i32_const(dt), Kt = _.i32_const(dt + C), fe = _.i32_const(dt + l), Ce = _.i32_const(dt + l), qe = _.i32_const(dt + l + C), pn = _.i32_const(dt + l * 2);
8556
8558
  f.addCode(
8557
8559
  _.if(
8558
8560
  _.call(w + "_isZeroAffine", _.getLocal("p")),
@@ -8580,7 +8582,7 @@ var Rs = function(t, e) {
8580
8582
  _.call(O + "_sub", qe, Ce, gt),
8581
8583
  _.call(O + "_add", Ce, qe, qe),
8582
8584
  _.call(O + "_copy", gt, Ce),
8583
- _.call(v + "_one", gn),
8585
+ _.call(v + "_one", pn),
8584
8586
  _.call(w + "_timesScalar", qt, st, _.i32_const(8), qt),
8585
8587
  _.call(w + "_addMixed", qt, xt, qt),
8586
8588
  _.ret(
@@ -8638,47 +8640,47 @@ var Rs = function(t, e) {
8638
8640
  for (let f = 1; f <= 5; f++)
8639
8641
  vt(f), t.exportFunction(n + "_pairingEq" + f);
8640
8642
  Wt(), t.exportFunction(n + "_pairing"), t.exportFunction(n + "_prepareG1"), t.exportFunction(n + "_prepareG2"), t.exportFunction(n + "_millerLoop"), t.exportFunction(n + "_finalExponentiation"), t.exportFunction(n + "_finalExponentiationOld"), t.exportFunction(n + "__cyclotomicSquare"), t.exportFunction(n + "__cyclotomicExp_w0"), t.exportFunction(J + "_mul1"), t.exportFunction(J + "_mul01"), t.exportFunction(at + "_mul014"), t.exportFunction(I + "_inGroupAffine"), t.exportFunction(I + "_inGroup"), t.exportFunction(w + "_inGroupAffine"), t.exportFunction(w + "_inGroup");
8641
- }, Ns = Os, zs = Rs;
8642
- function Pn(c) {
8643
+ }, zs = Ps, Us = Ns;
8644
+ function kn(c) {
8643
8645
  if (typeof c == "bigint" || c.eq !== void 0)
8644
8646
  return c.toString(10);
8645
8647
  if (c instanceof Uint8Array)
8646
8648
  return Ze(c, 0);
8647
8649
  if (Array.isArray(c))
8648
- return c.map(Pn);
8650
+ return c.map(kn);
8649
8651
  if (typeof c == "object") {
8650
8652
  const t = {};
8651
8653
  return Object.keys(c).forEach((n) => {
8652
- t[n] = Pn(c[n]);
8654
+ t[n] = kn(c[n]);
8653
8655
  }), t;
8654
8656
  } else
8655
8657
  return c;
8656
8658
  }
8657
- function kn(c) {
8659
+ function Tn(c) {
8658
8660
  if (typeof c == "string" && /^[0-9]+$/.test(c))
8659
8661
  return BigInt(c);
8660
8662
  if (typeof c == "string" && /^0x[0-9a-fA-F]+$/.test(c))
8661
8663
  return BigInt(c);
8662
8664
  if (Array.isArray(c))
8663
- return c.map(kn);
8665
+ return c.map(Tn);
8664
8666
  if (typeof c == "object") {
8665
8667
  if (c === null)
8666
8668
  return null;
8667
8669
  const t = {};
8668
8670
  return Object.keys(c).forEach((n) => {
8669
- t[n] = kn(c[n]);
8671
+ t[n] = Tn(c[n]);
8670
8672
  }), t;
8671
8673
  } else
8672
8674
  return c;
8673
8675
  }
8674
- function Us(c) {
8676
+ function js(c) {
8675
8677
  let t = BigInt(0), e = c.length, n = 0;
8676
8678
  const a = new DataView(c.buffer, c.byteOffset, c.byteLength);
8677
8679
  for (; e > 0; )
8678
8680
  e >= 4 ? (e -= 4, t += BigInt(a.getUint32(e)) << BigInt(n * 8), n += 4) : e >= 2 ? (e -= 2, t += BigInt(a.getUint16(e)) << BigInt(n * 8), n += 2) : (e -= 1, t += BigInt(a.getUint8(e)) << BigInt(n * 8), n += 1);
8679
8681
  return t;
8680
8682
  }
8681
- function js(c, t) {
8683
+ function $s(c, t) {
8682
8684
  let e = c;
8683
8685
  const n = new Uint8Array(t), a = new DataView(n.buffer);
8684
8686
  let s = t;
@@ -8688,14 +8690,14 @@ function js(c, t) {
8688
8690
  throw new Error("Number does not fit in this length");
8689
8691
  return n;
8690
8692
  }
8691
- function $s(c) {
8693
+ function Gs(c) {
8692
8694
  let t = BigInt(0), e = 0;
8693
8695
  const n = new DataView(c.buffer, c.byteOffset, c.byteLength);
8694
8696
  for (; e < c.length; )
8695
8697
  e + 4 <= c.length ? (t += BigInt(n.getUint32(e, !0)) << BigInt(e * 8), e += 4) : e + 2 <= c.length ? (t += BigInt(n.getUint16(e, !0)) << BigInt(e * 8), e += 2) : (t += BigInt(n.getUint8(e, !0)) << BigInt(e * 8), e += 1);
8696
8698
  return t;
8697
8699
  }
8698
- function Oi(c, t) {
8700
+ function ki(c, t) {
8699
8701
  let e = c;
8700
8702
  typeof t > "u" && (t = Math.floor((Ve(c) - 1) / 8) + 1, t == 0 && (t = 1));
8701
8703
  const n = new Uint8Array(t), a = new DataView(n.buffer);
@@ -8706,66 +8708,66 @@ function Oi(c, t) {
8706
8708
  throw new Error("Number does not fit in this length");
8707
8709
  return n;
8708
8710
  }
8709
- function Tn(c, t) {
8711
+ function qn(c, t) {
8710
8712
  if (typeof t == "bigint" || t.eq !== void 0)
8711
8713
  return t.toString(10);
8712
8714
  if (t instanceof Uint8Array)
8713
8715
  return c.toString(c.e(t));
8714
8716
  if (Array.isArray(t))
8715
- return t.map(Tn.bind(this, c));
8717
+ return t.map(qn.bind(this, c));
8716
8718
  if (typeof t == "object") {
8717
8719
  const e = {};
8718
8720
  return Object.keys(t).forEach((a) => {
8719
- e[a] = Tn(c, t[a]);
8721
+ e[a] = qn(c, t[a]);
8720
8722
  }), e;
8721
8723
  } else
8722
8724
  return t;
8723
8725
  }
8724
- function qn(c, t) {
8726
+ function Dn(c, t) {
8725
8727
  if (typeof t == "string" && /^[0-9]+$/.test(t))
8726
8728
  return c.e(t);
8727
8729
  if (typeof t == "string" && /^0x[0-9a-fA-F]+$/.test(t))
8728
8730
  return c.e(t);
8729
8731
  if (Array.isArray(t))
8730
- return t.map(qn.bind(this, c));
8732
+ return t.map(Dn.bind(this, c));
8731
8733
  if (typeof t == "object") {
8732
8734
  if (t === null)
8733
8735
  return null;
8734
8736
  const e = {};
8735
8737
  return Object.keys(t).forEach((a) => {
8736
- e[a] = qn(c, t[a]);
8738
+ e[a] = Dn(c, t[a]);
8737
8739
  }), e;
8738
8740
  } else
8739
8741
  return t;
8740
8742
  }
8741
8743
  const je = [];
8742
8744
  for (let c = 0; c < 256; c++)
8743
- je[c] = Gs(c, 8);
8744
- function Gs(c, t) {
8745
+ je[c] = Zs(c, 8);
8746
+ function Zs(c, t) {
8745
8747
  let e = 0, n = c;
8746
8748
  for (let a = 0; a < t; a++)
8747
8749
  e <<= 1, e = e | n & 1, n >>= 1;
8748
8750
  return e;
8749
8751
  }
8750
- function Pi(c, t) {
8752
+ function Ti(c, t) {
8751
8753
  return (je[c >>> 24] | je[c >>> 16 & 255] << 8 | je[c >>> 8 & 255] << 16 | je[c & 255] << 24) >>> 32 - t;
8752
8754
  }
8753
8755
  function ue(c) {
8754
8756
  return (c & 4294901760 ? (c &= 4294901760, 16) : 0) | (c & 4278255360 ? (c &= 4278255360, 8) : 0) | (c & 4042322160 ? (c &= 4042322160, 4) : 0) | (c & 3435973836 ? (c &= 3435973836, 2) : 0) | (c & 2863311530) !== 0;
8755
8757
  }
8756
- function ki(c, t) {
8758
+ function qi(c, t) {
8757
8759
  const e = c.byteLength / t, n = ue(e);
8758
8760
  if (e != 1 << n)
8759
8761
  throw new Error("Invalid number of pointers");
8760
8762
  for (let a = 0; a < e; a++) {
8761
- const s = Pi(a, n);
8763
+ const s = Ti(a, n);
8762
8764
  if (a > s) {
8763
8765
  const g = c.slice(a * t, (a + 1) * t);
8764
8766
  c.set(c.slice(s * t, (s + 1) * t), a * t), c.set(g, s * t);
8765
8767
  }
8766
8768
  }
8767
8769
  }
8768
- function Jn(c, t) {
8770
+ function Kn(c, t) {
8769
8771
  const e = new Uint8Array(t * c.length);
8770
8772
  for (let n = 0; n < c.length; n++)
8771
8773
  e.set(c[n], n * t);
@@ -8777,21 +8779,21 @@ function on(c, t) {
8777
8779
  n[a] = c.slice(a * t, a * t + t);
8778
8780
  return n;
8779
8781
  }
8780
- const Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8782
+ const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8781
8783
  __proto__: null,
8782
- array2buffer: Jn,
8783
- beBuff2int: Us,
8784
- beInt2Buff: js,
8785
- bitReverse: Pi,
8786
- buffReverseBits: ki,
8784
+ array2buffer: Kn,
8785
+ beBuff2int: js,
8786
+ beInt2Buff: $s,
8787
+ bitReverse: Ti,
8788
+ buffReverseBits: qi,
8787
8789
  buffer2array: on,
8788
- leBuff2int: $s,
8789
- leInt2Buff: Oi,
8790
+ leBuff2int: Gs,
8791
+ leInt2Buff: ki,
8790
8792
  log2: ue,
8791
- stringifyBigInts: Pn,
8792
- stringifyFElements: Tn,
8793
- unstringifyBigInts: kn,
8794
- unstringifyFElements: qn
8793
+ stringifyBigInts: kn,
8794
+ stringifyFElements: qn,
8795
+ unstringifyBigInts: Tn,
8796
+ unstringifyFElements: Dn
8795
8797
  }, Symbol.toStringTag, { value: "Module" })), se = 1 << 30;
8796
8798
  class Vt {
8797
8799
  constructor(t) {
@@ -8863,7 +8865,7 @@ function be(c, t, e, n) {
8863
8865
  return o;
8864
8866
  };
8865
8867
  }
8866
- class xa {
8868
+ class Sa {
8867
8869
  constructor(t, e, n, a) {
8868
8870
  if (this.tm = t, this.prefix = e, this.p = a, this.n8 = n, this.type = "F1", this.m = 1, this.half = Ie(a, we), this.bitLength = Ve(a), this.mask = Le(nn(we, this.bitLength), we), this.pOp1 = t.alloc(n), this.pOp2 = t.alloc(n), this.pOp3 = t.alloc(n), this.tm.instance.exports[e + "_zero"](this.pOp1), this.zero = this.tm.getBuff(this.pOp1, this.n8), this.tm.instance.exports[e + "_one"](this.pOp1), this.one = this.tm.getBuff(this.pOp1, this.n8), this.negone = this.neg(this.one), this.two = this.add(this.one, this.one), this.n64 = Math.floor(n / 8), this.n32 = Math.floor(n / 4), this.n64 * 8 != this.n8)
8869
8871
  throw new Error("n8 must be a multiple of 8");
@@ -8873,7 +8875,7 @@ class xa {
8873
8875
  this.nqr = this.add(this.nqr, this.one), s = this.exp(this.nqr, this.half);
8874
8876
  this.shift = this.mul(this.nqr, this.nqr), this.shiftInv = this.inv(this.shift), this.s = 0;
8875
8877
  let g = Le(this.p, we);
8876
- for (; !jn(g); )
8878
+ for (; !$n(g); )
8877
8879
  this.s = this.s + 1, g = Ie(g, we);
8878
8880
  this.w = [], this.w[this.s] = this.exp(this.nqr, g);
8879
8881
  for (let d = this.s - 1; d >= 0; d--)
@@ -8943,27 +8945,27 @@ class xa {
8943
8945
  if (t instanceof Uint8Array)
8944
8946
  return t;
8945
8947
  let n = ee(t, e);
8946
- oi(n) ? (n = li(n), On(n, this.p) && (n = ge(n, this.p)), n = Le(this.p, n)) : On(n, this.p) && (n = ge(n, this.p));
8947
- const a = Oi(n, this.n8);
8948
+ si(n) ? (n = di(n), Pn(n, this.p) && (n = ge(n, this.p)), n = Le(this.p, n)) : Pn(n, this.p) && (n = ge(n, this.p));
8949
+ const a = ki(n, this.n8);
8948
8950
  return this.toMontgomery(a);
8949
8951
  }
8950
8952
  toString(t, e) {
8951
8953
  const n = this.fromMontgomery(t), a = Ze(n, 0);
8952
- return gi(a, e);
8954
+ return hi(a, e);
8953
8955
  }
8954
8956
  fromRng(t) {
8955
8957
  let e;
8956
8958
  const n = new Uint8Array(this.n8);
8957
8959
  do {
8958
- e = pi;
8960
+ e = Li;
8959
8961
  for (let a = 0; a < this.n64; a++)
8960
- e = $n(e, nn(t.nextU64(), 64 * a));
8961
- e = Gn(e, this.mask);
8962
- } while (di(e, this.p));
8962
+ e = Gn(e, nn(t.nextU64(), 64 * a));
8963
+ e = Zn(e, this.mask);
8964
+ } while (_i(e, this.p));
8963
8965
  return Ge(n, 0, e, this.n8), n;
8964
8966
  }
8965
8967
  random() {
8966
- return this.fromRng(Zn());
8968
+ return this.fromRng(Wn());
8967
8969
  }
8968
8970
  toObject(t) {
8969
8971
  const e = this.fromMontgomery(t);
@@ -8992,7 +8994,7 @@ class xa {
8992
8994
  async batchInverse(t) {
8993
8995
  let e = !1;
8994
8996
  const n = this.n8, a = this.n8;
8995
- Array.isArray(t) ? (t = Jn(t, n), e = !0) : t = t.slice(0, t.byteLength);
8997
+ Array.isArray(t) ? (t = Kn(t, n), e = !0) : t = t.slice(0, t.byteLength);
8996
8998
  const s = Math.floor(t.byteLength / n);
8997
8999
  if (s * n !== t.byteLength)
8998
9000
  throw new Error("Invalid buffer size");
@@ -9026,7 +9028,7 @@ class xa {
9026
9028
  return e ? on(l, a) : l;
9027
9029
  }
9028
9030
  }
9029
- class Sa {
9031
+ class Ia {
9030
9032
  constructor(t, e, n) {
9031
9033
  this.tm = t, this.prefix = e, this.F = n, this.type = "F2", this.m = n.m * 2, this.n8 = this.F.n8 * 2, this.n32 = this.F.n32 * 2, this.n64 = this.F.n64 * 2, this.pOp1 = t.alloc(n.n8 * 2), this.pOp2 = t.alloc(n.n8 * 2), this.pOp3 = t.alloc(n.n8 * 2), this.tm.instance.exports[e + "_zero"](this.pOp1), this.zero = t.getBuff(this.pOp1, this.n8), this.tm.instance.exports[e + "_one"](this.pOp1), this.one = t.getBuff(this.pOp1, this.n8), this.negone = this.neg(this.one), this.two = this.add(this.one, this.one);
9032
9034
  }
@@ -9108,7 +9110,7 @@ class Sa {
9108
9110
  return a.set(e), a.set(n, this.F.n8), a;
9109
9111
  }
9110
9112
  random() {
9111
- return this.fromRng(Zn());
9113
+ return this.fromRng(Wn());
9112
9114
  }
9113
9115
  toObject(t) {
9114
9116
  const e = this.F.toObject(t.slice(0, this.F.n8)), n = this.F.toObject(t.slice(this.F.n8, this.F.n8 * 2));
@@ -9125,7 +9127,7 @@ class Sa {
9125
9127
  return t.slice(this.F.n8);
9126
9128
  }
9127
9129
  }
9128
- class Ws {
9130
+ class Xs {
9129
9131
  constructor(t, e, n) {
9130
9132
  this.tm = t, this.prefix = e, this.F = n, this.type = "F3", this.m = n.m * 3, this.n8 = this.F.n8 * 3, this.n32 = this.F.n32 * 3, this.n64 = this.F.n64 * 3, this.pOp1 = t.alloc(n.n8 * 3), this.pOp2 = t.alloc(n.n8 * 3), this.pOp3 = t.alloc(n.n8 * 3), this.tm.instance.exports[e + "_zero"](this.pOp1), this.zero = t.getBuff(this.pOp1, this.n8), this.tm.instance.exports[e + "_one"](this.pOp1), this.one = t.getBuff(this.pOp1, this.n8), this.negone = this.neg(this.one), this.two = this.add(this.one, this.one);
9131
9133
  }
@@ -9204,7 +9206,7 @@ class Ws {
9204
9206
  return s.set(e), s.set(n, this.F.n8), s.set(a, this.F.n8 * 2), s;
9205
9207
  }
9206
9208
  random() {
9207
- return this.fromRng(Zn());
9209
+ return this.fromRng(Wn());
9208
9210
  }
9209
9211
  toObject(t) {
9210
9212
  const e = this.F.toObject(t.slice(0, this.F.n8)), n = this.F.toObject(t.slice(this.F.n8, this.F.n8 * 2)), a = this.F.toObject(t.slice(this.F.n8 * 2, this.F.n8 * 3));
@@ -9224,7 +9226,7 @@ class Ws {
9224
9226
  return t.slice(this.F.n8 * 2);
9225
9227
  }
9226
9228
  }
9227
- class Ia {
9229
+ class Oa {
9228
9230
  constructor(t, e, n, a, s, g) {
9229
9231
  this.tm = t, this.prefix = e, this.F = n, this.pOp1 = t.alloc(n.n8 * 3), this.pOp2 = t.alloc(n.n8 * 3), this.pOp3 = t.alloc(n.n8 * 3), this.tm.instance.exports[e + "_zero"](this.pOp1), this.zero = this.tm.getBuff(this.pOp1, n.n8 * 3), this.tm.instance.exports[e + "_zeroAffine"](this.pOp1), this.zeroAffine = this.tm.getBuff(this.pOp1, n.n8 * 2), this.one = this.tm.getBuff(a, n.n8 * 3), this.g = this.one, this.oneAffine = this.tm.getBuff(a, n.n8 * 2), this.gAffine = this.oneAffine, this.b = this.tm.getBuff(s, n.n8), g && (this.cofactor = Pe(g)), this.negone = this.neg(this.one), this.two = this.add(this.one, this.one), this.batchLEMtoC = be(t, e + "_batchLEMtoC", n.n8 * 2, n.n8), this.batchLEMtoU = be(t, e + "_batchLEMtoU", n.n8 * 2, n.n8 * 2), this.batchCtoLEM = be(t, e + "_batchCtoLEM", n.n8, n.n8 * 2), this.batchUtoLEM = be(t, e + "_batchUtoLEM", n.n8 * 2, n.n8 * 2), this.batchToJacobian = be(t, e + "_batchToJacobian", n.n8 * 2, n.n8 * 3), this.batchToAffine = be(t, e + "_batchToAffine", n.n8 * 3, n.n8 * 2);
9230
9232
  }
@@ -9453,7 +9455,7 @@ class Ia {
9453
9455
  return this.toAffine(t).slice(this.F.n8);
9454
9456
  }
9455
9457
  }
9456
- function Ti(c) {
9458
+ function Di(c) {
9457
9459
  let e, n;
9458
9460
  c && (c.onmessage = function(o) {
9459
9461
  let y;
@@ -9582,33 +9584,33 @@ ie.EOL = `
9582
9584
  ie.homedir = function() {
9583
9585
  return "/";
9584
9586
  };
9585
- const Xs = Worker, An = 25;
9586
- class Oa {
9587
+ const Vs = Worker, Fn = 25;
9588
+ class Pa {
9587
9589
  constructor() {
9588
9590
  this.promise = new Promise((t, e) => {
9589
9591
  this.reject = e, this.resolve = t;
9590
9592
  });
9591
9593
  }
9592
9594
  }
9593
- function Vs(c) {
9595
+ function Hs(c) {
9594
9596
  return new Promise((t) => setTimeout(t, c));
9595
9597
  }
9596
- function Hs(c) {
9597
- return Se.browser ? globalThis.btoa(c) : Lo.from(c).toString("base64");
9598
+ function Qs(c) {
9599
+ return Se.browser ? globalThis.btoa(c) : mo.from(c).toString("base64");
9598
9600
  }
9599
- const Qs = Hs("(" + Ti.toString() + ")(self)"), Js = "data:application/javascript;base64," + Qs;
9600
- async function Ks(c, t) {
9601
- const e = new Ys();
9602
- e.memory = new WebAssembly.Memory({ initial: An }), e.u8 = new Uint8Array(e.memory.buffer), e.u32 = new Uint32Array(e.memory.buffer);
9601
+ const Js = Qs("(" + Di.toString() + ")(self)"), Ks = "data:application/javascript;base64," + Js;
9602
+ async function Ys(c, t) {
9603
+ const e = new tr();
9604
+ e.memory = new WebAssembly.Memory({ initial: Fn }), e.u8 = new Uint8Array(e.memory.buffer), e.u32 = new Uint32Array(e.memory.buffer);
9603
9605
  const n = await WebAssembly.compile(c.code);
9604
9606
  if (e.instance = await WebAssembly.instantiate(n, {
9605
9607
  env: {
9606
9608
  memory: e.memory
9607
9609
  }
9608
9610
  }), e.singleThread = t, e.initalPFree = e.u32[0], e.pq = c.pq, e.pr = c.pr, e.pG1gen = c.pG1gen, e.pG1zero = c.pG1zero, e.pG2gen = c.pG2gen, e.pG2zero = c.pG2zero, e.pOneT = c.pOneT, t)
9609
- e.code = c.code, e.taskManager = Ti(), await e.taskManager([{
9611
+ e.code = c.code, e.taskManager = Di(), await e.taskManager([{
9610
9612
  cmd: "INIT",
9611
- init: An,
9613
+ init: Fn,
9612
9614
  code: e.code.slice()
9613
9615
  }]), e.concurrency = 1;
9614
9616
  else {
@@ -9616,13 +9618,13 @@ async function Ks(c, t) {
9616
9618
  let s;
9617
9619
  typeof navigator == "object" && navigator.hardwareConcurrency ? s = navigator.hardwareConcurrency : s = ie.cpus().length, s == 0 && (s = 2), s > 64 && (s = 64), e.concurrency = s;
9618
9620
  for (let d = 0; d < s; d++)
9619
- e.workers[d] = new Xs(Js), e.workers[d].addEventListener("message", a(d)), e.working[d] = !1;
9621
+ e.workers[d] = new Vs(Ks), e.workers[d].addEventListener("message", a(d)), e.working[d] = !1;
9620
9622
  const g = [];
9621
9623
  for (let d = 0; d < e.workers.length; d++) {
9622
9624
  const C = c.code.slice();
9623
9625
  g.push(e.postAction(d, [{
9624
9626
  cmd: "INIT",
9625
- init: An,
9627
+ init: Fn,
9626
9628
  code: C
9627
9629
  }], [C.buffer]));
9628
9630
  }
@@ -9636,7 +9638,7 @@ async function Ks(c, t) {
9636
9638
  };
9637
9639
  }
9638
9640
  }
9639
- class Ys {
9641
+ class tr {
9640
9642
  constructor() {
9641
9643
  this.actionQueue = [], this.oldPFree = 0;
9642
9644
  }
@@ -9653,7 +9655,7 @@ class Ys {
9653
9655
  postAction(t, e, n, a) {
9654
9656
  if (this.working[t])
9655
9657
  throw new Error("Posting a job t a working worker");
9656
- return this.working[t] = !0, this.pendingDeferreds[t] = a || new Oa(), this.workers[t].postMessage(e, n), this.pendingDeferreds[t].promise;
9658
+ return this.working[t] = !0, this.pendingDeferreds[t] = a || new Pa(), this.workers[t].postMessage(e, n), this.pendingDeferreds[t].promise;
9657
9659
  }
9658
9660
  processWorks() {
9659
9661
  for (let t = 0; t < this.workers.length && this.actionQueue.length > 0; t++)
@@ -9663,7 +9665,7 @@ class Ys {
9663
9665
  }
9664
9666
  }
9665
9667
  queueAction(t, e) {
9666
- const n = new Oa();
9668
+ const n = new Pa();
9667
9669
  if (this.singleThread) {
9668
9670
  const a = this.taskManager(t);
9669
9671
  n.resolve(a);
@@ -9697,10 +9699,10 @@ class Ys {
9697
9699
  async terminate() {
9698
9700
  for (let t = 0; t < this.workers.length; t++)
9699
9701
  this.workers[t].postMessage([{ cmd: "TERMINATE" }]);
9700
- await Vs(200);
9702
+ await Hs(200);
9701
9703
  }
9702
9704
  }
9703
- function Fn(c, t) {
9705
+ function En(c, t) {
9704
9706
  const e = c[t], n = c.Fr, a = c.tm;
9705
9707
  c[t].batchApplyKey = async function(s, g, d, C, l) {
9706
9708
  C = C || "affine", l = l || "affine";
@@ -9754,7 +9756,7 @@ function Fn(c, t) {
9754
9756
  return w;
9755
9757
  };
9756
9758
  }
9757
- function tr(c) {
9759
+ function er(c) {
9758
9760
  const t = c.tm;
9759
9761
  c.pairing = function(n, a) {
9760
9762
  t.startSyncOp();
@@ -9821,7 +9823,7 @@ function tr(c) {
9821
9823
  return this.tm.endSyncOp(), s;
9822
9824
  };
9823
9825
  }
9824
- const Pa = [
9826
+ const ka = [
9825
9827
  1,
9826
9828
  1,
9827
9829
  1,
@@ -9855,7 +9857,7 @@ const Pa = [
9855
9857
  17,
9856
9858
  17
9857
9859
  ];
9858
- function ka(c, t) {
9860
+ function Ta(c, t) {
9859
9861
  const e = c[t], n = e.tm;
9860
9862
  async function a(g, d, C, l, o) {
9861
9863
  if (!(g instanceof Uint8Array))
@@ -9876,7 +9878,7 @@ function ka(c, t) {
9876
9878
  const x = Math.floor(d.byteLength / m);
9877
9879
  if (x * m != d.byteLength)
9878
9880
  throw new Error("Scalar size does not match");
9879
- const O = Pa[ue(m)], L = Math.floor((x * 8 - 1) / O) + 1, I = [];
9881
+ const O = ka[ue(m)], L = Math.floor((x * 8 - 1) / O) + 1, I = [];
9880
9882
  for (let w = 0; w < L; w++) {
9881
9883
  const S = [
9882
9884
  { cmd: "ALLOCSET", var: 0, buff: g },
@@ -9918,7 +9920,7 @@ function ka(c, t) {
9918
9920
  const x = Math.floor(g.byteLength / m), O = Math.floor(d.byteLength / x);
9919
9921
  if (O * x != d.byteLength)
9920
9922
  throw new Error("Scalar size does not match");
9921
- const L = Pa[ue(x)], I = Math.floor((O * 8 - 1) / L) + 1;
9923
+ const L = ka[ue(x)], I = Math.floor((O * 8 - 1) / L) + 1;
9922
9924
  let v;
9923
9925
  v = Math.floor(x / (n.concurrency / I)), v > 4194304 && (v = 4194304), v < 1024 && (v = 1024);
9924
9926
  const U = [];
@@ -9939,7 +9941,7 @@ function ka(c, t) {
9939
9941
  return await s(d, C, "affine", l, o);
9940
9942
  };
9941
9943
  }
9942
- function En(c, t) {
9944
+ function wn(c, t) {
9943
9945
  const e = c[t], n = c.Fr, a = e.tm;
9944
9946
  async function s(l, o, y, E, m, x) {
9945
9947
  y = y || "affine", E = E || "affine";
@@ -9947,7 +9949,7 @@ function En(c, t) {
9947
9949
  let L, I, v, U, w, S, F, r;
9948
9950
  t == "G1" ? (y == "affine" ? (L = e.F.n8 * 2, U = "g1m_batchToJacobian") : L = e.F.n8 * 3, I = e.F.n8 * 3, o && (r = "g1m_fftFinal"), F = "g1m_fftJoin", S = "g1m_fftMix", E == "affine" ? (v = e.F.n8 * 2, w = "g1m_batchToAffine") : v = e.F.n8 * 3) : t == "G2" ? (y == "affine" ? (L = e.F.n8 * 2, U = "g2m_batchToJacobian") : L = e.F.n8 * 3, I = e.F.n8 * 3, o && (r = "g2m_fftFinal"), F = "g2m_fftJoin", S = "g2m_fftMix", E == "affine" ? (v = e.F.n8 * 2, w = "g2m_batchToAffine") : v = e.F.n8 * 3) : t == "Fr" && (L = e.n8, I = e.n8, v = e.n8, o && (r = "frm_fftFinal"), S = "frm_fftMix", F = "frm_fftJoin");
9949
9951
  let h = !1;
9950
- Array.isArray(l) ? (l = Jn(l, L), h = !0) : l = l.slice(0, l.byteLength);
9952
+ Array.isArray(l) ? (l = Kn(l, L), h = !0) : l = l.slice(0, l.byteLength);
9951
9953
  const R = l.byteLength / L, j = ue(R);
9952
9954
  if (1 << j != R)
9953
9955
  throw new Error("fft must be multiple of 2");
@@ -9958,7 +9960,7 @@ function En(c, t) {
9958
9960
  let T;
9959
9961
  o && (T = n.inv(n.e(R)));
9960
9962
  let D;
9961
- ki(l, L);
9963
+ qi(l, L);
9962
9964
  let A, M = Math.min(1 << O, R), H = R / M;
9963
9965
  for (; H < a.concurrency && M >= 16; )
9964
9966
  H *= 2, M /= 2;
@@ -10241,9 +10243,9 @@ function En(c, t) {
10241
10243
  return w;
10242
10244
  };
10243
10245
  }
10244
- async function qi(c) {
10245
- const t = await Ks(c.wasm, c.singleThread), e = {};
10246
- return e.q = ee(c.wasm.q.toString()), e.r = ee(c.wasm.r.toString()), e.name = c.name, e.tm = t, e.prePSize = c.wasm.prePSize, e.preQSize = c.wasm.preQSize, e.Fr = new xa(t, "frm", c.n8r, c.r), e.F1 = new xa(t, "f1m", c.n8q, c.q), e.F2 = new Sa(t, "f2m", e.F1), e.G1 = new Ia(t, "g1m", e.F1, c.wasm.pG1gen, c.wasm.pG1b, c.cofactorG1), e.G2 = new Ia(t, "g2m", e.F2, c.wasm.pG2gen, c.wasm.pG2b, c.cofactorG2), e.F6 = new Ws(t, "f6m", e.F2), e.F12 = new Sa(t, "ftm", e.F6), e.Gt = e.F12, Fn(e, "G1"), Fn(e, "G2"), Fn(e, "Fr"), ka(e, "G1"), ka(e, "G2"), En(e, "G1"), En(e, "G2"), En(e, "Fr"), tr(e), e.array2buffer = function(n, a) {
10246
+ async function Mi(c) {
10247
+ const t = await Ys(c.wasm, c.singleThread), e = {};
10248
+ return e.q = ee(c.wasm.q.toString()), e.r = ee(c.wasm.r.toString()), e.name = c.name, e.tm = t, e.prePSize = c.wasm.prePSize, e.preQSize = c.wasm.preQSize, e.Fr = new Sa(t, "frm", c.n8r, c.r), e.F1 = new Sa(t, "f1m", c.n8q, c.q), e.F2 = new Ia(t, "f2m", e.F1), e.G1 = new Oa(t, "g1m", e.F1, c.wasm.pG1gen, c.wasm.pG1b, c.cofactorG1), e.G2 = new Oa(t, "g2m", e.F2, c.wasm.pG2gen, c.wasm.pG2b, c.cofactorG2), e.F6 = new Xs(t, "f6m", e.F2), e.F12 = new Ia(t, "ftm", e.F6), e.Gt = e.F12, En(e, "G1"), En(e, "G2"), En(e, "Fr"), Ta(e, "G1"), Ta(e, "G2"), wn(e, "G1"), wn(e, "G2"), wn(e, "Fr"), er(e), e.array2buffer = function(n, a) {
10247
10249
  const s = new Uint8Array(a * n.length);
10248
10250
  for (let g = 0; g < n.length; g++)
10249
10251
  s.set(n[g], g * a);
@@ -10258,20 +10260,20 @@ async function qi(c) {
10258
10260
  function Te(c) {
10259
10261
  return BigInt(c);
10260
10262
  }
10261
- function Di(c) {
10263
+ function Ri(c) {
10262
10264
  return c < 0n;
10263
10265
  }
10264
- function er(c) {
10266
+ function nr(c) {
10265
10267
  return c === 0n;
10266
10268
  }
10267
- function nr(c) {
10268
- return Di(c) ? c.toString(2).length - 1 : c.toString(2).length;
10269
+ function ar(c) {
10270
+ return Ri(c) ? c.toString(2).length - 1 : c.toString(2).length;
10269
10271
  }
10270
- function wn(c) {
10272
+ function Bn(c) {
10271
10273
  const t = [], e = Te(c);
10272
10274
  return t.push(Number(e & 0xFFn)), t.push(Number(e >> 8n & 0xFFn)), t.push(Number(e >> 16n & 0xFFn)), t.push(Number(e >> 24n & 0xFFn)), t;
10273
10275
  }
10274
- function ar(c) {
10276
+ function ir(c) {
10275
10277
  for (var t = [], e = 0; e < c.length; e++) {
10276
10278
  var n = c.charCodeAt(e);
10277
10279
  n < 128 ? t.push(n) : n < 2048 ? t.push(
@@ -10291,56 +10293,56 @@ function ar(c) {
10291
10293
  return t;
10292
10294
  }
10293
10295
  function Ue(c) {
10294
- const t = ar(c);
10296
+ const t = ir(c);
10295
10297
  return [...Rt(t.length), ...t];
10296
10298
  }
10297
- function Mi(c) {
10299
+ function Ni(c) {
10298
10300
  const t = [];
10299
10301
  let e = Te(c);
10300
- if (Di(e))
10302
+ if (Ri(e))
10301
10303
  throw new Error("Number cannot be negative");
10302
- for (; !er(e); )
10304
+ for (; !nr(e); )
10303
10305
  t.push(Number(e & 0x7Fn)), e = e >> 7n;
10304
10306
  t.length == 0 && t.push(0);
10305
10307
  for (let n = 0; n < t.length - 1; n++)
10306
10308
  t[n] = t[n] | 128;
10307
10309
  return t;
10308
10310
  }
10309
- function Ri(c) {
10311
+ function zi(c) {
10310
10312
  let t, e;
10311
- const n = nr(c);
10313
+ const n = ar(c);
10312
10314
  c < 0 ? (e = !0, t = (1n << BigInt(n)) + c) : (e = !1, t = Te(c));
10313
- const a = 7 - n % 7, s = (1n << BigInt(a)) - 1n << BigInt(n), g = (1 << 7 - a) - 1 | 128, d = Mi(t + s);
10315
+ const a = 7 - n % 7, s = (1n << BigInt(a)) - 1n << BigInt(n), g = (1 << 7 - a) - 1 | 128, d = Ni(t + s);
10314
10316
  return e || (d[d.length - 1] = d[d.length - 1] & g), d;
10315
10317
  }
10316
- function Dn(c) {
10318
+ function Mn(c) {
10317
10319
  let t = Te(c);
10318
10320
  if (t > 0xFFFFFFFFn)
10319
10321
  throw new Error("Number too big");
10320
10322
  if (t > 0x7FFFFFFFn && (t = t - 0x100000000n), t < -2147483648n)
10321
10323
  throw new Error("Number too small");
10322
- return Ri(t);
10324
+ return zi(t);
10323
10325
  }
10324
- function ir(c) {
10326
+ function or(c) {
10325
10327
  let t = Te(c);
10326
10328
  if (t > 0xFFFFFFFFFFFFFFFFn)
10327
10329
  throw new Error("Number too big");
10328
10330
  if (t > 0x7FFFFFFFFFFFFFFFn && (t = t - 0x10000000000000000n), t < -9223372036854775808n)
10329
10331
  throw new Error("Number too small");
10330
- return Ri(t);
10332
+ return zi(t);
10331
10333
  }
10332
10334
  function Rt(c) {
10333
10335
  let t = Te(c);
10334
10336
  if (t > 0xFFFFFFFFn)
10335
10337
  throw new Error("Number too big");
10336
- return Mi(t);
10338
+ return Ni(t);
10337
10339
  }
10338
- function Ta(c) {
10340
+ function qa(c) {
10339
10341
  return Array.from(c, function(t) {
10340
10342
  return ("0" + (t & 255).toString(16)).slice(-2);
10341
10343
  }).join("");
10342
10344
  }
10343
- class or {
10345
+ class cr {
10344
10346
  constructor(t) {
10345
10347
  this.func = t, this.functionName = t.functionName, this.module = t.module;
10346
10348
  }
@@ -10469,10 +10471,10 @@ class or {
10469
10471
  return [...t, 26];
10470
10472
  }
10471
10473
  i64_const(t) {
10472
- return [66, ...ir(t)];
10474
+ return [66, ...or(t)];
10473
10475
  }
10474
10476
  i32_const(t) {
10475
- return [65, ...Dn(t)];
10477
+ return [65, ...Mn(t)];
10476
10478
  }
10477
10479
  i64_eqz(t) {
10478
10480
  return [...t, 80];
@@ -10655,7 +10657,7 @@ class or {
10655
10657
  return [];
10656
10658
  }
10657
10659
  }
10658
- const Bn = {
10660
+ const vn = {
10659
10661
  i32: 127,
10660
10662
  i64: 126,
10661
10663
  f32: 125,
@@ -10664,7 +10666,7 @@ const Bn = {
10664
10666
  func: 96,
10665
10667
  emptyblock: 64
10666
10668
  };
10667
- class qa {
10669
+ class Da {
10668
10670
  constructor(t, e, n, a, s) {
10669
10671
  if (n == "import")
10670
10672
  this.fnType = "import", this.moduleName = a, this.fieldName = s;
@@ -10698,13 +10700,13 @@ class qa {
10698
10700
  this.returnType = t;
10699
10701
  }
10700
10702
  getSignature() {
10701
- const t = [...Rt(this.params.length), ...this.params.map((n) => Bn[n.type])], e = this.returnType ? [1, Bn[this.returnType]] : [0];
10703
+ const t = [...Rt(this.params.length), ...this.params.map((n) => vn[n.type])], e = this.returnType ? [1, vn[this.returnType]] : [0];
10702
10704
  return [96, ...t, ...e];
10703
10705
  }
10704
10706
  getBody() {
10705
10707
  const t = this.locals.map((n) => [
10706
10708
  ...Rt(n.length),
10707
- Bn[n.type]
10709
+ vn[n.type]
10708
10710
  ]), e = [
10709
10711
  ...Rt(this.locals.length),
10710
10712
  ...[].concat(...t),
@@ -10720,10 +10722,10 @@ class qa {
10720
10722
  this.code.push(...[].concat(...t));
10721
10723
  }
10722
10724
  getCodeBuilder() {
10723
- return new or(this);
10725
+ return new cr(this);
10724
10726
  }
10725
10727
  }
10726
- class Ni {
10728
+ class Ui {
10727
10729
  constructor() {
10728
10730
  this.functions = [], this.functionIdxByName = {}, this.nImportFunctions = 0, this.nInternalFunctions = 0, this.memory = {
10729
10731
  pagesSize: 1,
@@ -10733,8 +10735,8 @@ class Ni {
10733
10735
  }
10734
10736
  build() {
10735
10737
  return this._setSignatures(), new Uint8Array([
10736
- ...wn(1836278016),
10737
- ...wn(1),
10738
+ ...Bn(1836278016),
10739
+ ...Bn(1),
10738
10740
  ...this._buildType(),
10739
10741
  ...this._buildImport(),
10740
10742
  ...this._buildFunctionDeclarations(),
@@ -10749,7 +10751,7 @@ class Ni {
10749
10751
  if (typeof this.functionIdxByName[t] < "u")
10750
10752
  throw new Error(`Function already defined: ${t}`);
10751
10753
  const e = this.functions.length;
10752
- return this.functionIdxByName[t] = e, this.functions.push(new qa(this, t, "internal")), this.nInternalFunctions++, this.functions[e];
10754
+ return this.functionIdxByName[t] = e, this.functions.push(new Da(this, t, "internal")), this.nInternalFunctions++, this.functions[e];
10753
10755
  }
10754
10756
  addIimportFunction(t, e, n) {
10755
10757
  if (typeof this.functionIdxByName[t] < "u")
@@ -10758,7 +10760,7 @@ class Ni {
10758
10760
  throw new Error(`Import functions must be declared before internal: ${t}`);
10759
10761
  let a = n || t;
10760
10762
  const s = this.functions.length;
10761
- return this.functionIdxByName[t] = s, this.functions.push(new qa(this, t, "import", e, a)), this.nImportFunctions++, this.functions[s];
10763
+ return this.functionIdxByName[t] = s, this.functions.push(new Da(this, t, "import", e, a)), this.nImportFunctions++, this.functions[s];
10762
10764
  }
10763
10765
  setMemory(t, e, n) {
10764
10766
  this.memory = {
@@ -10801,11 +10803,11 @@ class Ni {
10801
10803
  this.signatures = [];
10802
10804
  const t = {};
10803
10805
  if (this.functionsTable.length > 0) {
10804
- const e = this.functions[this.functionsTable[0]].getSignature(), n = "s_" + Ta(e);
10806
+ const e = this.functions[this.functionsTable[0]].getSignature(), n = "s_" + qa(e);
10805
10807
  t[n] = 0, this.signatures.push(e);
10806
10808
  }
10807
10809
  for (let e = 0; e < this.functions.length; e++) {
10808
- const n = this.functions[e].getSignature(), a = "s_" + Ta(n);
10810
+ const n = this.functions[e].getSignature(), a = "s_" + qa(n);
10809
10811
  typeof t[a] > "u" && (t[a] = this.signatures.length, this.signatures.push(n)), this.functions[e].signatureIdx = t[a];
10810
10812
  }
10811
10813
  }
@@ -10881,7 +10883,7 @@ class Ni {
10881
10883
  // Table (0 in MVP)
10882
10884
  65,
10883
10885
  // offset 0
10884
- ...Dn(0),
10886
+ ...Mn(0),
10885
10887
  11,
10886
10888
  ...Rt(this.functionsTable.length),
10887
10889
  ...t
@@ -10918,13 +10920,13 @@ class Ni {
10918
10920
  0,
10919
10921
  11,
10920
10922
  4,
10921
- ...wn(this.free)
10923
+ ...Bn(this.free)
10922
10924
  ]);
10923
10925
  for (let e = 0; e < this.datas.length; e++)
10924
10926
  t.push([
10925
10927
  0,
10926
10928
  65,
10927
- ...Dn(this.datas[e].offset),
10929
+ ...Mn(this.datas[e].offset),
10928
10930
  11,
10929
10931
  ...Rt(this.datas[e].bytes.length),
10930
10932
  ...this.datas[e].bytes
@@ -10936,9 +10938,9 @@ class Ni {
10936
10938
  }
10937
10939
  }
10938
10940
  globalThis.curve_bn128 = null;
10939
- async function cr(c, t) {
10940
- const e = new Ni();
10941
- e.setMemory(25), Ns(e), t && t(e);
10941
+ async function sr(c, t) {
10942
+ const e = new Ui();
10943
+ e.setMemory(25), zs(e), t && t(e);
10942
10944
  const n = {};
10943
10945
  if (n.code = e.build(), n.pq = e.modules.f1m.pq, n.pr = e.modules.frm.pq, n.pG1gen = e.modules.bn128.pG1gen, n.pG1zero = e.modules.bn128.pG1zero, n.pG1b = e.modules.bn128.pG1b, n.pG2gen = e.modules.bn128.pG2gen, n.pG2zero = e.modules.bn128.pG2zero, n.pG2b = e.modules.bn128.pG2b, n.pOneT = e.modules.bn128.pOneT, n.prePSize = e.modules.bn128.prePSize, n.preQSize = e.modules.bn128.preQSize, n.n8q = 32, n.n8r = 32, n.q = e.modules.bn128.q, n.r = e.modules.bn128.r, !c && globalThis.curve_bn128)
10944
10946
  return globalThis.curve_bn128;
@@ -10951,15 +10953,15 @@ async function cr(c, t) {
10951
10953
  n8r: 32,
10952
10954
  cofactorG2: ee("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d", 16),
10953
10955
  singleThread: !!c
10954
- }, s = await qi(a);
10956
+ }, s = await Mi(a);
10955
10957
  return s.terminate = async function() {
10956
10958
  a.singleThread || (globalThis.curve_bn128 = null, await this.tm.terminate());
10957
10959
  }, c || (globalThis.curve_bn128 = s), s;
10958
10960
  }
10959
10961
  globalThis.curve_bls12381 = null;
10960
- async function sr(c, t) {
10961
- const e = new Ni();
10962
- e.setMemory(25), zs(e), t && t(e);
10962
+ async function rr(c, t) {
10963
+ const e = new Ui();
10964
+ e.setMemory(25), Us(e), t && t(e);
10963
10965
  const n = {};
10964
10966
  if (n.code = e.build(), n.pq = e.modules.f1m.pq, n.pr = e.modules.frm.pq, n.pG1gen = e.modules.bls12381.pG1gen, n.pG1zero = e.modules.bls12381.pG1zero, n.pG1b = e.modules.bls12381.pG1b, n.pG2gen = e.modules.bls12381.pG2gen, n.pG2zero = e.modules.bls12381.pG2zero, n.pG2b = e.modules.bls12381.pG2b, n.pOneT = e.modules.bls12381.pOneT, n.prePSize = e.modules.bls12381.prePSize, n.preQSize = e.modules.bls12381.preQSize, n.n8q = 48, n.n8r = 32, n.q = e.modules.bls12381.q, n.r = e.modules.bls12381.r, !c && globalThis.curve_bls12381)
10965
10967
  return globalThis.curve_bls12381;
@@ -10973,7 +10975,7 @@ async function sr(c, t) {
10973
10975
  cofactorG1: ee("0x396c8c005555e1568c00aaab0000aaab", 16),
10974
10976
  cofactorG2: ee("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5", 16),
10975
10977
  singleThread: !!c
10976
- }, s = await qi(a);
10978
+ }, s = await Mi(a);
10977
10979
  return s.terminate = async function() {
10978
10980
  a.singleThread || (globalThis.curve_bls12381 = null, await this.tm.terminate());
10979
10981
  }, c || (globalThis.curve_bls12381 = s), s;
@@ -10982,24 +10984,24 @@ ee("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
10982
10984
  ee("21888242871839275222246405745257275088548364400416034343698204186575808495617");
10983
10985
  ee("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16);
10984
10986
  ee("21888242871839275222246405745257275088696311157297823662689037894645226208583");
10985
- const Yt = Dc, un = Zs;
10987
+ const Yt = Mc, dn = Ws;
10986
10988
  Yt.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
10987
10989
  Yt.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");
10988
- const rr = Yt.e("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16), lr = Yt.e("21888242871839275222246405745257275088696311157297823662689037894645226208583");
10989
- async function Kn(c) {
10990
+ const lr = Yt.e("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16), ur = Yt.e("21888242871839275222246405745257275088696311157297823662689037894645226208583");
10991
+ async function Yn(c) {
10990
10992
  let t;
10991
- if (Yt.eq(c, lr))
10992
- t = await cr();
10993
- else if (Yt.eq(c, rr))
10993
+ if (Yt.eq(c, ur))
10994
10994
  t = await sr();
10995
+ else if (Yt.eq(c, lr))
10996
+ t = await rr();
10995
10997
  else
10996
10998
  throw new Error(`Curve not supported: ${Yt.toString(c)}`);
10997
10999
  return t;
10998
11000
  }
10999
- function dn(c) {
11001
+ function fn(c) {
11000
11002
  return (c & 4294901760 ? (c &= 4294901760, 16) : 0) | (c & 4278255360 ? (c &= 4278255360, 8) : 0) | (c & 4042322160 ? (c &= 4042322160, 4) : 0) | (c & 3435973836 ? (c &= 3435973836, 2) : 0) | (c & 2863311530) !== 0;
11001
11003
  }
11002
- const ur = 1, dr = 2, zi = 10, fr = 2;
11004
+ const dr = 1, fr = 2, ji = 10, _r = 2;
11003
11005
  async function de(c, t, e) {
11004
11006
  const n = await c.read(t.G1.F.n8 * 2), a = t.G1.fromRprLEM(n, 0);
11005
11007
  return e ? t.G1.toObject(a) : a;
@@ -11008,71 +11010,71 @@ async function $e(c, t, e) {
11008
11010
  const n = await c.read(t.G2.F.n8 * 2), a = t.G2.fromRprLEM(n, 0);
11009
11011
  return e ? t.G2.toObject(a) : a;
11010
11012
  }
11011
- async function _r(c, t, e) {
11013
+ async function gr(c, t, e) {
11012
11014
  await We(c, t, 1);
11013
11015
  const n = await c.readULE32();
11014
- if (await Xe(c), n === ur)
11015
- return await gr(c, t, e);
11016
- if (n === dr)
11016
+ if (await Xe(c), n === dr)
11017
11017
  return await pr(c, t, e);
11018
- if (n === zi)
11018
+ if (n === fr)
11019
11019
  return await hr(c, t, e);
11020
+ if (n === ji)
11021
+ return await Lr(c, t, e);
11020
11022
  throw new Error("Protocol not supported: ");
11021
11023
  }
11022
- async function gr(c, t, e) {
11024
+ async function pr(c, t, e) {
11023
11025
  const n = {};
11024
11026
  n.protocol = "groth16", await We(c, t, 2);
11025
11027
  const a = await c.readULE32();
11026
11028
  n.n8q = a, n.q = await Be(c, a);
11027
11029
  const s = await c.readULE32();
11028
- return n.n8r = s, n.r = await Be(c, s), n.curve = await Kn(n.q), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = dn(n.domainSize), n.vk_alpha_1 = await de(c, n.curve, e), n.vk_beta_1 = await de(c, n.curve, e), n.vk_beta_2 = await $e(c, n.curve, e), n.vk_gamma_2 = await $e(c, n.curve, e), n.vk_delta_1 = await de(c, n.curve, e), n.vk_delta_2 = await $e(c, n.curve, e), await Xe(c), n;
11030
+ return n.n8r = s, n.r = await Be(c, s), n.curve = await Yn(n.q), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = fn(n.domainSize), n.vk_alpha_1 = await de(c, n.curve, e), n.vk_beta_1 = await de(c, n.curve, e), n.vk_beta_2 = await $e(c, n.curve, e), n.vk_gamma_2 = await $e(c, n.curve, e), n.vk_delta_1 = await de(c, n.curve, e), n.vk_delta_2 = await $e(c, n.curve, e), await Xe(c), n;
11029
11031
  }
11030
- async function pr(c, t, e) {
11032
+ async function hr(c, t, e) {
11031
11033
  const n = {};
11032
11034
  n.protocol = "plonk", await We(c, t, 2);
11033
11035
  const a = await c.readULE32();
11034
11036
  n.n8q = a, n.q = await Be(c, a);
11035
11037
  const s = await c.readULE32();
11036
- return n.n8r = s, n.r = await Be(c, s), n.curve = await Kn(n.q), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = dn(n.domainSize), n.nAdditions = await c.readULE32(), n.nConstrains = await c.readULE32(), n.k1 = await c.read(s), n.k2 = await c.read(s), n.Qm = await de(c, n.curve, e), n.Ql = await de(c, n.curve, e), n.Qr = await de(c, n.curve, e), n.Qo = await de(c, n.curve, e), n.Qc = await de(c, n.curve, e), n.S1 = await de(c, n.curve, e), n.S2 = await de(c, n.curve, e), n.S3 = await de(c, n.curve, e), n.X_2 = await $e(c, n.curve, e), await Xe(c), n;
11038
+ return n.n8r = s, n.r = await Be(c, s), n.curve = await Yn(n.q), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = fn(n.domainSize), n.nAdditions = await c.readULE32(), n.nConstrains = await c.readULE32(), n.k1 = await c.read(s), n.k2 = await c.read(s), n.Qm = await de(c, n.curve, e), n.Ql = await de(c, n.curve, e), n.Qr = await de(c, n.curve, e), n.Qo = await de(c, n.curve, e), n.Qc = await de(c, n.curve, e), n.S1 = await de(c, n.curve, e), n.S2 = await de(c, n.curve, e), n.S3 = await de(c, n.curve, e), n.X_2 = await $e(c, n.curve, e), await Xe(c), n;
11037
11039
  }
11038
- async function hr(c, t, e) {
11040
+ async function Lr(c, t, e) {
11039
11041
  const n = {};
11040
- n.protocol = "fflonk", n.protocolId = zi, await We(c, t, fr);
11042
+ n.protocol = "fflonk", n.protocolId = ji, await We(c, t, _r);
11041
11043
  const a = await c.readULE32();
11042
- n.n8q = a, n.q = await Be(c, a), n.curve = await Kn(n.q);
11044
+ n.n8q = a, n.q = await Be(c, a), n.curve = await Yn(n.q);
11043
11045
  const s = await c.readULE32();
11044
- return n.n8r = s, n.r = await Be(c, s), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = dn(n.domainSize), n.nAdditions = await c.readULE32(), n.nConstraints = await c.readULE32(), n.k1 = await c.read(s), n.k2 = await c.read(s), n.w3 = await c.read(s), n.w4 = await c.read(s), n.w8 = await c.read(s), n.wr = await c.read(s), n.X_2 = await $e(c, n.curve, e), n.C0 = await de(c, n.curve, e), await Xe(c), n;
11046
+ return n.n8r = s, n.r = await Be(c, s), n.nVars = await c.readULE32(), n.nPublic = await c.readULE32(), n.domainSize = await c.readULE32(), n.power = fn(n.domainSize), n.nAdditions = await c.readULE32(), n.nConstraints = await c.readULE32(), n.k1 = await c.read(s), n.k2 = await c.read(s), n.w3 = await c.read(s), n.w4 = await c.read(s), n.w8 = await c.read(s), n.wr = await c.read(s), n.X_2 = await $e(c, n.curve, e), n.C0 = await de(c, n.curve, e), await Xe(c), n;
11045
11047
  }
11046
- async function Lr(c, t, e) {
11047
- await ua(c, 1);
11048
+ async function mr(c, t, e) {
11049
+ await da(c, 1);
11048
11050
  const n = (Math.floor((Yt.bitLength(e) - 1) / 64) + 1) * 8;
11049
- if (await c.writeULE32(n), await mc(c, e, n), t.byteLength % n != 0)
11051
+ if (await c.writeULE32(n), await bc(c, e, n), t.byteLength % n != 0)
11050
11052
  throw new Error("Invalid witness length");
11051
- await c.writeULE32(t.byteLength / n), await da(c), await ua(c, 2), await c.write(t), await da(c);
11053
+ await c.writeULE32(t.byteLength / n), await fa(c), await da(c, 2), await c.write(t), await fa(c);
11052
11054
  }
11053
- async function mr(c, t) {
11055
+ async function br(c, t) {
11054
11056
  await We(c, t, 1);
11055
11057
  const e = await c.readULE32(), n = await Be(c, e), a = await c.readULE32();
11056
11058
  return await Xe(c), { n8: e, q: n, nWitness: a };
11057
11059
  }
11058
- const { stringifyBigInts: Da } = un;
11059
- async function br(c, t, e) {
11060
- const { fd: n, sections: a } = await la(t, "wtns", 2, 33554432, 8388608), s = await mr(n, a), { fd: g, sections: d } = await la(c, "zkey", 2, 1 << 25, 1 << 23), C = await _r(g, d);
11060
+ const { stringifyBigInts: Ma } = dn;
11061
+ async function yr(c, t, e) {
11062
+ const { fd: n, sections: a } = await ua(t, "wtns", 2, 33554432, 8388608), s = await br(n, a), { fd: g, sections: d } = await ua(c, "zkey", 2, 1 << 25, 1 << 23), C = await gr(g, d);
11061
11063
  if (C.protocol != "groth16")
11062
11064
  throw new Error("zkey file is not groth16");
11063
11065
  if (!Yt.eq(C.r, s.q))
11064
11066
  throw new Error("Curve of the witness does not match the curve of the proving key");
11065
11067
  if (s.nWitness != C.nVars)
11066
11068
  throw new Error(`Invalid witness length. Circuit: ${C.nVars}, witness: ${s.nWitness}`);
11067
- const l = C.curve, o = l.Fr, y = l.G1, E = l.G2, m = dn(C.domainSize);
11069
+ const l = C.curve, o = l.Fr, y = l.G1, E = l.G2, m = fn(C.domainSize);
11068
11070
  e && e.debug("Reading Wtns");
11069
11071
  const x = await Fe(n, a, 2);
11070
11072
  e && e.debug("Reading Coeffs");
11071
11073
  const O = await Fe(g, d, 4);
11072
11074
  e && e.debug("Building ABC");
11073
- const [L, I, v] = await yr(l, C, x, O, e), U = m == o.s ? l.Fr.shift : l.Fr.w[m + 1], w = await o.ifft(L, "", "", e, "IFFT_A"), S = await o.batchApplyKey(w, o.e(1), U), F = await o.fft(S, "", "", e, "FFT_A"), r = await o.ifft(I, "", "", e, "IFFT_B"), h = await o.batchApplyKey(r, o.e(1), U), R = await o.fft(h, "", "", e, "FFT_B"), j = await o.ifft(v, "", "", e, "IFFT_C"), T = await o.batchApplyKey(j, o.e(1), U), D = await o.fft(T, "", "", e, "FFT_C");
11075
+ const [L, I, v] = await Cr(l, C, x, O, e), U = m == o.s ? l.Fr.shift : l.Fr.w[m + 1], w = await o.ifft(L, "", "", e, "IFFT_A"), S = await o.batchApplyKey(w, o.e(1), U), F = await o.fft(S, "", "", e, "FFT_A"), r = await o.ifft(I, "", "", e, "IFFT_B"), h = await o.batchApplyKey(r, o.e(1), U), R = await o.fft(h, "", "", e, "FFT_B"), j = await o.ifft(v, "", "", e, "IFFT_C"), T = await o.batchApplyKey(j, o.e(1), U), D = await o.fft(T, "", "", e, "FFT_C");
11074
11076
  e && e.debug("Join ABC");
11075
- const A = await Cr(l, C, F, R, D, e);
11077
+ const A = await Ar(l, C, F, R, D, e);
11076
11078
  let M = {};
11077
11079
  e && e.debug("Reading A Points");
11078
11080
  const H = await Fe(g, d, 5);
@@ -11091,9 +11093,9 @@ async function br(c, t, e) {
11091
11093
  const i = x.slice(P * o.n8, P * o.n8 + o.n8);
11092
11094
  K.push(Yt.fromRprLE(i));
11093
11095
  }
11094
- return M.pi_a = y.toObject(y.toAffine(M.pi_a)), M.pi_b = E.toObject(E.toAffine(M.pi_b)), M.pi_c = y.toObject(y.toAffine(M.pi_c)), M.protocol = "groth16", M.curve = l.name, await g.close(), await n.close(), M = Da(M), K = Da(K), { proof: M, publicSignals: K };
11096
+ return M.pi_a = y.toObject(y.toAffine(M.pi_a)), M.pi_b = E.toObject(E.toAffine(M.pi_b)), M.pi_c = y.toObject(y.toAffine(M.pi_c)), M.protocol = "groth16", M.curve = l.name, await g.close(), await n.close(), M = Ma(M), K = Ma(K), { proof: M, publicSignals: K };
11095
11097
  }
11096
- async function yr(c, t, e, n, a) {
11098
+ async function Cr(c, t, e, n, a) {
11097
11099
  const s = c.Fr.n8, g = 4 * 3 + t.n8r, d = (n.byteLength - 4) / g, C = new Vt(t.domainSize * s), l = new Vt(t.domainSize * s), o = new Vt(t.domainSize * s), y = [C, l];
11098
11100
  for (let E = 0; E < d; E++) {
11099
11101
  a && E % 1e6 == 0 && a.debug(`QAP AB: ${E}/${d}`);
@@ -11116,7 +11118,7 @@ async function yr(c, t, e, n, a) {
11116
11118
  );
11117
11119
  return [C, l, o];
11118
11120
  }
11119
- async function Cr(c, t, e, n, a, s) {
11121
+ async function Ar(c, t, e, n, a, s) {
11120
11122
  const d = c.Fr.n8, C = Math.floor(e.byteLength / c.Fr.n8), l = [];
11121
11123
  for (let m = 0; m < C; m += 4194304) {
11122
11124
  s && s.debug(`JoinABC: ${m}/${C}`);
@@ -11141,7 +11143,7 @@ async function Cr(c, t, e, n, a, s) {
11141
11143
  y.set(o[m][0], E), E += o[m][0].byteLength;
11142
11144
  return y;
11143
11145
  }
11144
- function Ui(c) {
11146
+ function $i(c) {
11145
11147
  var t = [];
11146
11148
  return e(t, c), t;
11147
11149
  function e(n, a) {
@@ -11152,7 +11154,7 @@ function Ui(c) {
11152
11154
  n.push(a);
11153
11155
  }
11154
11156
  }
11155
- function ji(c) {
11157
+ function Gi(c) {
11156
11158
  const t = BigInt(2) ** BigInt(64);
11157
11159
  let e = BigInt("0xCBF29CE484222325");
11158
11160
  for (var n = 0; n < c.length; n++)
@@ -11160,7 +11162,7 @@ function ji(c) {
11160
11162
  let a = e.toString(16), s = 16 - a.length;
11161
11163
  return a = "0".repeat(s).concat(a), a;
11162
11164
  }
11163
- function Ar(c, t) {
11165
+ function Fr(c, t) {
11164
11166
  const e = [];
11165
11167
  let n = BigInt(c);
11166
11168
  const a = BigInt(4294967296);
@@ -11171,7 +11173,7 @@ function Ar(c, t) {
11171
11173
  e.unshift(0), s--;
11172
11174
  return e;
11173
11175
  }
11174
- async function Fr(c, t) {
11176
+ async function Er(c, t) {
11175
11177
  t = t || {};
11176
11178
  let e = 32767, n, a = !1;
11177
11179
  for (; !a; )
@@ -11238,7 +11240,7 @@ async function Fr(c, t) {
11238
11240
  });
11239
11241
  typeof E.exports.getVersion == "function" && (l = E.exports.getVersion()), typeof E.exports.getMinorVersion == "function" && (o = E.exports.getMinorVersion()), typeof E.exports.getPatchVersion == "function" && (y = E.exports.getPatchVersion());
11240
11242
  const m = t && (t.sanityCheck || t.logGetSignal || t.logSetSignal || t.logStartComponent || t.logFinishComponent);
11241
- return l === 2 ? g = new wr(E, m) : g = new Er(n, E, m), g;
11243
+ return l === 2 ? g = new Br(E, m) : g = new wr(n, E, m), g;
11242
11244
  function x() {
11243
11245
  for (var L = "", I = E.exports.getMessageChar(); I != 0; )
11244
11246
  L += String.fromCharCode(I), I = E.exports.getMessageChar();
@@ -11251,13 +11253,13 @@ async function Fr(c, t) {
11251
11253
  return String.fromCharCode.apply(null, v);
11252
11254
  }
11253
11255
  }
11254
- class Er {
11256
+ class wr {
11255
11257
  constructor(t, e, n) {
11256
11258
  this.memory = t, this.i32 = new Uint32Array(t.buffer), this.instance = e, this.n32 = (this.instance.exports.getFrLen() >> 2) - 2;
11257
11259
  const a = this.instance.exports.getPRawPrime(), s = new Array(this.n32);
11258
11260
  for (let g = 0; g < this.n32; g++)
11259
11261
  s[this.n32 - 1 - g] = this.i32[(a >> 2) + g];
11260
- this.prime = Yt.fromArray(s, 4294967296), this.Fr = new Jc(this.prime), this.mask32 = Yt.fromString("FFFFFFFF", 16), this.NVars = this.instance.exports.getNVars(), this.n64 = Math.floor((this.Fr.bitLength - 1) / 64) + 1, this.R = this.Fr.e(Yt.shiftLeft(1, this.n64 * 64)), this.RInv = this.Fr.inv(this.R), this.sanityCheck = n;
11262
+ this.prime = Yt.fromArray(s, 4294967296), this.Fr = new Kc(this.prime), this.mask32 = Yt.fromString("FFFFFFFF", 16), this.NVars = this.instance.exports.getNVars(), this.n64 = Math.floor((this.Fr.bitLength - 1) / 64) + 1, this.R = this.Fr.e(Yt.shiftLeft(1, this.n64 * 64)), this.RInv = this.Fr.inv(this.R), this.sanityCheck = n;
11261
11263
  }
11262
11264
  circom_version() {
11263
11265
  return 1;
@@ -11266,13 +11268,13 @@ class Er {
11266
11268
  this.instance.exports.init(this.sanityCheck || e ? 1 : 0);
11267
11269
  const n = this.allocInt(), a = this.allocFr();
11268
11270
  Object.keys(t).forEach((g) => {
11269
- const d = ji(g), C = parseInt(d.slice(0, 8), 16), l = parseInt(d.slice(8, 16), 16);
11271
+ const d = Gi(g), C = parseInt(d.slice(0, 8), 16), l = parseInt(d.slice(8, 16), 16);
11270
11272
  try {
11271
11273
  this.instance.exports.getSignalOffset32(n, 0, C, l);
11272
11274
  } catch {
11273
11275
  throw new Error(`Signal ${g} is not an input of the circuit.`);
11274
11276
  }
11275
- const o = this.getInt(n), y = Ui(t[g]);
11277
+ const o = this.getInt(n), y = $i(t[g]);
11276
11278
  for (let E = 0; E < y.length; E++)
11277
11279
  this.setFr(a, y[E]), this.instance.exports.setSignal(0, 0, o + E, a);
11278
11280
  });
@@ -11339,7 +11341,7 @@ class Er {
11339
11341
  }
11340
11342
  }
11341
11343
  }
11342
- class wr {
11344
+ class Br {
11343
11345
  constructor(t, e) {
11344
11346
  this.instance = t, this.version = this.instance.exports.getVersion(), this.n32 = this.instance.exports.getFieldNumLen32(), this.instance.exports.getRawPrime();
11345
11347
  const n = new Array(this.n32);
@@ -11355,9 +11357,9 @@ class wr {
11355
11357
  const n = Object.keys(t);
11356
11358
  var a = 0;
11357
11359
  if (n.forEach((s) => {
11358
- const g = ji(s), d = parseInt(g.slice(0, 8), 16), C = parseInt(g.slice(8, 16), 16), l = Ui(t[s]);
11360
+ const g = Gi(s), d = parseInt(g.slice(0, 8), 16), C = parseInt(g.slice(8, 16), 16), l = $i(t[s]);
11359
11361
  for (let o = 0; o < l.length; o++) {
11360
- const y = Ar(l[o], this.n32);
11362
+ const y = Fr(l[o], this.n32);
11361
11363
  for (let E = 0; E < this.n32; E++)
11362
11364
  this.instance.exports.writeSharedRWMemory(E, y[this.n32 - 1 - E]);
11363
11365
  try {
@@ -11401,35 +11403,35 @@ class wr {
11401
11403
  return a;
11402
11404
  }
11403
11405
  }
11404
- const { unstringifyBigInts: Br } = un;
11405
- async function vr(c, t, e, n) {
11406
- const a = Br(c), s = await ii(t), g = await s.read(s.totalSize);
11406
+ const { unstringifyBigInts: vr } = dn;
11407
+ async function xr(c, t, e, n) {
11408
+ const a = vr(c), s = await ci(t), g = await s.read(s.totalSize);
11407
11409
  await s.close();
11408
- const d = await Fr(g);
11410
+ const d = await Er(g);
11409
11411
  if (d.circom_version() == 1) {
11410
- const C = await d.calculateBinWitness(a), l = await Lc(e, "wtns", 2, 2);
11411
- await Lr(l, C, d.prime), await l.close();
11412
+ const C = await d.calculateBinWitness(a), l = await mc(e, "wtns", 2, 2);
11413
+ await mr(l, C, d.prime), await l.close();
11412
11414
  } else {
11413
- const C = await ai(e), l = await d.calculateWTNSBin(a);
11415
+ const C = await oi(e), l = await d.calculateWTNSBin(a);
11414
11416
  await C.write(l), await C.close();
11415
11417
  }
11416
11418
  }
11417
- const { unstringifyBigInts: xr } = un;
11418
- async function Sr(c, t, e, n) {
11419
- const a = xr(c), s = {
11419
+ const { unstringifyBigInts: Sr } = dn;
11420
+ async function Ir(c, t, e, n) {
11421
+ const a = Sr(c), s = {
11420
11422
  type: "mem"
11421
11423
  };
11422
- return await vr(a, t, s), await br(e, s, n);
11424
+ return await xr(a, t, s), await yr(e, s, n);
11423
11425
  }
11424
- const { unstringifyBigInts: Ma } = un;
11426
+ const { unstringifyBigInts: Ra } = dn;
11425
11427
  function he(c) {
11426
11428
  let t = c.toString(16);
11427
11429
  for (; t.length < 64; )
11428
11430
  t = "0" + t;
11429
11431
  return t = `"0x${t}"`, t;
11430
11432
  }
11431
- async function Ir(c, t) {
11432
- const e = Ma(c), n = Ma(t);
11433
+ async function Or(c, t) {
11434
+ const e = Ra(c), n = Ra(t);
11433
11435
  let a = "";
11434
11436
  for (let g = 0; g < n.length; g++)
11435
11437
  a != "" && (a = a + ","), a = a + he(n[g]);
@@ -11438,7 +11440,7 @@ async function Ir(c, t) {
11438
11440
  }
11439
11441
  Yt.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
11440
11442
  Yt.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");
11441
- var Or = {}, $i = {};
11443
+ var Pr = {}, Zi = {};
11442
11444
  (function(c) {
11443
11445
  var t = /[|\\{}()[\]^$+*?.]/g, e = Object.prototype.hasOwnProperty, n = function(l, o) {
11444
11446
  return e.apply(l, [o]);
@@ -11523,19 +11525,19 @@ function encode_char(c) {
11523
11525
  return { __proto__: null };
11524
11526
  };
11525
11527
  }();
11526
- })($i);
11527
- const Pr = "ejs", kr = "Embedded JavaScript templates", Tr = [
11528
+ })(Zi);
11529
+ const kr = "ejs", Tr = "Embedded JavaScript templates", qr = [
11528
11530
  "template",
11529
11531
  "engine",
11530
11532
  "ejs"
11531
- ], qr = "3.1.9", Dr = "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)", Mr = "Apache-2.0", Rr = {
11533
+ ], Dr = "3.1.9", Mr = "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)", Rr = "Apache-2.0", Nr = {
11532
11534
  ejs: "./bin/cli.js"
11533
- }, Nr = "./lib/ejs.js", zr = "ejs.min.js", Ur = "ejs.min.js", jr = {
11535
+ }, zr = "./lib/ejs.js", Ur = "ejs.min.js", jr = "ejs.min.js", $r = {
11534
11536
  type: "git",
11535
11537
  url: "git://github.com/mde/ejs.git"
11536
- }, $r = "https://github.com/mde/ejs/issues", Gr = "https://github.com/mde/ejs", Zr = {
11538
+ }, Gr = "https://github.com/mde/ejs/issues", Zr = "https://github.com/mde/ejs", Wr = {
11537
11539
  jake: "^10.8.5"
11538
- }, Wr = {
11540
+ }, Xr = {
11539
11541
  browserify: "^16.5.1",
11540
11542
  eslint: "^6.8.0",
11541
11543
  "git-directory-deploy": "^1.5.1",
@@ -11543,28 +11545,28 @@ const Pr = "ejs", kr = "Embedded JavaScript templates", Tr = [
11543
11545
  "lru-cache": "^4.0.1",
11544
11546
  mocha: "^10.2.0",
11545
11547
  "uglify-js": "^3.3.16"
11546
- }, Xr = {
11547
- node: ">=0.10.0"
11548
11548
  }, Vr = {
11549
- test: "mocha -u tdd"
11549
+ node: ">=0.10.0"
11550
11550
  }, Hr = {
11551
- name: Pr,
11552
- description: kr,
11553
- keywords: Tr,
11554
- version: qr,
11555
- author: Dr,
11556
- license: Mr,
11557
- bin: Rr,
11558
- main: Nr,
11559
- jsdelivr: zr,
11560
- unpkg: Ur,
11561
- repository: jr,
11562
- bugs: $r,
11563
- homepage: Gr,
11564
- dependencies: Zr,
11565
- devDependencies: Wr,
11566
- engines: Xr,
11567
- scripts: Vr
11551
+ test: "mocha -u tdd"
11552
+ }, Qr = {
11553
+ name: kr,
11554
+ description: Tr,
11555
+ keywords: qr,
11556
+ version: Dr,
11557
+ author: Mr,
11558
+ license: Rr,
11559
+ bin: Nr,
11560
+ main: zr,
11561
+ jsdelivr: Ur,
11562
+ unpkg: jr,
11563
+ repository: $r,
11564
+ bugs: Gr,
11565
+ homepage: Zr,
11566
+ dependencies: Wr,
11567
+ devDependencies: Xr,
11568
+ engines: Vr,
11569
+ scripts: Hr
11568
11570
  };
11569
11571
  (function(c) {
11570
11572
  /**
@@ -11574,7 +11576,7 @@ const Pr = "ejs", kr = "Embedded JavaScript templates", Tr = [
11574
11576
  * @project EJS
11575
11577
  * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
11576
11578
  */
11577
- var t = bo, e = mo(), n = $i, a = !1, s = Hr.version, g = "<", d = ">", C = "%", l = "locals", o = "ejs", y = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", E = [
11579
+ var t = sn(), e = bo(), n = Zi, a = !1, s = Qr.version, g = "<", d = ">", C = "%", l = "locals", o = "ejs", y = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", E = [
11578
11580
  "delimiter",
11579
11581
  "scope",
11580
11582
  "context",
@@ -11870,9 +11872,9 @@ try {
11870
11872
  `);
11871
11873
  }
11872
11874
  }, c.escapeXML = n.escapeXML, c.__express = c.renderFile, c.VERSION = s, c.name = o, typeof window < "u" && (window.ejs = c);
11873
- })(Or);
11874
- var Yn = { exports: {} };
11875
- Yn.exports;
11875
+ })(Pr);
11876
+ var ta = { exports: {} };
11877
+ ta.exports;
11876
11878
  (function(c) {
11877
11879
  (function(t) {
11878
11880
  var e, n, a, s, g, d, C, l, o, y, E, m, x, O, L, I, v;
@@ -12312,8 +12314,8 @@ Yn.exports;
12312
12314
  c !== null && c.exports ? c.exports = k : t.check = k;
12313
12315
  }
12314
12316
  })(en);
12315
- })(Yn);
12316
- var ta = Yn.exports, Qr = { exports: {} };
12317
+ })(ta);
12318
+ var ea = ta.exports, Jr = { exports: {} };
12317
12319
  (function(c) {
12318
12320
  c.exports = {
12319
12321
  array: "arr",
@@ -12326,28 +12328,28 @@ var ta = Yn.exports, Qr = { exports: {} };
12326
12328
  end: "end",
12327
12329
  error: "err"
12328
12330
  }, c.exports.endArray = c.exports.endPrefix + c.exports.array, c.exports.endObject = c.exports.endPrefix + c.exports.object, c.exports.endLine = `${c.exports.endPrefix}line`, c.exports.dataError = `${c.exports.error}-data`;
12329
- })(Qr);
12330
- ja.EventEmitter;
12331
- const Jr = zn, Gi = $a().Readable, Ra = ta;
12332
- Jr.inherits(cn, Gi);
12333
- var Zi = cn;
12331
+ })(Jr);
12332
+ $a.EventEmitter;
12333
+ const Kr = Un, Wi = Ga().Readable, Na = ea;
12334
+ Kr.inherits(cn, Wi);
12335
+ var Xi = cn;
12334
12336
  function cn(c, t) {
12335
- return Ra.not.instanceStrict(this, cn) ? new cn(c) : (Ra.assert.function(c, "Invalid read implementation"), this._read = function() {
12337
+ return Na.not.instanceStrict(this, cn) ? new cn(c) : (Na.assert.function(c, "Invalid read implementation"), this._read = function() {
12336
12338
  c();
12337
- }, Gi.call(this, t));
12339
+ }, Wi.call(this, t));
12338
12340
  }
12339
- const Kr = ta, Wi = Zi, Yr = zn;
12340
- Yr.inherits(Mn, Wi);
12341
- function Mn(c, t) {
12342
- return Kr.not.instanceStrict(this, Mn) ? new Mn(c, t) : Wi.call(this, c, { ...t, objectMode: !0 });
12341
+ const Yr = ea, Vi = Xi, tl = Un;
12342
+ tl.inherits(Rn, Vi);
12343
+ function Rn(c, t) {
12344
+ return Yr.not.instanceStrict(this, Rn) ? new Rn(c, t) : Vi.call(this, c, { ...t, objectMode: !0 });
12343
12345
  }
12344
- class fn extends Array {
12346
+ class _n extends Array {
12345
12347
  constructor(t) {
12346
12348
  let e, n;
12347
- if (!Na(t))
12349
+ if (!za(t))
12348
12350
  throw new TypeError("Argument `size` must be a positive integer.");
12349
12351
  return super(t), this.grow = (a) => {
12350
- if (!Na(a))
12352
+ if (!za(a))
12351
12353
  throw new TypeError("Argument `by` must be a positive integer.");
12352
12354
  let s;
12353
12355
  const g = t + a;
@@ -12361,38 +12363,38 @@ class fn extends Array {
12361
12363
  t = g;
12362
12364
  }, new Proxy(this, {
12363
12365
  get(a, s) {
12364
- return Rn(s) ? a[za(s, t)] : a[s];
12366
+ return Nn(s) ? a[Ua(s, t)] : a[s];
12365
12367
  },
12366
12368
  set(a, s, g) {
12367
- return Rn(s) ? (e = za(s, t), a[e] = g, Math.abs(s) >= t ? n = !0 : n = !1) : a[s] = g, !0;
12369
+ return Nn(s) ? (e = Ua(s, t), a[e] = g, Math.abs(s) >= t ? n = !0 : n = !1) : a[s] = g, !0;
12368
12370
  }
12369
12371
  });
12370
12372
  }
12371
12373
  }
12372
- function Na(c) {
12373
- return Rn(c) && c > 0;
12374
+ function za(c) {
12375
+ return Nn(c) && c > 0;
12374
12376
  }
12375
- function Rn(c) {
12377
+ function Nn(c) {
12376
12378
  try {
12377
12379
  return +c % 1 === 0;
12378
12380
  } catch {
12379
12381
  }
12380
12382
  return !1;
12381
12383
  }
12382
- function za(c, t) {
12384
+ function Ua(c, t) {
12383
12385
  return c === 0 ? 0 : c < 0 ? (t - Math.abs(c)) % t : c % t;
12384
12386
  }
12385
- function _n() {
12387
+ function gn() {
12386
12388
  throw new Error("Not implemented");
12387
12389
  }
12388
- fn.prototype.push = _n;
12389
- fn.prototype.pop = _n;
12390
- fn.prototype.shift = _n;
12391
- fn.prototype.unshift = _n;
12390
+ _n.prototype.push = gn;
12391
+ _n.prototype.pop = gn;
12392
+ _n.prototype.shift = gn;
12393
+ _n.prototype.unshift = gn;
12392
12394
  function tn(c) {
12393
12395
  throw new Error('Could not dynamically require "' + c + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
12394
12396
  }
12395
- var tl = { exports: {} };
12397
+ var el = { exports: {} };
12396
12398
  /*! jsonpath 1.1.1 */
12397
12399
  (function(c, t) {
12398
12400
  (function(e) {
@@ -13523,7 +13525,7 @@ var tl = { exports: {} };
13523
13525
  }
13524
13526
  function $(p, B) {
13525
13527
  var N, X, lt;
13526
- return N = O, lt = S, X = pn(), B && O && J(p[0].name) && Dt(B, y.StrictParamName), O = N, w.markEnd(w.createFunctionExpression(null, p, [], X), lt);
13528
+ return N = O, lt = S, X = hn(), B && O && J(p[0].name) && Dt(B, y.StrictParamName), O = N, w.markEnd(w.createFunctionExpression(null, p, [], X), lt);
13527
13529
  }
13528
13530
  function tt() {
13529
13531
  var p, B;
@@ -13562,7 +13564,7 @@ var tl = { exports: {} };
13562
13564
  O && S.octal && Dt(S, y.StrictOctalLiteral), N = w.createLiteral(pt());
13563
13565
  else if (p === g.Keyword) {
13564
13566
  if (Y("function"))
13565
- return lo();
13567
+ return fo();
13566
13568
  Y("this") ? (pt(), N = w.createThisExpression()) : Zt(pt());
13567
13569
  } else
13568
13570
  p === g.BooleanLiteral ? (B = pt(), B.value = B.value === "true", N = w.createLiteral(B)) : p === g.NullLiteral ? (B = pt(), B.value = null, N = w.createLiteral(B)) : wt("/") || wt("/=") ? (typeof r.tokens < "u" ? N = w.createLiteral(mt()) : N = w.createLiteral(It()), $t()) : Zt(pt());
@@ -13732,7 +13734,7 @@ var tl = { exports: {} };
13732
13734
  var p;
13733
13735
  return Wt("var"), p = Ce(), _(), w.createVariableDeclaration(p, "var");
13734
13736
  }
13735
- function gn(p) {
13737
+ function pn(p) {
13736
13738
  var B, N;
13737
13739
  return N = S, Wt(p), B = Ce(p), _(), w.markEnd(w.createVariableDeclaration(B, p), N);
13738
13740
  }
@@ -13747,65 +13749,65 @@ var tl = { exports: {} };
13747
13749
  var p, B, N;
13748
13750
  return Wt("if"), vt("("), p = qt(), vt(")"), B = _e(), Y("else") ? (pt(), N = _e()) : N = null, w.createIfStatement(p, B, N);
13749
13751
  }
13750
- function Hi() {
13752
+ function Ji() {
13751
13753
  var p, B, N;
13752
13754
  return Wt("do"), N = F.inIteration, F.inIteration = !0, p = _e(), F.inIteration = N, Wt("while"), vt("("), B = qt(), vt(")"), wt(";") && pt(), w.createDoWhileStatement(p, B);
13753
13755
  }
13754
- function Qi() {
13756
+ function Ki() {
13755
13757
  var p, B, N;
13756
13758
  return Wt("while"), vt("("), p = qt(), vt(")"), N = F.inIteration, F.inIteration = !0, B = _e(), F.inIteration = N, w.createWhileStatement(p, B);
13757
13759
  }
13758
- function Ji() {
13760
+ function Yi() {
13759
13761
  var p, B, N;
13760
13762
  return N = S, p = pt(), B = Ce(), w.markEnd(w.createVariableDeclaration(B, p.value), N);
13761
13763
  }
13762
- function Ki() {
13764
+ function to() {
13763
13765
  var p, B, N, X, lt, Ct, Gt;
13764
- return p = B = N = null, Wt("for"), vt("("), wt(";") ? pt() : (Y("var") || Y("let") ? (F.allowIn = !1, p = Ji(), F.allowIn = !0, p.declarations.length === 1 && Y("in") && (pt(), X = p, lt = qt(), p = null)) : (F.allowIn = !1, p = qt(), F.allowIn = !0, Y("in") && (Z(p) || Dt({}, y.InvalidLHSInForIn), pt(), X = p, lt = qt(), p = null)), typeof X > "u" && vt(";")), typeof X > "u" && (wt(";") || (B = qt()), vt(";"), wt(")") || (N = qt())), vt(")"), Gt = F.inIteration, F.inIteration = !0, Ct = _e(), F.inIteration = Gt, typeof X > "u" ? w.createForStatement(p, B, N, Ct) : w.createForInStatement(X, lt, Ct);
13766
+ return p = B = N = null, Wt("for"), vt("("), wt(";") ? pt() : (Y("var") || Y("let") ? (F.allowIn = !1, p = Yi(), F.allowIn = !0, p.declarations.length === 1 && Y("in") && (pt(), X = p, lt = qt(), p = null)) : (F.allowIn = !1, p = qt(), F.allowIn = !0, Y("in") && (Z(p) || Dt({}, y.InvalidLHSInForIn), pt(), X = p, lt = qt(), p = null)), typeof X > "u" && vt(";")), typeof X > "u" && (wt(";") || (B = qt()), vt(";"), wt(")") || (N = qt())), vt(")"), Gt = F.inIteration, F.inIteration = !0, Ct = _e(), F.inIteration = Gt, typeof X > "u" ? w.createForStatement(p, B, N, Ct) : w.createForInStatement(X, lt, Ct);
13765
13767
  }
13766
- function Yi() {
13768
+ function eo() {
13767
13769
  var p = null, B;
13768
13770
  return Wt("continue"), x.charCodeAt(L) === 59 ? (pt(), F.inIteration || Pt({}, y.IllegalContinue), w.createContinueStatement(null)) : te() ? (F.inIteration || Pt({}, y.IllegalContinue), w.createContinueStatement(null)) : (S.type === g.Identifier && (p = Kt(), B = "$" + p.name, Object.prototype.hasOwnProperty.call(F.labelSet, B) || Pt({}, y.UnknownLabel, p.name)), _(), p === null && !F.inIteration && Pt({}, y.IllegalContinue), w.createContinueStatement(p));
13769
13771
  }
13770
- function to() {
13772
+ function no() {
13771
13773
  var p = null, B;
13772
13774
  return Wt("break"), x.charCodeAt(L) === 59 ? (pt(), F.inIteration || F.inSwitch || Pt({}, y.IllegalBreak), w.createBreakStatement(null)) : te() ? (F.inIteration || F.inSwitch || Pt({}, y.IllegalBreak), w.createBreakStatement(null)) : (S.type === g.Identifier && (p = Kt(), B = "$" + p.name, Object.prototype.hasOwnProperty.call(F.labelSet, B) || Pt({}, y.UnknownLabel, p.name)), _(), p === null && !(F.inIteration || F.inSwitch) && Pt({}, y.IllegalBreak), w.createBreakStatement(p));
13773
13775
  }
13774
- function eo() {
13776
+ function ao() {
13775
13777
  var p = null;
13776
13778
  return Wt("return"), F.inFunctionBody || Dt({}, y.IllegalReturn), x.charCodeAt(L) === 32 && M(x.charCodeAt(L + 1)) ? (p = qt(), _(), w.createReturnStatement(p)) : te() ? w.createReturnStatement(null) : (wt(";") || !wt("}") && S.type !== g.EOF && (p = qt()), _(), w.createReturnStatement(p));
13777
13779
  }
13778
- function no() {
13780
+ function io() {
13779
13781
  var p, B;
13780
13782
  return O && (G(), Dt({}, y.StrictModeWith)), Wt("with"), vt("("), p = qt(), vt(")"), B = _e(), w.createWithStatement(p, B);
13781
13783
  }
13782
- function ao() {
13784
+ function oo() {
13783
13785
  var p, B = [], N, X;
13784
13786
  for (X = S, Y("default") ? (pt(), p = null) : (Wt("case"), p = qt()), vt(":"); L < U && !(wt("}") || Y("default") || Y("case")); )
13785
13787
  N = _e(), B.push(N);
13786
13788
  return w.markEnd(w.createSwitchCase(p, B), X);
13787
13789
  }
13788
- function io() {
13790
+ function co() {
13789
13791
  var p, B, N, X, lt;
13790
13792
  if (Wt("switch"), vt("("), p = qt(), vt(")"), vt("{"), B = [], wt("}"))
13791
13793
  return pt(), w.createSwitchStatement(p, B);
13792
13794
  for (X = F.inSwitch, F.inSwitch = !0, lt = !1; L < U && !wt("}"); )
13793
- N = ao(), N.test === null && (lt && Pt({}, y.MultipleDefaultsInSwitch), lt = !0), B.push(N);
13795
+ N = oo(), N.test === null && (lt && Pt({}, y.MultipleDefaultsInSwitch), lt = !0), B.push(N);
13794
13796
  return F.inSwitch = X, vt("}"), w.createSwitchStatement(p, B);
13795
13797
  }
13796
- function oo() {
13798
+ function so() {
13797
13799
  var p;
13798
13800
  return Wt("throw"), te() && Pt({}, y.NewlineAfterThrow), p = qt(), _(), w.createThrowStatement(p);
13799
13801
  }
13800
- function co() {
13802
+ function ro() {
13801
13803
  var p, B, N;
13802
13804
  return N = S, Wt("catch"), vt("("), wt(")") && Zt(S), p = Kt(), O && J(p.name) && Dt({}, y.StrictCatchVariable), vt(")"), B = Qt(), w.markEnd(w.createCatchClause(p, B), N);
13803
13805
  }
13804
- function so() {
13806
+ function lo() {
13805
13807
  var p, B = [], N = null;
13806
- return Wt("try"), p = Qt(), Y("catch") && B.push(co()), Y("finally") && (pt(), N = Qt()), B.length === 0 && !N && Pt({}, y.NoCatchOrFinally), w.createTryStatement(p, [], B, N);
13808
+ return Wt("try"), p = Qt(), Y("catch") && B.push(ro()), Y("finally") && (pt(), N = Qt()), B.length === 0 && !N && Pt({}, y.NoCatchOrFinally), w.createTryStatement(p, [], B, N);
13807
13809
  }
13808
- function ro() {
13810
+ function uo() {
13809
13811
  return Wt("debugger"), _(), w.createDebuggerStatement();
13810
13812
  }
13811
13813
  function _e() {
@@ -13822,37 +13824,37 @@ var tl = { exports: {} };
13822
13824
  if (p === g.Keyword)
13823
13825
  switch (S.value) {
13824
13826
  case "break":
13825
- return w.markEnd(to(), lt);
13827
+ return w.markEnd(no(), lt);
13826
13828
  case "continue":
13827
- return w.markEnd(Yi(), lt);
13829
+ return w.markEnd(eo(), lt);
13828
13830
  case "debugger":
13829
- return w.markEnd(ro(), lt);
13831
+ return w.markEnd(uo(), lt);
13830
13832
  case "do":
13831
- return w.markEnd(Hi(), lt);
13833
+ return w.markEnd(Ji(), lt);
13832
13834
  case "for":
13833
- return w.markEnd(Ki(), lt);
13835
+ return w.markEnd(to(), lt);
13834
13836
  case "function":
13835
- return w.markEnd(aa(), lt);
13837
+ return w.markEnd(ia(), lt);
13836
13838
  case "if":
13837
13839
  return w.markEnd(Je(), lt);
13838
13840
  case "return":
13839
- return w.markEnd(eo(), lt);
13841
+ return w.markEnd(ao(), lt);
13840
13842
  case "switch":
13841
- return w.markEnd(io(), lt);
13843
+ return w.markEnd(co(), lt);
13842
13844
  case "throw":
13843
- return w.markEnd(oo(), lt);
13844
- case "try":
13845
13845
  return w.markEnd(so(), lt);
13846
+ case "try":
13847
+ return w.markEnd(lo(), lt);
13846
13848
  case "var":
13847
13849
  return w.markEnd(qe(), lt);
13848
13850
  case "while":
13849
- return w.markEnd(Qi(), lt);
13851
+ return w.markEnd(Ki(), lt);
13850
13852
  case "with":
13851
- return w.markEnd(no(), lt);
13853
+ return w.markEnd(io(), lt);
13852
13854
  }
13853
13855
  return B = qt(), B.type === l.Identifier && wt(":") ? (pt(), X = "$" + B.name, Object.prototype.hasOwnProperty.call(F.labelSet, X) && Pt({}, y.Redeclaration, "Label", B.name), F.labelSet[X] = !0, N = _e(), delete F.labelSet[X], w.markEnd(w.createLabeledStatement(B, N), lt)) : (_(), w.markEnd(w.createExpressionStatement(B), lt));
13854
13856
  }
13855
- function pn() {
13857
+ function hn() {
13856
13858
  var p, B = [], N, X, lt, Ct, Gt, Xt, oe, ae;
13857
13859
  for (ae = S, vt("{"); L < U && !(S.type !== g.StringLiteral || (N = S, p = De(), B.push(p), p.expression.type !== l.Literal)); )
13858
13860
  X = x.slice(N.start + 1, N.end - 1), X === "use strict" ? (O = !0, lt && Dt(lt, y.StrictOctalLiteral)) : !lt && N.octal && (lt = N);
@@ -13860,7 +13862,7 @@ var tl = { exports: {} };
13860
13862
  B.push(p);
13861
13863
  return vt("}"), F.labelSet = Ct, F.inIteration = Gt, F.inSwitch = Xt, F.inFunctionBody = oe, w.markEnd(w.createBlockStatement(B), ae);
13862
13864
  }
13863
- function na(p) {
13865
+ function aa(p) {
13864
13866
  var B, N = [], X, lt, Ct, Gt, Xt;
13865
13867
  if (vt("("), !wt(")"))
13866
13868
  for (Ct = {}; L < U && (X = S, B = Kt(), Gt = "$" + X.value, O ? (J(X.value) && (lt = X, Xt = y.StrictParamName), Object.prototype.hasOwnProperty.call(Ct, Gt) && (lt = X, Xt = y.StrictParamDupe)) : p || (J(X.value) ? (p = X, Xt = y.StrictParamName) : nt(X.value) ? (p = X, Xt = y.StrictReservedWord) : Object.prototype.hasOwnProperty.call(Ct, Gt) && (p = X, Xt = y.StrictParamDupe)), N.push(B), Ct[Gt] = !0, !wt(")")); )
@@ -13872,40 +13874,40 @@ var tl = { exports: {} };
13872
13874
  message: Xt
13873
13875
  };
13874
13876
  }
13875
- function aa() {
13877
+ function ia() {
13876
13878
  var p, B = [], N, X, lt, Ct, Gt, Xt, oe, ae;
13877
- return ae = S, Wt("function"), X = S, p = Kt(), O ? J(X.value) && Dt(X, y.StrictFunctionName) : J(X.value) ? (Gt = X, Xt = y.StrictFunctionName) : nt(X.value) && (Gt = X, Xt = y.StrictReservedWord), Ct = na(Gt), B = Ct.params, lt = Ct.stricted, Gt = Ct.firstRestricted, Ct.message && (Xt = Ct.message), oe = O, N = pn(), O && Gt && Pt(Gt, Xt), O && lt && Dt(lt, Xt), O = oe, w.markEnd(w.createFunctionDeclaration(p, B, [], N), ae);
13879
+ return ae = S, Wt("function"), X = S, p = Kt(), O ? J(X.value) && Dt(X, y.StrictFunctionName) : J(X.value) ? (Gt = X, Xt = y.StrictFunctionName) : nt(X.value) && (Gt = X, Xt = y.StrictReservedWord), Ct = aa(Gt), B = Ct.params, lt = Ct.stricted, Gt = Ct.firstRestricted, Ct.message && (Xt = Ct.message), oe = O, N = hn(), O && Gt && Pt(Gt, Xt), O && lt && Dt(lt, Xt), O = oe, w.markEnd(w.createFunctionDeclaration(p, B, [], N), ae);
13878
13880
  }
13879
- function lo() {
13881
+ function fo() {
13880
13882
  var p, B = null, N, X, lt, Ct, Gt = [], Xt, oe, ae;
13881
- return ae = S, Wt("function"), wt("(") || (p = S, B = Kt(), O ? J(p.value) && Dt(p, y.StrictFunctionName) : J(p.value) ? (X = p, lt = y.StrictFunctionName) : nt(p.value) && (X = p, lt = y.StrictReservedWord)), Ct = na(X), Gt = Ct.params, N = Ct.stricted, X = Ct.firstRestricted, Ct.message && (lt = Ct.message), oe = O, Xt = pn(), O && X && Pt(X, lt), O && N && Dt(N, lt), O = oe, w.markEnd(w.createFunctionExpression(B, Gt, [], Xt), ae);
13883
+ return ae = S, Wt("function"), wt("(") || (p = S, B = Kt(), O ? J(p.value) && Dt(p, y.StrictFunctionName) : J(p.value) ? (X = p, lt = y.StrictFunctionName) : nt(p.value) && (X = p, lt = y.StrictReservedWord)), Ct = aa(X), Gt = Ct.params, N = Ct.stricted, X = Ct.firstRestricted, Ct.message && (lt = Ct.message), oe = O, Xt = hn(), O && X && Pt(X, lt), O && N && Dt(N, lt), O = oe, w.markEnd(w.createFunctionExpression(B, Gt, [], Xt), ae);
13882
13884
  }
13883
13885
  function De() {
13884
13886
  if (S.type === g.Keyword)
13885
13887
  switch (S.value) {
13886
13888
  case "const":
13887
13889
  case "let":
13888
- return gn(S.value);
13890
+ return pn(S.value);
13889
13891
  case "function":
13890
- return aa();
13892
+ return ia();
13891
13893
  default:
13892
13894
  return _e();
13893
13895
  }
13894
13896
  if (S.type !== g.EOF)
13895
13897
  return _e();
13896
13898
  }
13897
- function uo() {
13899
+ function _o() {
13898
13900
  for (var p, B = [], N, X, lt; L < U && (N = S, !(N.type !== g.StringLiteral || (p = De(), B.push(p), p.expression.type !== l.Literal))); )
13899
13901
  X = x.slice(N.start + 1, N.end - 1), X === "use strict" ? (O = !0, lt && Dt(lt, y.StrictOctalLiteral)) : !lt && N.octal && (lt = N);
13900
13902
  for (; L < U && (p = De(), !(typeof p > "u")); )
13901
13903
  B.push(p);
13902
13904
  return B;
13903
13905
  }
13904
- function fo() {
13906
+ function go() {
13905
13907
  var p, B;
13906
- return G(), $t(), B = S, O = !1, p = uo(), w.markEnd(w.createProgram(p), B);
13908
+ return G(), $t(), B = S, O = !1, p = _o(), w.markEnd(w.createProgram(p), B);
13907
13909
  }
13908
- function ia() {
13910
+ function oa() {
13909
13911
  var p, B, N, X = [];
13910
13912
  for (p = 0; p < r.tokens.length; ++p)
13911
13913
  B = r.tokens[p], N = {
@@ -13914,7 +13916,7 @@ var tl = { exports: {} };
13914
13916
  }, r.range && (N.range = B.range), r.loc && (N.loc = B.loc), X.push(N);
13915
13917
  r.tokens = X;
13916
13918
  }
13917
- function _o(p, B) {
13919
+ function po(p, B) {
13918
13920
  var N, X, lt;
13919
13921
  N = String, typeof p != "string" && !(p instanceof String) && (p = N(p)), w = m, x = p, L = 0, I = x.length > 0 ? 1 : 0, v = 0, U = x.length, S = null, F = {
13920
13922
  allowIn: !0,
@@ -13937,7 +13939,7 @@ var tl = { exports: {} };
13937
13939
  } else
13938
13940
  throw Ct;
13939
13941
  }
13940
- ia(), lt = r.tokens, typeof r.comments < "u" && (lt.comments = r.comments), typeof r.errors < "u" && (lt.errors = r.errors);
13942
+ oa(), lt = r.tokens, typeof r.comments < "u" && (lt.comments = r.comments), typeof r.errors < "u" && (lt.errors = r.errors);
13941
13943
  } catch (Ct) {
13942
13944
  throw Ct;
13943
13945
  } finally {
@@ -13945,7 +13947,7 @@ var tl = { exports: {} };
13945
13947
  }
13946
13948
  return lt;
13947
13949
  }
13948
- function go(p, B) {
13950
+ function ho(p, B) {
13949
13951
  var N, X;
13950
13952
  X = String, typeof p != "string" && !(p instanceof String) && (p = X(p)), w = m, x = p, L = 0, I = x.length > 0 ? 1 : 0, v = 0, U = x.length, S = null, F = {
13951
13953
  allowIn: !0,
@@ -13956,7 +13958,7 @@ var tl = { exports: {} };
13956
13958
  lastCommentStart: -1
13957
13959
  }, r = {}, typeof B < "u" && (r.range = typeof B.range == "boolean" && B.range, r.loc = typeof B.loc == "boolean" && B.loc, r.attachComment = typeof B.attachComment == "boolean" && B.attachComment, r.loc && B.source !== null && B.source !== void 0 && (r.source = X(B.source)), typeof B.tokens == "boolean" && B.tokens && (r.tokens = []), typeof B.comment == "boolean" && B.comment && (r.comments = []), typeof B.tolerant == "boolean" && B.tolerant && (r.errors = []), r.attachComment && (r.range = !0, r.comments = [], r.bottomRightStack = [], r.trailingComments = [], r.leadingComments = []));
13958
13960
  try {
13959
- N = fo(), typeof r.comments < "u" && (N.comments = r.comments), typeof r.tokens < "u" && (ia(), N.tokens = r.tokens), typeof r.errors < "u" && (N.errors = r.errors);
13961
+ N = go(), typeof r.comments < "u" && (N.comments = r.comments), typeof r.tokens < "u" && (oa(), N.tokens = r.tokens), typeof r.errors < "u" && (N.errors = r.errors);
13960
13962
  } catch (lt) {
13961
13963
  throw lt;
13962
13964
  } finally {
@@ -13964,7 +13966,7 @@ var tl = { exports: {} };
13964
13966
  }
13965
13967
  return N;
13966
13968
  }
13967
- s.version = "1.2.2", s.tokenize = _o, s.parse = go, s.Syntax = function() {
13969
+ s.version = "1.2.2", s.tokenize = po, s.parse = ho, s.Syntax = function() {
13968
13970
  var p, B = {};
13969
13971
  typeof Object.create == "function" && (B = /* @__PURE__ */ Object.create(null));
13970
13972
  for (p in l)
@@ -15560,16 +15562,17 @@ Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[T] || T) + "'" : at =
15560
15562
  n.exports = e("./lib/index");
15561
15563
  }, { "./lib/index": 5 }] }, {}, ["jsonpath"])("jsonpath");
15562
15564
  });
15563
- })(tl);
15564
- $a();
15565
- ja.EventEmitter;
15566
- const el = ta, Xi = Zi, nl = zn;
15567
- nl.inherits(Nn, Xi);
15568
- function Nn(c, t) {
15569
- return el.not.instanceStrict(this, Nn) ? new Nn(c, t) : Xi.call(this, c, { ...t, encoding: "utf8" });
15570
- }
15571
- var ea = { exports: {} };
15572
- ea.exports;
15565
+ })(el);
15566
+ Ga();
15567
+ sn();
15568
+ $a.EventEmitter;
15569
+ const nl = ea, Hi = Xi, al = Un;
15570
+ al.inherits(zn, Hi);
15571
+ function zn(c, t) {
15572
+ return nl.not.instanceStrict(this, zn) ? new zn(c, t) : Hi.call(this, c, { ...t, encoding: "utf8" });
15573
+ }
15574
+ var na = { exports: {} };
15575
+ na.exports;
15573
15576
  (function(c) {
15574
15577
  (function(t) {
15575
15578
  c !== null ? c.exports = e : t.tryer = e;
@@ -15646,12 +15649,13 @@ ea.exports;
15646
15649
  setTimeout(I, Math.abs(v));
15647
15650
  }
15648
15651
  })(en);
15649
- })(ea);
15650
- ea.exports;
15651
- const al = typeof Se < "u" && Se.versions != null && Se.versions.node != null, vn = (
15652
+ })(na);
15653
+ na.exports;
15654
+ sn();
15655
+ const il = typeof Se < "u" && Se.versions != null && Se.versions.node != null, xn = (
15652
15656
  // @ts-expect-error webpack check is done like this
15653
15657
  typeof __webpack_require__ < "u"
15654
- ), Vi = new yo(), il = async (c) => {
15658
+ ), Qi = new yo(), ol = async (c) => {
15655
15659
  const { input: t, wasmFilePath: e, zKeyFilePath: n, chainId: a } = c.payload.data, {
15656
15660
  hostLocation: { origin: s },
15657
15661
  constants: {
@@ -15660,21 +15664,21 @@ const al = typeof Se < "u" && Se.versions != null && Se.versions.node != null, v
15660
15664
  }
15661
15665
  } = c.metadata;
15662
15666
  let C = e, l = n;
15663
- if (console.log({ isWebpack: vn }), al) {
15664
- g && !vn ? (C = `test/circuits/${e}`, l = `test/circuits/${n}`) : vn && (C = `libs/hardhat/test/circuits/${e}`, l = `libs/hardhat/test/circuits/${n}`);
15667
+ if (console.log({ isWebpack: xn }), il) {
15668
+ g && !xn ? (C = `test/circuits/${e}`, l = `test/circuits/${n}`) : xn && (C = `libs/hardhat/test/circuits/${e}`, l = `libs/hardhat/test/circuits/${n}`);
15665
15669
  const o = require("path");
15666
15670
  C = o.resolve(C), l = o.resolve(l);
15667
15671
  } else
15668
15672
  a === d.localhost && (C = `${s}/${e}`, l = `${s}/${n}`);
15669
15673
  try {
15670
- const { proof: o, publicSignals: y } = await Sr(t, C, l), E = await Ir(o, y), m = JSON.parse(`[${E}]`);
15671
- Vi.postMessageToMainThread({ zkCallData: m, proof: o, publicSignals: y });
15674
+ const { proof: o, publicSignals: y } = await Ir(t, C, l), E = await Or(o, y), m = JSON.parse(`[${E}]`);
15675
+ Qi.postMessageToMainThread({ zkCallData: m, proof: o, publicSignals: y });
15672
15676
  } catch (o) {
15673
15677
  console.log(o);
15674
15678
  }
15675
15679
  };
15676
- Vi.attachWorkerSideOnMessage(il);
15680
+ Qi.attachWorkerSideOnMessage(ol);
15677
15681
  export {
15678
- Vi as default,
15679
- il as onWorkerMessage
15682
+ Qi as default,
15683
+ ol as onWorkerMessage
15680
15684
  };