@hinkal/common 0.0.17 → 0.0.20
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.
- package/assets/{snarkjsWorkerLauncher-CaBCnle3.js → snarkjsWorkerLauncher-Cxayz-rO.js} +395 -392
- package/assets/snarkjsWorkerLogic-C0jhwQeU.js +37319 -0
- package/assets/{snarkjsWorkerLogic-PT_bvjbJ.js → snarkjsWorkerLogic-scy9tbGQ.js} +864 -817
- package/assets/{utxoWorkerLauncher-TRT6Cdzd.js → utxoWorkerLauncher-949gA7j-.js} +395 -394
- package/assets/{utxoWorkerLogic-CaRjg9tk.js → utxoWorkerLogic-CWVrduGP.js} +30 -30
- package/assets/{utxoWorkerLogic-CWrzh8Rb.js → utxoWorkerLogic-CyWO48JX.js} +36352 -20473
- package/assets/viteWorkerURL.constant-D9TTkFfm.js +11 -0
- package/assets/{zkProofWorkerLauncher-D1ef-Gxp.js → zkProofWorkerLauncher-B54jpyIs.js} +395 -395
- package/assets/{zkProofWorkerLogic-BwAAGTST.js → zkProofWorkerLogic-g413cUJh.js} +78787 -66386
- package/{index-DVX9ShLf.js → index-CRZ_sTGy.js} +116241 -103711
- package/index.js +57 -57
- package/package.json +1 -1
- package/{snarkjsWorkerLogic-D0EKr8Rb.js → snarkjsWorkerLogic-CJ6jLJrl.js} +863 -815
- package/utxoWorkerLogic-CxyTY-Iw.js +64 -0
- package/viteWorkerURL.constant-gZWY_Fas.js +9 -0
- package/{workerProxy-BDj498Ht.js → workerProxy-DTKGeJe4.js} +4 -3
- package/{zkProofWorkerLogic-BWuMfo-V.js → zkProofWorkerLogic-B9OTFcZv.js} +11 -11
- package/assets/snarkjsWorkerLogic-BAbiO5gj.js +0 -17935
- package/assets/viteWorkerURL.constant-C7fE1hzc.js +0 -11
- package/utxoWorkerLogic-Ck4p7ORl.js +0 -64
- package/viteWorkerURL.constant-Zrb20DQB.js +0 -9
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
function
|
|
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-CRZ_sTGy.js";
|
|
2
|
+
import { W as yo } from "./workerProxy-DTKGeJe4.js";
|
|
3
|
+
const Co = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
|
|
4
|
+
function sn(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
|
|
11
|
-
function
|
|
10
|
+
const ve = sn;
|
|
11
|
+
function Ao(c, t) {
|
|
12
12
|
let e = BigInt(0);
|
|
13
13
|
t = BigInt(t);
|
|
14
14
|
for (let n = 0; n < c.length; n++)
|
|
15
15
|
e = e * t + BigInt(c[n]);
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ga(c) {
|
|
19
19
|
const t = c.toString(16);
|
|
20
|
-
return (t.length - 1) * 4 +
|
|
20
|
+
return (t.length - 1) * 4 + Co[parseInt(t[0], 16)];
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Fo(c) {
|
|
23
23
|
return BigInt(c) < BigInt(0);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Eo(c) {
|
|
26
26
|
return !c;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Za(c, t) {
|
|
29
29
|
return BigInt(c) << BigInt(t);
|
|
30
30
|
}
|
|
31
31
|
function Un(c, t) {
|
|
32
32
|
return BigInt(c) >> BigInt(t);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
34
|
+
const wo = Za, Bo = Un;
|
|
35
|
+
function vo(c) {
|
|
36
36
|
return (BigInt(c) & BigInt(1)) == BigInt(1);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function xo(c) {
|
|
39
39
|
let t = BigInt(c);
|
|
40
40
|
const e = [];
|
|
41
41
|
for (; t; ) {
|
|
@@ -48,195 +48,195 @@ function Co(c) {
|
|
|
48
48
|
}
|
|
49
49
|
return e;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function So(c) {
|
|
52
52
|
let t = BigInt(c);
|
|
53
53
|
const e = [];
|
|
54
54
|
for (; t; )
|
|
55
55
|
t & BigInt(1) ? e.push(1) : e.push(0), t = t >> BigInt(1);
|
|
56
56
|
return e;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Wa(c) {
|
|
59
59
|
if (c > BigInt(Number.MAX_SAFE_INTEGER))
|
|
60
60
|
throw new Error("Number too big");
|
|
61
61
|
return Number(c);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Io(c, t) {
|
|
64
64
|
const e = [];
|
|
65
65
|
let n = BigInt(c);
|
|
66
66
|
for (t = BigInt(t); n; )
|
|
67
67
|
e.unshift(Number(n % t)), n = n / t;
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Oo(c, t) {
|
|
71
71
|
return BigInt(c) + BigInt(t);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Po(c, t) {
|
|
74
74
|
return BigInt(c) - BigInt(t);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ko(c) {
|
|
77
77
|
return -BigInt(c);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function To(c, t) {
|
|
80
80
|
return BigInt(c) * BigInt(t);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function qo(c) {
|
|
83
83
|
return BigInt(c) * BigInt(c);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Do(c, t) {
|
|
86
86
|
return BigInt(c) ** BigInt(t);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Mo(c, t) {
|
|
89
89
|
return BigInt(c) ** BigInt(t);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Ro(c) {
|
|
92
92
|
return BigInt(c) >= 0 ? BigInt(c) : -BigInt(c);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function No(c, t) {
|
|
95
95
|
return BigInt(c) / BigInt(t);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function zo(c, t) {
|
|
98
98
|
return BigInt(c) % BigInt(t);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Uo(c, t) {
|
|
101
101
|
return BigInt(c) == BigInt(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function jo(c, t) {
|
|
104
104
|
return BigInt(c) != BigInt(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function $o(c, t) {
|
|
107
107
|
return BigInt(c) < BigInt(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Go(c, t) {
|
|
110
110
|
return BigInt(c) > BigInt(t);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Zo(c, t) {
|
|
113
113
|
return BigInt(c) <= BigInt(t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Wo(c, t) {
|
|
116
116
|
return BigInt(c) >= BigInt(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Xa(c, t) {
|
|
119
119
|
return BigInt(c) & BigInt(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Xo(c, t) {
|
|
122
122
|
return BigInt(c) | BigInt(t);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Vo(c, t) {
|
|
125
125
|
return BigInt(c) ^ BigInt(t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Ho(c, t) {
|
|
128
128
|
return BigInt(c) && BigInt(t);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Qo(c, t) {
|
|
131
131
|
return BigInt(c) || BigInt(t);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Jo(c) {
|
|
134
134
|
return !BigInt(c);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Va(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] =
|
|
143
|
+
c[d] = Wa(Xa(Un(e, d * 8), 255));
|
|
144
144
|
}
|
|
145
|
-
function
|
|
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;
|
|
147
147
|
for (let d = 0; d < g; d++)
|
|
148
148
|
s.setUint32(n - d * 4 - 4, parseInt(a.substring(a.length - 8 * d - 8, a.length - 8 * d), 16), !1);
|
|
149
149
|
for (let d = 0; d < n / 4 - g; d++)
|
|
150
150
|
s[d] = 0;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
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")),
|
|
155
|
+
return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), sn(a.join(""), 16);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
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
|
|
162
|
+
return sn(a.join(""), 16);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ec(c, t) {
|
|
165
165
|
return c.toString(t);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
const t = new Uint8Array(Math.floor((
|
|
169
|
-
return
|
|
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;
|
|
170
170
|
}
|
|
171
|
-
const
|
|
172
|
-
var
|
|
171
|
+
const ac = ve(0), ic = ve(1);
|
|
172
|
+
var oc = /* @__PURE__ */ Object.freeze({
|
|
173
173
|
__proto__: null,
|
|
174
|
-
abs:
|
|
175
|
-
add:
|
|
176
|
-
band:
|
|
177
|
-
bitLength:
|
|
178
|
-
bits:
|
|
179
|
-
bor:
|
|
180
|
-
bxor:
|
|
181
|
-
div:
|
|
182
|
-
e:
|
|
183
|
-
eq:
|
|
184
|
-
exp:
|
|
185
|
-
fromArray:
|
|
186
|
-
fromRprBE:
|
|
187
|
-
fromRprLE:
|
|
188
|
-
fromString:
|
|
189
|
-
geq:
|
|
190
|
-
gt:
|
|
191
|
-
isNegative:
|
|
192
|
-
isOdd:
|
|
193
|
-
isZero:
|
|
194
|
-
land:
|
|
195
|
-
leq:
|
|
196
|
-
lnot:
|
|
197
|
-
lor:
|
|
198
|
-
lt:
|
|
199
|
-
mod:
|
|
200
|
-
mul:
|
|
201
|
-
naf:
|
|
202
|
-
neg:
|
|
203
|
-
neq:
|
|
204
|
-
one:
|
|
205
|
-
pow:
|
|
206
|
-
shiftLeft:
|
|
174
|
+
abs: Ro,
|
|
175
|
+
add: Oo,
|
|
176
|
+
band: Xa,
|
|
177
|
+
bitLength: Ga,
|
|
178
|
+
bits: So,
|
|
179
|
+
bor: Xo,
|
|
180
|
+
bxor: Vo,
|
|
181
|
+
div: No,
|
|
182
|
+
e: ve,
|
|
183
|
+
eq: Uo,
|
|
184
|
+
exp: Mo,
|
|
185
|
+
fromArray: Ao,
|
|
186
|
+
fromRprBE: tc,
|
|
187
|
+
fromRprLE: Yo,
|
|
188
|
+
fromString: sn,
|
|
189
|
+
geq: Wo,
|
|
190
|
+
gt: Go,
|
|
191
|
+
isNegative: Fo,
|
|
192
|
+
isOdd: vo,
|
|
193
|
+
isZero: Eo,
|
|
194
|
+
land: Ho,
|
|
195
|
+
leq: Zo,
|
|
196
|
+
lnot: Jo,
|
|
197
|
+
lor: Qo,
|
|
198
|
+
lt: $o,
|
|
199
|
+
mod: zo,
|
|
200
|
+
mul: To,
|
|
201
|
+
naf: xo,
|
|
202
|
+
neg: ko,
|
|
203
|
+
neq: jo,
|
|
204
|
+
one: ic,
|
|
205
|
+
pow: Do,
|
|
206
|
+
shiftLeft: Za,
|
|
207
207
|
shiftRight: Un,
|
|
208
|
-
shl:
|
|
209
|
-
shr:
|
|
210
|
-
square:
|
|
211
|
-
sub:
|
|
212
|
-
toArray:
|
|
213
|
-
toLEBuff:
|
|
214
|
-
toNumber:
|
|
215
|
-
toRprBE:
|
|
216
|
-
toRprLE:
|
|
217
|
-
toString:
|
|
218
|
-
zero:
|
|
208
|
+
shl: wo,
|
|
209
|
+
shr: Bo,
|
|
210
|
+
square: qo,
|
|
211
|
+
sub: Po,
|
|
212
|
+
toArray: Io,
|
|
213
|
+
toLEBuff: nc,
|
|
214
|
+
toNumber: Wa,
|
|
215
|
+
toRprBE: Ko,
|
|
216
|
+
toRprLE: Va,
|
|
217
|
+
toString: ec,
|
|
218
|
+
zero: ac
|
|
219
219
|
});
|
|
220
|
-
const
|
|
221
|
-
let
|
|
220
|
+
const ce = 1 << 30;
|
|
221
|
+
let cc = class xn {
|
|
222
222
|
constructor(t) {
|
|
223
223
|
this.buffers = [], this.byteLength = t;
|
|
224
|
-
for (let e = 0; e < t; e +=
|
|
225
|
-
const n = Math.min(t - e,
|
|
224
|
+
for (let e = 0; e < t; e += ce) {
|
|
225
|
+
const n = Math.min(t - e, ce);
|
|
226
226
|
this.buffers.push(new Uint8Array(n));
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
slice(t, e) {
|
|
230
230
|
e === void 0 && (e = this.byteLength), t === void 0 && (t = 0);
|
|
231
|
-
const n = e - t, a = Math.floor(t /
|
|
231
|
+
const n = e - t, a = Math.floor(t / ce), s = Math.floor((t + n - 1) / ce);
|
|
232
232
|
if (a == s || n == 0)
|
|
233
|
-
return this.buffers[a].slice(t %
|
|
234
|
-
let g, d = a, C = t %
|
|
233
|
+
return this.buffers[a].slice(t % ce, t % ce + n);
|
|
234
|
+
let g, d = a, C = t % ce, l = n;
|
|
235
235
|
for (; l > 0; ) {
|
|
236
|
-
const o = C + l >
|
|
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 <=
|
|
239
|
+
g || (n <= ce ? g = new Uint8Array(n) : g = new xn(n)), g.set(y, n - l), l = l - o, d++, C = 0;
|
|
240
240
|
}
|
|
241
241
|
return g;
|
|
242
242
|
}
|
|
@@ -245,20 +245,20 @@ let Yo = class xn {
|
|
|
245
245
|
const n = t.byteLength;
|
|
246
246
|
if (n == 0)
|
|
247
247
|
return;
|
|
248
|
-
const a = Math.floor(e /
|
|
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 %
|
|
251
|
-
let g = a, d = e %
|
|
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);
|
|
251
|
+
let g = a, d = e % ce, C = n;
|
|
252
252
|
for (; C > 0; ) {
|
|
253
|
-
const l = d + C >
|
|
253
|
+
const l = d + C > ce ? ce - d : C, o = t.slice(n - C, n - C + l);
|
|
254
254
|
new Uint8Array(this.buffers[g].buffer, this.buffers[g].byteOffset + d, l).set(o), C = C - l, g++, d = 0;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
function
|
|
258
|
+
function sc(c) {
|
|
259
259
|
return globalThis.btoa(c);
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
sc(`(function thread(self) {
|
|
262
262
|
const MAXMEM = 32767;
|
|
263
263
|
let instance;
|
|
264
264
|
let memory;
|
|
@@ -380,18 +380,18 @@ tc(`(function thread(self) {
|
|
|
380
380
|
})(self)`);
|
|
381
381
|
globalThis.curve_bn128 = null;
|
|
382
382
|
globalThis.curve_bls12381 = null;
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
async function
|
|
383
|
+
ve("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
|
|
384
|
+
ve("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
|
385
|
+
ve("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16);
|
|
386
|
+
ve("21888242871839275222246405745257275088696311157297823662689037894645226208583");
|
|
387
|
+
const Ha = oc;
|
|
388
|
+
async function Qa(c, t, e, n) {
|
|
389
389
|
if (e = e || 4096 * 64, typeof t != "number" && ["w+", "wx+", "r", "ax+", "a+"].indexOf(t) < 0)
|
|
390
390
|
throw new Error("Invalid open option");
|
|
391
|
-
const a = await
|
|
392
|
-
return new
|
|
391
|
+
const a = await Ua.promises.open(c, t), s = await a.stat();
|
|
392
|
+
return new rc(a, s, e, n, c);
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class rc {
|
|
395
395
|
constructor(t, e, n, a, s) {
|
|
396
396
|
for (this.fileName = s, this.fd = t, this.pos = 0, this.pageSize = a || 256; this.pageSize < e.blksize; )
|
|
397
397
|
this.pageSize *= 2;
|
|
@@ -564,7 +564,7 @@ class ec {
|
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
async discard() {
|
|
567
|
-
await this.close(), await
|
|
567
|
+
await this.close(), await Ua.promises.unlink(this.fileName);
|
|
568
568
|
}
|
|
569
569
|
async writeULE32(t, e) {
|
|
570
570
|
const n = this, a = new Uint8Array(4);
|
|
@@ -610,16 +610,16 @@ class ec {
|
|
|
610
610
|
return g;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const t = c.initialSize || 1048576, e = new
|
|
613
|
+
function lc(c) {
|
|
614
|
+
const t = c.initialSize || 1048576, e = new Ka();
|
|
615
615
|
return e.o = c, e.o.data = new Uint8Array(t), e.allocSize = t, e.totalSize = 0, e.readOnly = !1, e.pos = 0, e;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
const t = new
|
|
617
|
+
function uc(c) {
|
|
618
|
+
const t = new Ka();
|
|
619
619
|
return t.o = c, t.allocSize = c.data.byteLength, t.totalSize = c.data.byteLength, t.readOnly = !0, t.pos = 0, t;
|
|
620
620
|
}
|
|
621
|
-
const Sn = new Uint8Array(4), oa = new DataView(Sn.buffer),
|
|
622
|
-
class
|
|
621
|
+
const Sn = new Uint8Array(4), oa = new DataView(Sn.buffer), Ja = new Uint8Array(8), ca = new DataView(Ja.buffer);
|
|
622
|
+
class Ka {
|
|
623
623
|
constructor() {
|
|
624
624
|
this.pageSize = 16384;
|
|
625
625
|
}
|
|
@@ -664,7 +664,7 @@ class Qa {
|
|
|
664
664
|
}
|
|
665
665
|
async writeULE64(t, e) {
|
|
666
666
|
const n = this;
|
|
667
|
-
ca.setUint32(0, t & 4294967295, !0), ca.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(
|
|
667
|
+
ca.setUint32(0, t & 4294967295, !0), ca.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(Ja, e);
|
|
668
668
|
}
|
|
669
669
|
async readULE32(t) {
|
|
670
670
|
const n = await this.read(4, t);
|
|
@@ -696,8 +696,8 @@ class Qa {
|
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
const ne = 1 << 22;
|
|
699
|
-
function
|
|
700
|
-
const t = c.initialSize || 0, e = new
|
|
699
|
+
function dc(c) {
|
|
700
|
+
const t = c.initialSize || 0, e = new ti();
|
|
701
701
|
e.o = c;
|
|
702
702
|
const n = t ? Math.floor((t - 1) / ne) + 1 : 0;
|
|
703
703
|
e.o.data = [];
|
|
@@ -705,12 +705,12 @@ function ic(c) {
|
|
|
705
705
|
e.o.data.push(new Uint8Array(ne));
|
|
706
706
|
return n && e.o.data.push(new Uint8Array(t - ne * (n - 1))), e.totalSize = 0, e.readOnly = !1, e.pos = 0, e;
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
const t = new
|
|
708
|
+
function fc(c) {
|
|
709
|
+
const t = new ti();
|
|
710
710
|
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
711
|
}
|
|
712
|
-
const In = new Uint8Array(4), sa = new DataView(In.buffer),
|
|
713
|
-
class
|
|
712
|
+
const In = new Uint8Array(4), sa = new DataView(In.buffer), Ya = new Uint8Array(8), ra = new DataView(Ya.buffer);
|
|
713
|
+
class ti {
|
|
714
714
|
constructor() {
|
|
715
715
|
this.pageSize = 16384;
|
|
716
716
|
}
|
|
@@ -768,7 +768,7 @@ class Ka {
|
|
|
768
768
|
}
|
|
769
769
|
async writeULE64(t, e) {
|
|
770
770
|
const n = this;
|
|
771
|
-
ra.setUint32(0, t & 4294967295, !0), ra.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(
|
|
771
|
+
ra.setUint32(0, t & 4294967295, !0), ra.setUint32(4, Math.floor(t / 4294967296), !0), await n.write(Ya, e);
|
|
772
772
|
}
|
|
773
773
|
async readULE32(t) {
|
|
774
774
|
const n = await this.read(4, t);
|
|
@@ -803,26 +803,26 @@ class Ka {
|
|
|
803
803
|
return g;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
const
|
|
807
|
-
async function
|
|
806
|
+
const _c = 0, gc = 2, pc = 512, hc = 1024, ei = 65536, ni = 8192;
|
|
807
|
+
async function ai(c, t, e) {
|
|
808
808
|
if (typeof c == "string" && (c = {
|
|
809
809
|
type: "file",
|
|
810
810
|
fileName: c,
|
|
811
|
-
cacheSize: t ||
|
|
812
|
-
pageSize: e ||
|
|
811
|
+
cacheSize: t || ei,
|
|
812
|
+
pageSize: e || ni
|
|
813
813
|
}), c.type == "file")
|
|
814
|
-
return await
|
|
814
|
+
return await Qa(c.fileName, hc | pc | gc, c.cacheSize, c.pageSize);
|
|
815
815
|
if (c.type == "mem")
|
|
816
|
-
return
|
|
816
|
+
return lc(c);
|
|
817
817
|
if (c.type == "bigMem")
|
|
818
|
-
return
|
|
818
|
+
return dc(c);
|
|
819
819
|
throw new Error("Invalid FastFile type: " + c.type);
|
|
820
820
|
}
|
|
821
|
-
async function
|
|
821
|
+
async function ii(c, t, e) {
|
|
822
822
|
if (c instanceof Uint8Array && (c = {
|
|
823
823
|
type: "mem",
|
|
824
824
|
data: c
|
|
825
|
-
}),
|
|
825
|
+
}), Se.browser ? typeof c == "string" && (c = {
|
|
826
826
|
type: "mem",
|
|
827
827
|
data: await fetch(c).then(function(a) {
|
|
828
828
|
return a.arrayBuffer();
|
|
@@ -832,18 +832,18 @@ async function ni(c, t, e) {
|
|
|
832
832
|
}) : typeof c == "string" && (c = {
|
|
833
833
|
type: "file",
|
|
834
834
|
fileName: c,
|
|
835
|
-
cacheSize: t ||
|
|
836
|
-
pageSize: e ||
|
|
835
|
+
cacheSize: t || ei,
|
|
836
|
+
pageSize: e || ni
|
|
837
837
|
}), c.type == "file")
|
|
838
|
-
return await
|
|
838
|
+
return await Qa(c.fileName, _c, c.cacheSize, c.pageSize);
|
|
839
839
|
if (c.type == "mem")
|
|
840
|
-
return await
|
|
840
|
+
return await uc(c);
|
|
841
841
|
if (c.type == "bigMem")
|
|
842
|
-
return await
|
|
842
|
+
return await fc(c);
|
|
843
843
|
throw new Error("Invalid FastFile type: " + c.type);
|
|
844
844
|
}
|
|
845
845
|
async function la(c, t, e, n, a) {
|
|
846
|
-
const s = await
|
|
846
|
+
const s = await ii(c, n, a), g = await s.read(4);
|
|
847
847
|
let d = "";
|
|
848
848
|
for (let y = 0; y < 4; y++)
|
|
849
849
|
d += String.fromCharCode(g[y]);
|
|
@@ -862,8 +862,8 @@ async function la(c, t, e, n, a) {
|
|
|
862
862
|
}
|
|
863
863
|
return { fd: s, sections: o };
|
|
864
864
|
}
|
|
865
|
-
async function
|
|
866
|
-
const g = await
|
|
865
|
+
async function Lc(c, t, e, n, a, s) {
|
|
866
|
+
const g = await ai(c, a, s), d = new Uint8Array(4);
|
|
867
867
|
for (let C = 0; C < 4; C++)
|
|
868
868
|
d[C] = t.charCodeAt(C);
|
|
869
869
|
return await g.write(d, 0), await g.writeULE32(e), await g.writeULE32(n), g;
|
|
@@ -881,7 +881,7 @@ async function da(c) {
|
|
|
881
881
|
const t = c.pos - c.writingSection.pSectionSize - 8, e = c.pos;
|
|
882
882
|
c.pos = c.writingSection.pSectionSize, await c.writeULE64(t), c.pos = e, delete c.writingSection;
|
|
883
883
|
}
|
|
884
|
-
async function
|
|
884
|
+
async function We(c, t, e) {
|
|
885
885
|
if (typeof c.readingSection < "u")
|
|
886
886
|
throw new Error("Already reading a section");
|
|
887
887
|
if (!t[e])
|
|
@@ -890,63 +890,63 @@ async function Ge(c, t, e) {
|
|
|
890
890
|
throw new Error(c.fileName + ": Section Duplicated " + e);
|
|
891
891
|
c.pos = t[e][0].p, c.readingSection = t[e][0];
|
|
892
892
|
}
|
|
893
|
-
async function
|
|
893
|
+
async function Xe(c, t) {
|
|
894
894
|
if (typeof c.readingSection > "u")
|
|
895
895
|
throw new Error("Not reading a section");
|
|
896
896
|
if (!t && c.pos - c.readingSection.p != c.readingSection.size)
|
|
897
897
|
throw new Error("Invalid section size reading");
|
|
898
898
|
delete c.readingSection;
|
|
899
899
|
}
|
|
900
|
-
async function
|
|
900
|
+
async function mc(c, t, e, n) {
|
|
901
901
|
const a = new Uint8Array(e);
|
|
902
|
-
|
|
902
|
+
Ha.toRprLE(a, 0, t, e), await c.write(a, n);
|
|
903
903
|
}
|
|
904
|
-
async function
|
|
904
|
+
async function Be(c, t, e) {
|
|
905
905
|
const n = await c.read(t, e);
|
|
906
|
-
return
|
|
906
|
+
return Ha.fromRprLE(n, 0, t);
|
|
907
907
|
}
|
|
908
|
-
async function
|
|
908
|
+
async function Fe(c, t, e, n, a) {
|
|
909
909
|
if (n = typeof n > "u" ? 0 : n, a = typeof a > "u" ? t[e][0].size - n : a, n + a > t[e][0].size)
|
|
910
910
|
throw new Error("Reading out of the range of the section");
|
|
911
911
|
let s;
|
|
912
|
-
return a < 1 << 30 ? s = new Uint8Array(a) : s = new
|
|
912
|
+
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
913
|
}
|
|
914
|
-
const
|
|
915
|
-
function
|
|
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
916
|
if (!t || t == 10)
|
|
917
917
|
return BigInt(c);
|
|
918
918
|
if (t == 16)
|
|
919
919
|
return c.slice(0, 2) == "0x" ? BigInt(c) : BigInt("0x" + c);
|
|
920
920
|
}
|
|
921
|
-
const ee =
|
|
922
|
-
function
|
|
921
|
+
const ee = rn;
|
|
922
|
+
function yc(c, t) {
|
|
923
923
|
let e = BigInt(0);
|
|
924
924
|
t = BigInt(t);
|
|
925
925
|
for (let n = 0; n < c.length; n++)
|
|
926
926
|
e = e * t + BigInt(c[n]);
|
|
927
927
|
return e;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Ve(c) {
|
|
930
930
|
const t = c.toString(16);
|
|
931
|
-
return (t.length - 1) * 4 +
|
|
931
|
+
return (t.length - 1) * 4 + bc[parseInt(t[0], 16)];
|
|
932
932
|
}
|
|
933
|
-
function
|
|
933
|
+
function oi(c) {
|
|
934
934
|
return BigInt(c) < BigInt(0);
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function ci(c) {
|
|
937
937
|
return !c;
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function nn(c, t) {
|
|
940
940
|
return BigInt(c) << BigInt(t);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function Ie(c, t) {
|
|
943
943
|
return BigInt(c) >> BigInt(t);
|
|
944
944
|
}
|
|
945
|
-
const
|
|
945
|
+
const Cc = nn, Ac = Ie;
|
|
946
946
|
function jn(c) {
|
|
947
947
|
return (BigInt(c) & BigInt(1)) == BigInt(1);
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function Fc(c) {
|
|
950
950
|
let t = BigInt(c);
|
|
951
951
|
const e = [];
|
|
952
952
|
for (; t; ) {
|
|
@@ -959,19 +959,19 @@ function hc(c) {
|
|
|
959
959
|
}
|
|
960
960
|
return e;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function si(c) {
|
|
963
963
|
let t = BigInt(c);
|
|
964
964
|
const e = [];
|
|
965
965
|
for (; t; )
|
|
966
966
|
t & BigInt(1) ? e.push(1) : e.push(0), t = t >> BigInt(1);
|
|
967
967
|
return e;
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function ri(c) {
|
|
970
970
|
if (c > BigInt(Number.MAX_SAFE_INTEGER))
|
|
971
971
|
throw new Error("Number too big");
|
|
972
972
|
return Number(c);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function Ec(c, t) {
|
|
975
975
|
const e = [];
|
|
976
976
|
let n = BigInt(c);
|
|
977
977
|
for (t = BigInt(t); n; )
|
|
@@ -981,156 +981,156 @@ function Lc(c, t) {
|
|
|
981
981
|
function $n(c, t) {
|
|
982
982
|
return BigInt(c) + BigInt(t);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function Le(c, t) {
|
|
985
985
|
return BigInt(c) - BigInt(t);
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function li(c) {
|
|
988
988
|
return -BigInt(c);
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function ui(c, t) {
|
|
991
991
|
return BigInt(c) * BigInt(t);
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function wc(c) {
|
|
994
994
|
return BigInt(c) * BigInt(c);
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function He(c, t) {
|
|
997
997
|
return BigInt(c) ** BigInt(t);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Bc(c, t) {
|
|
1000
1000
|
return BigInt(c) ** BigInt(t);
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function vc(c) {
|
|
1003
1003
|
return BigInt(c) >= 0 ? BigInt(c) : -BigInt(c);
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function Oe(c, t) {
|
|
1006
1006
|
return BigInt(c) / BigInt(t);
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function ge(c, t) {
|
|
1009
1009
|
return BigInt(c) % BigInt(t);
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Ee(c, t) {
|
|
1012
1012
|
return BigInt(c) == BigInt(t);
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function xc(c, t) {
|
|
1015
1015
|
return BigInt(c) != BigInt(t);
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function Sc(c, t) {
|
|
1018
1018
|
return BigInt(c) < BigInt(t);
|
|
1019
1019
|
}
|
|
1020
1020
|
function On(c, t) {
|
|
1021
1021
|
return BigInt(c) > BigInt(t);
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function Ic(c, t) {
|
|
1024
1024
|
return BigInt(c) <= BigInt(t);
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function di(c, t) {
|
|
1027
1027
|
return BigInt(c) >= BigInt(t);
|
|
1028
1028
|
}
|
|
1029
1029
|
function Gn(c, t) {
|
|
1030
1030
|
return BigInt(c) & BigInt(t);
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Oc(c, t) {
|
|
1033
1033
|
return BigInt(c) | BigInt(t);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function Pc(c, t) {
|
|
1036
1036
|
return BigInt(c) ^ BigInt(t);
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function kc(c, t) {
|
|
1039
1039
|
return BigInt(c) && BigInt(t);
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Tc(c, t) {
|
|
1042
1042
|
return BigInt(c) || BigInt(t);
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function qc(c) {
|
|
1045
1045
|
return !BigInt(c);
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function Ge(c, t, e, n) {
|
|
1048
1048
|
const a = "0000000" + e.toString(16), s = new Uint32Array(c.buffer, t, n / 4), g = ((a.length - 7) * 4 - 1 >> 5) + 1;
|
|
1049
1049
|
for (let d = 0; d < g; d++)
|
|
1050
1050
|
s[d] = parseInt(a.substring(a.length - 8 * d - 8, a.length - 8 * d), 16);
|
|
1051
1051
|
for (let d = g; d < s.length; d++)
|
|
1052
1052
|
s[d] = 0;
|
|
1053
1053
|
for (let d = s.length * 4; d < n; d++)
|
|
1054
|
-
c[d] =
|
|
1054
|
+
c[d] = ri(Gn(Ie(e, d * 8), 255));
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1056
|
+
function fi(c, t, e, n) {
|
|
1057
1057
|
const a = "0000000" + e.toString(16), s = new DataView(c.buffer, c.byteOffset + t, n), g = ((a.length - 7) * 4 - 1 >> 5) + 1;
|
|
1058
1058
|
for (let d = 0; d < g; d++)
|
|
1059
1059
|
s.setUint32(n - d * 4 - 4, parseInt(a.substring(a.length - 8 * d - 8, a.length - 8 * d), 16), !1);
|
|
1060
1060
|
for (let d = 0; d < n / 4 - g; d++)
|
|
1061
1061
|
s[d] = 0;
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Ze(c, t, e) {
|
|
1064
1064
|
e = e || c.byteLength, t = t || 0;
|
|
1065
1065
|
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")),
|
|
1066
|
+
return n.forEach((s, g) => a[a.length - g - 1] = s.toString(16).padStart(8, "0")), rn(a.join(""), 16);
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function _i(c, t, e) {
|
|
1069
1069
|
e = e || c.byteLength, t = t || 0;
|
|
1070
1070
|
const n = new DataView(c.buffer, c.byteOffset + t, e), a = new Array(e / 4);
|
|
1071
1071
|
for (let s = 0; s < e / 4; s++)
|
|
1072
1072
|
a[s] = n.getUint32(s * 4, !1).toString(16).padStart(8, "0");
|
|
1073
|
-
return
|
|
1073
|
+
return rn(a.join(""), 16);
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function gi(c, t) {
|
|
1076
1076
|
return c.toString(t);
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const t = new Uint8Array(Math.floor((
|
|
1080
|
-
return
|
|
1078
|
+
function Pe(c) {
|
|
1079
|
+
const t = new Uint8Array(Math.floor((Ve(c) - 1) / 8) + 1);
|
|
1080
|
+
return Ge(t, 0, c, t.byteLength), t;
|
|
1081
1081
|
}
|
|
1082
|
-
const
|
|
1082
|
+
const pi = ee(0), we = ee(1), Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1083
1083
|
__proto__: null,
|
|
1084
|
-
abs:
|
|
1084
|
+
abs: vc,
|
|
1085
1085
|
add: $n,
|
|
1086
1086
|
band: Gn,
|
|
1087
|
-
bitLength:
|
|
1088
|
-
bits:
|
|
1089
|
-
bor:
|
|
1090
|
-
bxor:
|
|
1091
|
-
div:
|
|
1087
|
+
bitLength: Ve,
|
|
1088
|
+
bits: si,
|
|
1089
|
+
bor: Oc,
|
|
1090
|
+
bxor: Pc,
|
|
1091
|
+
div: Oe,
|
|
1092
1092
|
e: ee,
|
|
1093
|
-
eq:
|
|
1094
|
-
exp:
|
|
1095
|
-
fromArray:
|
|
1096
|
-
fromRprBE:
|
|
1097
|
-
fromRprLE:
|
|
1098
|
-
fromString:
|
|
1099
|
-
geq:
|
|
1093
|
+
eq: Ee,
|
|
1094
|
+
exp: Bc,
|
|
1095
|
+
fromArray: yc,
|
|
1096
|
+
fromRprBE: _i,
|
|
1097
|
+
fromRprLE: Ze,
|
|
1098
|
+
fromString: rn,
|
|
1099
|
+
geq: di,
|
|
1100
1100
|
gt: On,
|
|
1101
|
-
isNegative:
|
|
1101
|
+
isNegative: oi,
|
|
1102
1102
|
isOdd: jn,
|
|
1103
|
-
isZero:
|
|
1104
|
-
land:
|
|
1105
|
-
leq:
|
|
1106
|
-
lnot:
|
|
1107
|
-
lor:
|
|
1108
|
-
lt:
|
|
1109
|
-
mod:
|
|
1110
|
-
mul:
|
|
1111
|
-
naf:
|
|
1112
|
-
neg:
|
|
1113
|
-
neq:
|
|
1114
|
-
one:
|
|
1115
|
-
pow:
|
|
1116
|
-
shiftLeft:
|
|
1117
|
-
shiftRight:
|
|
1118
|
-
shl:
|
|
1119
|
-
shr:
|
|
1120
|
-
square:
|
|
1121
|
-
sub:
|
|
1122
|
-
toArray:
|
|
1123
|
-
toLEBuff:
|
|
1124
|
-
toNumber:
|
|
1125
|
-
toRprBE:
|
|
1126
|
-
toRprLE:
|
|
1127
|
-
toString:
|
|
1128
|
-
zero:
|
|
1103
|
+
isZero: ci,
|
|
1104
|
+
land: kc,
|
|
1105
|
+
leq: Ic,
|
|
1106
|
+
lnot: qc,
|
|
1107
|
+
lor: Tc,
|
|
1108
|
+
lt: Sc,
|
|
1109
|
+
mod: ge,
|
|
1110
|
+
mul: ui,
|
|
1111
|
+
naf: Fc,
|
|
1112
|
+
neg: li,
|
|
1113
|
+
neq: xc,
|
|
1114
|
+
one: we,
|
|
1115
|
+
pow: He,
|
|
1116
|
+
shiftLeft: nn,
|
|
1117
|
+
shiftRight: Ie,
|
|
1118
|
+
shl: Cc,
|
|
1119
|
+
shr: Ac,
|
|
1120
|
+
square: wc,
|
|
1121
|
+
sub: Le,
|
|
1122
|
+
toArray: Ec,
|
|
1123
|
+
toLEBuff: Pe,
|
|
1124
|
+
toNumber: ri,
|
|
1125
|
+
toRprBE: fi,
|
|
1126
|
+
toRprLE: Ge,
|
|
1127
|
+
toString: gi,
|
|
1128
|
+
zero: pi
|
|
1129
1129
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1130
1130
|
function fa(c, t, e) {
|
|
1131
|
-
if (
|
|
1131
|
+
if (ci(e))
|
|
1132
1132
|
return c.one;
|
|
1133
|
-
const n =
|
|
1133
|
+
const n = si(e);
|
|
1134
1134
|
if (n.length == 0)
|
|
1135
1135
|
return c.one;
|
|
1136
1136
|
let a = t;
|
|
@@ -1138,36 +1138,36 @@ function fa(c, t, e) {
|
|
|
1138
1138
|
a = c.square(a), n[s] && (a = c.mul(a, t));
|
|
1139
1139
|
return a;
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function Mc(c) {
|
|
1142
1142
|
if (c.m % 2 == 1)
|
|
1143
|
-
if (
|
|
1144
|
-
if (
|
|
1145
|
-
if (
|
|
1146
|
-
|
|
1147
|
-
else if (
|
|
1148
|
-
|
|
1143
|
+
if (Ee(ge(c.p, 4), 1))
|
|
1144
|
+
if (Ee(ge(c.p, 8), 1))
|
|
1145
|
+
if (Ee(ge(c.p, 16), 1))
|
|
1146
|
+
Rc(c);
|
|
1147
|
+
else if (Ee(ge(c.p, 16), 9))
|
|
1148
|
+
Nc(c);
|
|
1149
1149
|
else
|
|
1150
1150
|
throw new Error("Field withot sqrt");
|
|
1151
|
-
else if (
|
|
1152
|
-
|
|
1151
|
+
else if (Ee(ge(c.p, 8), 5))
|
|
1152
|
+
zc(c);
|
|
1153
1153
|
else
|
|
1154
1154
|
throw new Error("Field withot sqrt");
|
|
1155
1155
|
else
|
|
1156
|
-
|
|
1156
|
+
Ee(ge(c.p, 4), 3) && Uc(c);
|
|
1157
1157
|
else {
|
|
1158
|
-
const t =
|
|
1159
|
-
t == 1 ?
|
|
1158
|
+
const t = ge(He(c.p, c.m / 2), 4);
|
|
1159
|
+
t == 1 ? jc(c) : t == 3 ? $c(c) : Gc(c);
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
for (c.sqrt_q =
|
|
1164
|
-
c.sqrt_s = c.sqrt_s + 1, c.sqrt_t =
|
|
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
|
+
c.sqrt_s = c.sqrt_s + 1, c.sqrt_t = Oe(c.sqrt_t, 2);
|
|
1165
1165
|
let t = c.one;
|
|
1166
1166
|
for (; c.eq(t, c.one); ) {
|
|
1167
1167
|
const e = c.random();
|
|
1168
1168
|
c.sqrt_z = c.pow(e, c.sqrt_t), t = c.pow(c.sqrt_z, 2 ** (c.sqrt_s - 1));
|
|
1169
1169
|
}
|
|
1170
|
-
c.sqrt_tm1d2 =
|
|
1170
|
+
c.sqrt_tm1d2 = Oe(Le(c.sqrt_t, 1), 2), c.sqrt = function(e) {
|
|
1171
1171
|
const n = this;
|
|
1172
1172
|
if (n.isZero(e))
|
|
1173
1173
|
return n.zero;
|
|
@@ -1188,18 +1188,18 @@ function Oc(c) {
|
|
|
1188
1188
|
return n.geq(d, n.zero) ? d : n.neg(d);
|
|
1189
1189
|
};
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function Nc(c) {
|
|
1192
1192
|
c.sqrt = function() {
|
|
1193
1193
|
throw new Error("Sqrt alg 4 not implemented");
|
|
1194
1194
|
};
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function zc(c) {
|
|
1197
1197
|
c.sqrt = function() {
|
|
1198
1198
|
throw new Error("Sqrt alg 3 not implemented");
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
c.sqrt_q =
|
|
1201
|
+
function Uc(c) {
|
|
1202
|
+
c.sqrt_q = He(c.p, c.m), c.sqrt_e1 = Oe(Le(c.sqrt_q, 3), 4), c.sqrt = function(t) {
|
|
1203
1203
|
if (this.isZero(t))
|
|
1204
1204
|
return this.zero;
|
|
1205
1205
|
const e = this.pow(t, this.sqrt_e1), n = this.mul(this.square(e), t);
|
|
@@ -1209,13 +1209,13 @@ function Tc(c) {
|
|
|
1209
1209
|
return c.geq(a, c.zero) ? a : c.neg(a);
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function jc(c) {
|
|
1213
1213
|
c.sqrt = function() {
|
|
1214
1214
|
throw new Error("Sqrt alg 10 not implemented");
|
|
1215
1215
|
};
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1218
|
-
c.sqrt_q =
|
|
1217
|
+
function $c(c) {
|
|
1218
|
+
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
1219
|
return t % 2 == 1 ? c.conjugate(e) : e;
|
|
1220
1220
|
}, c.sqrt = function(t) {
|
|
1221
1221
|
const e = this, n = e.pow(t, e.sqrt_e34), a = e.mul(e.square(n), t), s = e.mul(e.frobenius(1, a), a);
|
|
@@ -1232,18 +1232,18 @@ function Dc(c) {
|
|
|
1232
1232
|
return e.geq(d, e.zero) ? d : e.neg(d);
|
|
1233
1233
|
};
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function Gc(c) {
|
|
1236
1236
|
c.sqrt = function() {
|
|
1237
1237
|
throw new Error("Sqrt alg 8 not implemented");
|
|
1238
1238
|
};
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function me(c, t, e, n, a) {
|
|
1241
1241
|
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
1242
|
}
|
|
1243
|
-
function
|
|
1244
|
-
|
|
1243
|
+
function Zc(c) {
|
|
1244
|
+
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
1245
|
}
|
|
1246
|
-
class
|
|
1246
|
+
class Wc {
|
|
1247
1247
|
constructor(t) {
|
|
1248
1248
|
t = t || [0, 0, 0, 0, 0, 0, 0, 0], this.state = [
|
|
1249
1249
|
1634760805,
|
|
@@ -1268,7 +1268,7 @@ class Nc {
|
|
|
1268
1268
|
return this.idx == 16 && this.update(), this.buff[this.idx++];
|
|
1269
1269
|
}
|
|
1270
1270
|
nextU64() {
|
|
1271
|
-
return $n(
|
|
1271
|
+
return $n(ui(this.nextU32(), 4294967296), this.nextU32());
|
|
1272
1272
|
}
|
|
1273
1273
|
nextBool() {
|
|
1274
1274
|
return (this.nextU32() & 1) == 1;
|
|
@@ -1277,35 +1277,37 @@ class Nc {
|
|
|
1277
1277
|
for (let t = 0; t < 16; t++)
|
|
1278
1278
|
this.buff[t] = this.state[t];
|
|
1279
1279
|
for (let t = 0; t < 10; t++)
|
|
1280
|
-
|
|
1280
|
+
Zc(this.buff);
|
|
1281
1281
|
for (let t = 0; t < 16; t++)
|
|
1282
1282
|
this.buff[t] = this.buff[t] + this.state[t] >>> 0;
|
|
1283
1283
|
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
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
|
|
1286
|
+
var Xc = po();
|
|
1287
|
+
const Vc = /* @__PURE__ */ ho(Xc);
|
|
1288
|
+
function hi(c) {
|
|
1287
1289
|
let t = new Uint8Array(c);
|
|
1288
|
-
if (
|
|
1290
|
+
if (Se.browser)
|
|
1289
1291
|
if (typeof globalThis.crypto < "u")
|
|
1290
1292
|
globalThis.crypto.getRandomValues(t);
|
|
1291
1293
|
else
|
|
1292
1294
|
for (let e = 0; e < c; e++)
|
|
1293
1295
|
t[e] = Math.random() * 4294967296 >>> 0;
|
|
1294
1296
|
else
|
|
1295
|
-
|
|
1297
|
+
Vc.randomFillSync(t);
|
|
1296
1298
|
return t;
|
|
1297
1299
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const c =
|
|
1300
|
+
function Hc() {
|
|
1301
|
+
const c = hi(32), t = new Uint32Array(c.buffer), e = [];
|
|
1300
1302
|
for (let n = 0; n < 8; n++)
|
|
1301
1303
|
e.push(t[n]);
|
|
1302
1304
|
return e;
|
|
1303
1305
|
}
|
|
1304
|
-
let
|
|
1306
|
+
let Ke = null;
|
|
1305
1307
|
function Zn() {
|
|
1306
|
-
return
|
|
1308
|
+
return Ke || (Ke = new Wc(Hc()), Ke);
|
|
1307
1309
|
}
|
|
1308
|
-
class
|
|
1310
|
+
class Qc {
|
|
1309
1311
|
constructor(t, e, n) {
|
|
1310
1312
|
this.F = e, this.G = t, this.opMulGF = n;
|
|
1311
1313
|
let a = e.sqrt_t || e.t, s = e.sqrt_s || e.s, g = e.one;
|
|
@@ -1334,7 +1336,7 @@ class Uc {
|
|
|
1334
1336
|
const n = 1 << e;
|
|
1335
1337
|
if (t.length != n)
|
|
1336
1338
|
throw new Error("Size must be multiple of 2");
|
|
1337
|
-
return
|
|
1339
|
+
return an(this, t, e, 0, 1);
|
|
1338
1340
|
}
|
|
1339
1341
|
ifft(t) {
|
|
1340
1342
|
if (t.length <= 1)
|
|
@@ -1344,7 +1346,7 @@ class Uc {
|
|
|
1344
1346
|
const n = 1 << e;
|
|
1345
1347
|
if (t.length != n)
|
|
1346
1348
|
throw new Error("Size must be multiple of 2");
|
|
1347
|
-
const a =
|
|
1349
|
+
const a = an(this, t, e, 0, 1), s = this.F.inv(this.F.mulScalar(this.F.one, n)), g = new Array(n);
|
|
1348
1350
|
for (let d = 0; d < n; d++)
|
|
1349
1351
|
g[d] = this.opMulGF(a[(n - d) % n], s);
|
|
1350
1352
|
return g;
|
|
@@ -1353,7 +1355,7 @@ class Uc {
|
|
|
1353
1355
|
function _a(c) {
|
|
1354
1356
|
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;
|
|
1355
1357
|
}
|
|
1356
|
-
function
|
|
1358
|
+
function an(c, t, e, n, a) {
|
|
1357
1359
|
const s = 1 << e;
|
|
1358
1360
|
if (s == 1)
|
|
1359
1361
|
return [t[n]];
|
|
@@ -1362,14 +1364,14 @@ function en(c, t, e, n, a) {
|
|
|
1362
1364
|
c.G.add(t[n], t[n + a]),
|
|
1363
1365
|
c.G.sub(t[n], t[n + a])
|
|
1364
1366
|
];
|
|
1365
|
-
const g = s >> 1, d =
|
|
1367
|
+
const g = s >> 1, d = an(c, t, e - 1, n, a * 2), C = an(c, t, e - 1, n + a, a * 2), l = new Array(s);
|
|
1366
1368
|
for (let o = 0; o < g; o++)
|
|
1367
1369
|
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]));
|
|
1368
1370
|
return l;
|
|
1369
1371
|
}
|
|
1370
|
-
class
|
|
1372
|
+
class Jc {
|
|
1371
1373
|
constructor(t) {
|
|
1372
|
-
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 =
|
|
1374
|
+
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);
|
|
1373
1375
|
const e = this.negone >> this.one;
|
|
1374
1376
|
this.nqr = this.two;
|
|
1375
1377
|
let n = this.pow(this.nqr, e);
|
|
@@ -1377,7 +1379,7 @@ class jc {
|
|
|
1377
1379
|
this.nqr = this.nqr + this.one, n = this.pow(this.nqr, e);
|
|
1378
1380
|
for (this.s = 0, this.t = this.negone; (this.t & this.one) == this.zero; )
|
|
1379
1381
|
this.s = this.s + 1, this.t = this.t >> this.one;
|
|
1380
|
-
this.nqr_to_t = this.pow(this.nqr, this.t),
|
|
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);
|
|
1381
1383
|
}
|
|
1382
1384
|
e(t, e) {
|
|
1383
1385
|
let n;
|
|
@@ -1529,7 +1531,7 @@ class jc {
|
|
|
1529
1531
|
const t = this.bitLength * 2 / 8;
|
|
1530
1532
|
let e = this.zero;
|
|
1531
1533
|
for (let n = 0; n < t; n++)
|
|
1532
|
-
e = (e << BigInt(8)) + BigInt(
|
|
1534
|
+
e = (e << BigInt(8)) + BigInt(hi(1)[0]);
|
|
1533
1535
|
return e % this.p;
|
|
1534
1536
|
}
|
|
1535
1537
|
toString(t, e) {
|
|
@@ -1558,11 +1560,11 @@ class jc {
|
|
|
1558
1560
|
}
|
|
1559
1561
|
// Returns a buffer with Little Endian Representation
|
|
1560
1562
|
toRprLE(t, e, n) {
|
|
1561
|
-
|
|
1563
|
+
Ge(t, e, n, this.n64 * 8);
|
|
1562
1564
|
}
|
|
1563
1565
|
// Returns a buffer with Big Endian Representation
|
|
1564
1566
|
toRprBE(t, e, n) {
|
|
1565
|
-
|
|
1567
|
+
fi(t, e, n, this.n64 * 8);
|
|
1566
1568
|
}
|
|
1567
1569
|
// Returns a buffer with Big Endian Montgomery Representation
|
|
1568
1570
|
toRprBEM(t, e, n) {
|
|
@@ -1573,11 +1575,11 @@ class jc {
|
|
|
1573
1575
|
}
|
|
1574
1576
|
// Pases a buffer with Little Endian Representation
|
|
1575
1577
|
fromRprLE(t, e) {
|
|
1576
|
-
return
|
|
1578
|
+
return Ze(t, e, this.n8);
|
|
1577
1579
|
}
|
|
1578
1580
|
// Pases a buffer with Big Endian Representation
|
|
1579
1581
|
fromRprBE(t, e) {
|
|
1580
|
-
return
|
|
1582
|
+
return _i(t, e, this.n8);
|
|
1581
1583
|
}
|
|
1582
1584
|
fromRprLEM(t, e) {
|
|
1583
1585
|
return this.mul(this.fromRprLE(t, e), this.Ri);
|
|
@@ -1589,25 +1591,25 @@ class jc {
|
|
|
1589
1591
|
return t;
|
|
1590
1592
|
}
|
|
1591
1593
|
}
|
|
1592
|
-
var
|
|
1593
|
-
|
|
1594
|
+
var ye = {};
|
|
1595
|
+
ye.bigInt2BytesLE = function(t, e) {
|
|
1594
1596
|
const n = Array(e);
|
|
1595
1597
|
let a = BigInt(t);
|
|
1596
1598
|
for (let s = 0; s < e; s++)
|
|
1597
1599
|
n[s] = Number(a & 0xFFn), a = a >> 8n;
|
|
1598
1600
|
return n;
|
|
1599
1601
|
};
|
|
1600
|
-
|
|
1602
|
+
ye.bigInt2U32LE = function(t, e) {
|
|
1601
1603
|
const n = Array(e);
|
|
1602
1604
|
let a = BigInt(t);
|
|
1603
1605
|
for (let s = 0; s < e; s++)
|
|
1604
1606
|
n[s] = Number(a & 0xFFFFFFFFn), a = a >> 32n;
|
|
1605
1607
|
return n;
|
|
1606
1608
|
};
|
|
1607
|
-
|
|
1609
|
+
ye.isOcamNum = function(c) {
|
|
1608
1610
|
return !(!Array.isArray(c) || c.length != 3 || typeof c[0] != "number" || typeof c[1] != "number" || !Array.isArray(c[2]));
|
|
1609
1611
|
};
|
|
1610
|
-
var
|
|
1612
|
+
var Kc = function(t, e, n) {
|
|
1611
1613
|
const a = n || "int";
|
|
1612
1614
|
if (t.modules[a])
|
|
1613
1615
|
return a;
|
|
@@ -2381,8 +2383,8 @@ var $c = function(t, e, n) {
|
|
|
2381
2383
|
);
|
|
2382
2384
|
return E;
|
|
2383
2385
|
}
|
|
2384
|
-
}, Xn =
|
|
2385
|
-
function
|
|
2386
|
+
}, Xn = Yc;
|
|
2387
|
+
function Yc(c, t) {
|
|
2386
2388
|
const e = c.modules[t].n64 * 8, n = c.addFunction(t + "_batchInverse");
|
|
2387
2389
|
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");
|
|
2388
2390
|
const a = n.getCodeBuilder(), s = a.i32_const(c.alloc(e));
|
|
@@ -2489,8 +2491,8 @@ function Gc(c, t) {
|
|
|
2489
2491
|
)
|
|
2490
2492
|
);
|
|
2491
2493
|
}
|
|
2492
|
-
var
|
|
2493
|
-
function
|
|
2494
|
+
var Li = ts;
|
|
2495
|
+
function ts(c, t, e, n, a, s) {
|
|
2494
2496
|
typeof s > "u" && (n < a ? s = !0 : s = !1);
|
|
2495
2497
|
const g = c.addFunction(t);
|
|
2496
2498
|
g.addParam("pIn", "i32"), g.addParam("n", "i32"), g.addParam("pOut", "i32"), g.addLocal("i", "i32"), g.addLocal("itIn", "i32"), g.addLocal("itOut", "i32");
|
|
@@ -2545,8 +2547,8 @@ function Zc(c, t, e, n, a, s) {
|
|
|
2545
2547
|
))
|
|
2546
2548
|
);
|
|
2547
2549
|
}
|
|
2548
|
-
var
|
|
2549
|
-
function
|
|
2550
|
+
var es = ns;
|
|
2551
|
+
function ns(c, t, e, n, a, s) {
|
|
2550
2552
|
typeof s > "u" && (n < a ? s = !0 : s = !1);
|
|
2551
2553
|
const g = c.addFunction(t);
|
|
2552
2554
|
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");
|
|
@@ -2617,61 +2619,61 @@ function Xc(c, t, e, n, a, s) {
|
|
|
2617
2619
|
))
|
|
2618
2620
|
);
|
|
2619
2621
|
}
|
|
2620
|
-
var
|
|
2621
|
-
function
|
|
2622
|
+
var le = {};
|
|
2623
|
+
function mi(c, t) {
|
|
2622
2624
|
return c === t ? 0 : c > t ? 1 : -1;
|
|
2623
2625
|
}
|
|
2624
2626
|
function Vn(c) {
|
|
2625
2627
|
return c * c;
|
|
2626
2628
|
}
|
|
2627
|
-
function
|
|
2629
|
+
function bi(c) {
|
|
2628
2630
|
return c % 2n !== 0n;
|
|
2629
2631
|
}
|
|
2630
2632
|
function Hn(c) {
|
|
2631
2633
|
return c % 2n === 0n;
|
|
2632
2634
|
}
|
|
2633
|
-
function
|
|
2635
|
+
function ln(c) {
|
|
2634
2636
|
return c < 0n;
|
|
2635
2637
|
}
|
|
2636
|
-
function
|
|
2638
|
+
function as(c) {
|
|
2637
2639
|
return c > 0n;
|
|
2638
2640
|
}
|
|
2639
|
-
function
|
|
2640
|
-
return
|
|
2641
|
+
function yi(c) {
|
|
2642
|
+
return ln(c) ? c.toString(2).length - 1 : c.toString(2).length;
|
|
2641
2643
|
}
|
|
2642
|
-
function
|
|
2644
|
+
function Qe(c) {
|
|
2643
2645
|
return c < 0n ? -c : c;
|
|
2644
2646
|
}
|
|
2645
|
-
function
|
|
2646
|
-
return
|
|
2647
|
+
function ke(c) {
|
|
2648
|
+
return Qe(c) === 1n;
|
|
2647
2649
|
}
|
|
2648
|
-
function
|
|
2649
|
-
for (var e = 0n, n = 1n, a = t, s =
|
|
2650
|
+
function Ci(c, t) {
|
|
2651
|
+
for (var e = 0n, n = 1n, a = t, s = Qe(c), g, d, C; s !== 0n; )
|
|
2650
2652
|
g = a / s, d = e, C = a, e = n, a = s, n = d - g * n, s = C - g * s;
|
|
2651
|
-
if (!
|
|
2653
|
+
if (!ke(a))
|
|
2652
2654
|
throw new Error(c.toString() + " and " + t.toString() + " are not co-prime");
|
|
2653
|
-
return
|
|
2655
|
+
return mi(e, 0n) === -1 && (e = e + t), ln(c) ? -e : e;
|
|
2654
2656
|
}
|
|
2655
|
-
function
|
|
2657
|
+
function Ai(c, t, e) {
|
|
2656
2658
|
if (e === 0n)
|
|
2657
2659
|
throw new Error("Cannot take modPow with modulus 0");
|
|
2658
2660
|
var n = 1n, a = c % e;
|
|
2659
|
-
for (
|
|
2661
|
+
for (ln(t) && (t = t * -1n, a = Ci(a, e)); as(t); ) {
|
|
2660
2662
|
if (a === 0n)
|
|
2661
2663
|
return 0n;
|
|
2662
|
-
|
|
2664
|
+
bi(t) && (n = n * a % e), t = t / 2n, a = Vn(a) % e;
|
|
2663
2665
|
}
|
|
2664
2666
|
return n;
|
|
2665
2667
|
}
|
|
2666
|
-
function
|
|
2668
|
+
function is(c, t) {
|
|
2667
2669
|
return c = c >= 0n ? c : -c, t = t >= 0n ? t : -t, c === t ? 0 : c > t ? 1 : -1;
|
|
2668
2670
|
}
|
|
2669
2671
|
function ga(c, t) {
|
|
2670
|
-
return t === 0n ? !1 :
|
|
2672
|
+
return t === 0n ? !1 : ke(t) ? !0 : is(t, 2n) === 0 ? Hn(c) : c % t === 0n;
|
|
2671
2673
|
}
|
|
2672
|
-
function
|
|
2673
|
-
var t =
|
|
2674
|
-
if (
|
|
2674
|
+
function os(c) {
|
|
2675
|
+
var t = Qe(c);
|
|
2676
|
+
if (ke(t))
|
|
2675
2677
|
return !1;
|
|
2676
2678
|
if (t === 2n || t === 3n || t === 5n)
|
|
2677
2679
|
return !0;
|
|
@@ -2680,17 +2682,17 @@ function Qc(c) {
|
|
|
2680
2682
|
if (t < 49n)
|
|
2681
2683
|
return !0;
|
|
2682
2684
|
}
|
|
2683
|
-
function
|
|
2685
|
+
function cs(c) {
|
|
2684
2686
|
return c - 1n;
|
|
2685
2687
|
}
|
|
2686
2688
|
function pa(c, t) {
|
|
2687
|
-
for (var e =
|
|
2689
|
+
for (var e = cs(c), n = e, a = 0, s, g, d; Hn(n); )
|
|
2688
2690
|
n = n / 2n, a++;
|
|
2689
2691
|
t:
|
|
2690
2692
|
for (g = 0; g < t.length; g++)
|
|
2691
|
-
if (!(c < t[g]) && (d =
|
|
2693
|
+
if (!(c < t[g]) && (d = Ai(BigInt(t[g]), n, c), !(ke(d) || d === e))) {
|
|
2692
2694
|
for (s = a - 1; s != 0; s--) {
|
|
2693
|
-
if (d = Vn(d) % c,
|
|
2695
|
+
if (d = Vn(d) % c, ke(d))
|
|
2694
2696
|
return !1;
|
|
2695
2697
|
if (d === e)
|
|
2696
2698
|
continue t;
|
|
@@ -2699,33 +2701,33 @@ function pa(c, t) {
|
|
|
2699
2701
|
}
|
|
2700
2702
|
return !0;
|
|
2701
2703
|
}
|
|
2702
|
-
function
|
|
2703
|
-
var t =
|
|
2704
|
+
function ss(c) {
|
|
2705
|
+
var t = os(c);
|
|
2704
2706
|
if (t !== void 0)
|
|
2705
2707
|
return t;
|
|
2706
|
-
var e =
|
|
2708
|
+
var e = Qe(c), n = yi(e);
|
|
2707
2709
|
if (n <= 64)
|
|
2708
2710
|
return pa(e, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
|
|
2709
2711
|
for (var a = Math.log(2) * Number(n), s = Math.ceil(a), g = [], d = 0; d < s; d++)
|
|
2710
2712
|
g.push(BigInt(d + 2));
|
|
2711
2713
|
return pa(e, g);
|
|
2712
2714
|
}
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
const
|
|
2715
|
+
le.bitLength = yi;
|
|
2716
|
+
le.isOdd = bi;
|
|
2717
|
+
le.isNegative = ln;
|
|
2718
|
+
le.abs = Qe;
|
|
2719
|
+
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;
|
|
2724
2726
|
var Qn = function(t, e, n, a) {
|
|
2725
|
-
const s = BigInt(e), g = Math.floor((
|
|
2727
|
+
const s = BigInt(e), g = Math.floor((ds(s - 1n) - 1) / 64) + 1, d = g * 2, C = g * 8, l = n || "f1m";
|
|
2726
2728
|
if (t.modules[l])
|
|
2727
2729
|
return l;
|
|
2728
|
-
const o =
|
|
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));
|
|
2729
2731
|
t.modules[l] = {
|
|
2730
2732
|
pq: y,
|
|
2731
2733
|
pR2: E,
|
|
@@ -2804,7 +2806,7 @@ var Qn = function(t, e, n, a) {
|
|
|
2804
2806
|
function j() {
|
|
2805
2807
|
const z = t.alloc(d * d * 8), b = t.addFunction(l + "_mReduct");
|
|
2806
2808
|
b.addParam("t", "i32"), b.addParam("r", "i32"), b.addLocal("np32", "i64"), b.addLocal("c", "i64"), b.addLocal("m", "i64");
|
|
2807
|
-
const it = b.getCodeBuilder(), At = Number(0x100000000n -
|
|
2809
|
+
const it = b.getCodeBuilder(), At = Number(0x100000000n - mn(s, 0x100000000n));
|
|
2808
2810
|
b.addCode(it.setLocal("np32", it.i64_const(At)));
|
|
2809
2811
|
for (let Lt = 0; Lt < d; Lt++) {
|
|
2810
2812
|
b.addCode(it.setLocal("c", it.i64_const(0))), b.addCode(
|
|
@@ -2866,7 +2868,7 @@ var Qn = function(t, e, n, a) {
|
|
|
2866
2868
|
z.addParam("x", "i32"), z.addParam("y", "i32"), z.addParam("r", "i32"), z.addLocal("c0", "i64"), z.addLocal("c1", "i64"), z.addLocal("np32", "i64");
|
|
2867
2869
|
for (let Et = 0; Et < d; Et++)
|
|
2868
2870
|
z.addLocal("x" + Et, "i64"), z.addLocal("y" + Et, "i64"), z.addLocal("m" + Et, "i64"), z.addLocal("q" + Et, "i64");
|
|
2869
|
-
const b = z.getCodeBuilder(), it = Number(0x100000000n -
|
|
2871
|
+
const b = z.getCodeBuilder(), it = Number(0x100000000n - mn(s, 0x100000000n));
|
|
2870
2872
|
z.addCode(b.setLocal("np32", b.i64_const(it)));
|
|
2871
2873
|
const At = [], Lt = [], yt = [];
|
|
2872
2874
|
function It(Et, bt) {
|
|
@@ -3005,7 +3007,7 @@ var Qn = function(t, e, n, a) {
|
|
|
3005
3007
|
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");
|
|
3006
3008
|
for (let bt = 0; bt < d; bt++)
|
|
3007
3009
|
z.addLocal("x" + bt, "i64"), z.addLocal("m" + bt, "i64"), z.addLocal("q" + bt, "i64");
|
|
3008
|
-
const b = z.getCodeBuilder(), it = Number(0x100000000n -
|
|
3010
|
+
const b = z.getCodeBuilder(), it = Number(0x100000000n - mn(s, 0x100000000n));
|
|
3009
3011
|
z.addCode(b.setLocal("np32", b.i64_const(it)));
|
|
3010
3012
|
const At = [], Lt = [];
|
|
3011
3013
|
function yt(bt, pt) {
|
|
@@ -3252,9 +3254,9 @@ var Qn = function(t, e, n, a) {
|
|
|
3252
3254
|
for (; ha(nt, L, s) !== O; )
|
|
3253
3255
|
nt = nt + 1n;
|
|
3254
3256
|
let J = 0, ft = O;
|
|
3255
|
-
for (; !
|
|
3257
|
+
for (; !fs(ft) && ft !== 0n; )
|
|
3256
3258
|
J++, ft = ft >> 1n;
|
|
3257
|
-
const at = t.alloc(C,
|
|
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));
|
|
3258
3260
|
function P() {
|
|
3259
3261
|
const z = t.addFunction(l + "_sqrt");
|
|
3260
3262
|
z.addParam("n", "i32"), z.addParam("r", "i32"), z.addLocal("m", "i32"), z.addLocal("i", "i32"), z.addLocal("j", "i32");
|
|
@@ -3378,7 +3380,7 @@ var Qn = function(t, e, n, a) {
|
|
|
3378
3380
|
b.ret(b.call(o + "_eq", b.getLocal("x"), b.i32_const(m)))
|
|
3379
3381
|
);
|
|
3380
3382
|
}
|
|
3381
|
-
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(),
|
|
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(
|
|
3382
3384
|
t,
|
|
3383
3385
|
l + "_exp",
|
|
3384
3386
|
C,
|
|
@@ -3388,15 +3390,15 @@ var Qn = function(t, e, n, a) {
|
|
|
3388
3390
|
l + "_one"
|
|
3389
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;
|
|
3390
3392
|
};
|
|
3391
|
-
const
|
|
3392
|
-
var
|
|
3393
|
-
const g = BigInt(e), d = Math.floor((
|
|
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";
|
|
3394
3396
|
if (t.modules[l])
|
|
3395
3397
|
return l;
|
|
3396
3398
|
t.modules[l] = {
|
|
3397
3399
|
n64: d
|
|
3398
3400
|
};
|
|
3399
|
-
const o = s || "int", y =
|
|
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;
|
|
3400
3402
|
function O() {
|
|
3401
3403
|
const U = t.alloc(C), w = t.addFunction(l + "_mul");
|
|
3402
3404
|
w.addParam("x", "i32"), w.addParam("y", "i32"), w.addParam("r", "i32");
|
|
@@ -3425,8 +3427,8 @@ var Ci = function(t, e, n, a, s) {
|
|
|
3425
3427
|
}
|
|
3426
3428
|
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;
|
|
3427
3429
|
};
|
|
3428
|
-
const
|
|
3429
|
-
var
|
|
3430
|
+
const hs = Wn, Ls = Xn, bn = ye;
|
|
3431
|
+
var Ei = function(t, e, n, a) {
|
|
3430
3432
|
if (t.modules[n])
|
|
3431
3433
|
return n;
|
|
3432
3434
|
const s = t.modules[a].n64 * 8, g = t.modules[a].q;
|
|
@@ -3659,7 +3661,7 @@ var Ai = function(t, e, n, a) {
|
|
|
3659
3661
|
function j() {
|
|
3660
3662
|
const D = t.addFunction(n + "_sqrt");
|
|
3661
3663
|
D.addParam("a", "i32"), D.addParam("pr", "i32");
|
|
3662
|
-
const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(
|
|
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));
|
|
3663
3665
|
D.addCode(
|
|
3664
3666
|
A.call(n + "_one", _t),
|
|
3665
3667
|
A.call(n + "_neg", _t, _t),
|
|
@@ -3698,7 +3700,7 @@ var Ai = function(t, e, n, a) {
|
|
|
3698
3700
|
function T() {
|
|
3699
3701
|
const D = t.addFunction(n + "_isSquare");
|
|
3700
3702
|
D.addParam("a", "i32"), D.setReturnType("i32");
|
|
3701
|
-
const A = D.getCodeBuilder(), M = A.i32_const(t.alloc(
|
|
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);
|
|
3702
3704
|
D.addCode(
|
|
3703
3705
|
A.call(n + "_one", at),
|
|
3704
3706
|
A.call(n + "_neg", at, at),
|
|
@@ -3722,7 +3724,7 @@ var Ai = function(t, e, n, a) {
|
|
|
3722
3724
|
A.ret(A.i32_const(1))
|
|
3723
3725
|
);
|
|
3724
3726
|
}
|
|
3725
|
-
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"),
|
|
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(
|
|
3726
3728
|
t,
|
|
3727
3729
|
n + "_exp",
|
|
3728
3730
|
s * 2,
|
|
@@ -3732,8 +3734,8 @@ var Ai = function(t, e, n, a) {
|
|
|
3732
3734
|
n + "_one"
|
|
3733
3735
|
), 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;
|
|
3734
3736
|
};
|
|
3735
|
-
const
|
|
3736
|
-
var
|
|
3737
|
+
const ms = Wn, bs = Xn;
|
|
3738
|
+
var wi = function(t, e, n, a) {
|
|
3737
3739
|
if (t.modules[n])
|
|
3738
3740
|
return n;
|
|
3739
3741
|
const s = t.modules[a].n64 * 8;
|
|
@@ -3990,7 +3992,7 @@ var Fi = function(t, e, n, a) {
|
|
|
3990
3992
|
)
|
|
3991
3993
|
);
|
|
3992
3994
|
}
|
|
3993
|
-
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"),
|
|
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(
|
|
3994
3996
|
t,
|
|
3995
3997
|
n + "_exp",
|
|
3996
3998
|
s * 3,
|
|
@@ -3999,7 +4001,7 @@ var Fi = function(t, e, n, a) {
|
|
|
3999
4001
|
n + "_copy",
|
|
4000
4002
|
n + "_one"
|
|
4001
4003
|
), t.exportFunction(n + "_exp"), t.exportFunction(n + "_timesScalar"), t.exportFunction(n + "_batchInverse"), t.exportFunction(n + "_isNegative"), n;
|
|
4002
|
-
},
|
|
4004
|
+
}, ys = function(t, e, n, a, s, g, d, C) {
|
|
4003
4005
|
const l = t.addFunction(e);
|
|
4004
4006
|
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");
|
|
4005
4007
|
const o = l.getCodeBuilder(), y = o.i32_const(t.alloc(n));
|
|
@@ -4182,7 +4184,7 @@ var Fi = function(t, e, n, a) {
|
|
|
4182
4184
|
)),
|
|
4183
4185
|
o.i32_store(o.i32_const(0), o.getLocal("old0"))
|
|
4184
4186
|
);
|
|
4185
|
-
},
|
|
4187
|
+
}, Cs = function(t, e, n, a, s) {
|
|
4186
4188
|
const d = t.modules[e].n64 * 8;
|
|
4187
4189
|
function C() {
|
|
4188
4190
|
const E = t.addFunction(n + "_getChunk");
|
|
@@ -4574,8 +4576,8 @@ var Fi = function(t, e, n, a) {
|
|
|
4574
4576
|
}
|
|
4575
4577
|
C(), y(), l(), o(), t.exportFunction(n), t.exportFunction(n + "_chunk");
|
|
4576
4578
|
};
|
|
4577
|
-
const ma =
|
|
4578
|
-
var
|
|
4579
|
+
const ma = ys, Me = Li, ba = Cs;
|
|
4580
|
+
var Bi = function(t, e, n, a) {
|
|
4579
4581
|
const s = t.modules[n].n64, g = s * 8;
|
|
4580
4582
|
if (t.modules[e])
|
|
4581
4583
|
return e;
|
|
@@ -4933,7 +4935,7 @@ var Ei = function(t, e, n, a) {
|
|
|
4933
4935
|
P.addCode(i.setLocal("z1", i.i32_add(i.getLocal("p1"), i.i32_const(g * 2))));
|
|
4934
4936
|
const W = i.getLocal("z1"), z = i.getLocal("p2"), b = i.i32_add(i.getLocal("p2"), i.i32_const(g));
|
|
4935
4937
|
P.addCode(i.setLocal("z2", i.i32_add(i.getLocal("p2"), i.i32_const(g * 2))));
|
|
4936
|
-
const it = i.getLocal("z2"), At = i.getLocal("pr"), Lt = i.i32_add(i.getLocal("pr"), i.i32_const(g)), yt = i.i32_add(i.getLocal("pr"), i.i32_const(g * 2)), It = i.i32_const(t.alloc(g)), mt = i.i32_const(t.alloc(g)), Ot = i.i32_const(t.alloc(g)), jt = i.i32_const(t.alloc(g)), Et = i.i32_const(t.alloc(g)), bt = i.i32_const(t.alloc(g)), pt = i.i32_const(t.alloc(g)), $t = i.i32_const(t.alloc(g)), Jt = i.i32_const(t.alloc(g)),
|
|
4938
|
+
const it = i.getLocal("z2"), At = i.getLocal("pr"), Lt = i.i32_add(i.getLocal("pr"), i.i32_const(g)), yt = i.i32_add(i.getLocal("pr"), i.i32_const(g * 2)), It = i.i32_const(t.alloc(g)), mt = i.i32_const(t.alloc(g)), Ot = i.i32_const(t.alloc(g)), jt = i.i32_const(t.alloc(g)), Et = i.i32_const(t.alloc(g)), bt = i.i32_const(t.alloc(g)), pt = i.i32_const(t.alloc(g)), $t = i.i32_const(t.alloc(g)), Jt = i.i32_const(t.alloc(g)), re = i.i32_const(t.alloc(g)), te = i.i32_const(t.alloc(g)), Pt = i.i32_const(t.alloc(g)), Dt = i.i32_const(t.alloc(g)), Zt = i.i32_const(t.alloc(g)), vt = i.i32_const(t.alloc(g)), Wt = i.i32_const(t.alloc(g)), wt = i.i32_const(t.alloc(g));
|
|
4937
4939
|
P.addCode(
|
|
4938
4940
|
i.if(
|
|
4939
4941
|
i.call(e + "_isZero", i.getLocal("p1")),
|
|
@@ -4982,11 +4984,11 @@ var Ei = function(t, e, n, a) {
|
|
|
4982
4984
|
)
|
|
4983
4985
|
),
|
|
4984
4986
|
i.call(n + "_sub", jt, Ot, Jt),
|
|
4985
|
-
i.call(n + "_sub", $t, pt,
|
|
4987
|
+
i.call(n + "_sub", $t, pt, re),
|
|
4986
4988
|
i.call(n + "_add", Jt, Jt, te),
|
|
4987
4989
|
i.call(n + "_square", te, te),
|
|
4988
4990
|
i.call(n + "_mul", Jt, te, Pt),
|
|
4989
|
-
i.call(n + "_add",
|
|
4991
|
+
i.call(n + "_add", re, re, Dt),
|
|
4990
4992
|
i.call(n + "_mul", Ot, te, vt),
|
|
4991
4993
|
i.call(n + "_square", Dt, Zt),
|
|
4992
4994
|
i.call(n + "_add", vt, vt, Wt),
|
|
@@ -5009,7 +5011,7 @@ var Ei = function(t, e, n, a) {
|
|
|
5009
5011
|
P.addParam("p1", "i32"), P.addParam("p2", "i32"), P.addParam("pr", "i32"), P.addLocal("z1", "i32");
|
|
5010
5012
|
const i = P.getCodeBuilder(), q = i.getLocal("p1"), u = i.i32_add(i.getLocal("p1"), i.i32_const(g));
|
|
5011
5013
|
P.addCode(i.setLocal("z1", i.i32_add(i.getLocal("p1"), i.i32_const(g * 2))));
|
|
5012
|
-
const W = i.getLocal("z1"), z = i.getLocal("p2"), b = i.i32_add(i.getLocal("p2"), i.i32_const(g)), it = i.getLocal("pr"), At = i.i32_add(i.getLocal("pr"), i.i32_const(g)), Lt = i.i32_add(i.getLocal("pr"), i.i32_const(g * 2)), yt = i.i32_const(t.alloc(g)), It = i.i32_const(t.alloc(g)), mt = i.i32_const(t.alloc(g)), Ot = i.i32_const(t.alloc(g)), jt = i.i32_const(t.alloc(g)), Et = i.i32_const(t.alloc(g)), bt = i.i32_const(t.alloc(g)), pt = i.i32_const(t.alloc(g)), $t = i.i32_const(t.alloc(g)), Jt = i.i32_const(t.alloc(g)),
|
|
5014
|
+
const W = i.getLocal("z1"), z = i.getLocal("p2"), b = i.i32_add(i.getLocal("p2"), i.i32_const(g)), it = i.getLocal("pr"), At = i.i32_add(i.getLocal("pr"), i.i32_const(g)), Lt = i.i32_add(i.getLocal("pr"), i.i32_const(g * 2)), yt = i.i32_const(t.alloc(g)), It = i.i32_const(t.alloc(g)), mt = i.i32_const(t.alloc(g)), Ot = i.i32_const(t.alloc(g)), jt = i.i32_const(t.alloc(g)), Et = i.i32_const(t.alloc(g)), bt = i.i32_const(t.alloc(g)), pt = i.i32_const(t.alloc(g)), $t = i.i32_const(t.alloc(g)), Jt = i.i32_const(t.alloc(g)), re = i.i32_const(t.alloc(g)), te = i.i32_const(t.alloc(g)), Pt = i.i32_const(t.alloc(g)), Dt = i.i32_const(t.alloc(g));
|
|
5013
5015
|
P.addCode(
|
|
5014
5016
|
i.if(
|
|
5015
5017
|
i.call(e + "_isZero", i.getLocal("p1")),
|
|
@@ -5055,9 +5057,9 @@ var Ei = function(t, e, n, a) {
|
|
|
5055
5057
|
i.call(n + "_mul", jt, pt, $t),
|
|
5056
5058
|
i.call(n + "_add", bt, bt, Jt),
|
|
5057
5059
|
i.call(n + "_mul", q, pt, te),
|
|
5058
|
-
i.call(n + "_square", Jt,
|
|
5060
|
+
i.call(n + "_square", Jt, re),
|
|
5059
5061
|
i.call(n + "_add", te, te, Pt),
|
|
5060
|
-
i.call(n + "_sub",
|
|
5062
|
+
i.call(n + "_sub", re, $t, it),
|
|
5061
5063
|
i.call(n + "_sub", it, Pt, it),
|
|
5062
5064
|
i.call(n + "_mul", u, $t, Dt),
|
|
5063
5065
|
i.call(n + "_add", Dt, Dt, Dt),
|
|
@@ -5473,7 +5475,7 @@ var Ei = function(t, e, n, a) {
|
|
|
5473
5475
|
)
|
|
5474
5476
|
);
|
|
5475
5477
|
}
|
|
5476
|
-
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(),
|
|
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(
|
|
5477
5479
|
t,
|
|
5478
5480
|
e + "_timesScalar",
|
|
5479
5481
|
g * 3,
|
|
@@ -5493,24 +5495,24 @@ var Ei = function(t, e, n, a) {
|
|
|
5493
5495
|
e + "_zero"
|
|
5494
5496
|
), 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;
|
|
5495
5497
|
};
|
|
5496
|
-
const { isOdd:
|
|
5497
|
-
var
|
|
5498
|
+
const { isOdd: As, modInv: ya, modPow: Re } = le, Ye = ye;
|
|
5499
|
+
var vi = function(t, e, n, a, s) {
|
|
5498
5500
|
const d = t.modules[a].n64 * 8, l = t.modules[n].n64 * 8, o = t.modules[a].q;
|
|
5499
5501
|
let y = o - 1n, E = 0;
|
|
5500
|
-
for (; !
|
|
5502
|
+
for (; !As(y); )
|
|
5501
5503
|
E++, y = y >> 1n;
|
|
5502
5504
|
let m = 2n;
|
|
5503
|
-
for (;
|
|
5505
|
+
for (; Re(m, o >> 1n, o) === 1n; )
|
|
5504
5506
|
m = m + 1n;
|
|
5505
5507
|
const x = new Array(E + 1);
|
|
5506
|
-
x[E] =
|
|
5508
|
+
x[E] = Re(m, y, o);
|
|
5507
5509
|
let O = E - 1;
|
|
5508
5510
|
for (; O >= 0; )
|
|
5509
|
-
x[O] =
|
|
5511
|
+
x[O] = Re(x[O + 1], 2n, o), O--;
|
|
5510
5512
|
const L = [], I = (1n << BigInt(d * 8)) % o;
|
|
5511
5513
|
for (let q = 0; q < x.length; q++) {
|
|
5512
5514
|
const u = x[q] * I % o;
|
|
5513
|
-
L.push(...
|
|
5515
|
+
L.push(...Ye.bigInt2BytesLE(u, d));
|
|
5514
5516
|
}
|
|
5515
5517
|
const v = t.alloc(L), U = new Array(E + 1);
|
|
5516
5518
|
U[0] = 1n;
|
|
@@ -5519,12 +5521,12 @@ var wi = function(t, e, n, a, s) {
|
|
|
5519
5521
|
const w = [];
|
|
5520
5522
|
for (let q = 0; q <= E; q++) {
|
|
5521
5523
|
const u = ya(U[q], o) * I % o;
|
|
5522
|
-
w.push(...
|
|
5524
|
+
w.push(...Ye.bigInt2BytesLE(u, d));
|
|
5523
5525
|
}
|
|
5524
|
-
const S = t.alloc(w), F =
|
|
5526
|
+
const S = t.alloc(w), F = Re(m, 2n, o), r = [], h = [];
|
|
5525
5527
|
for (let q = 0; q <= E; q++) {
|
|
5526
|
-
const u =
|
|
5527
|
-
r.push(...
|
|
5528
|
+
const u = Re(F, 2n ** BigInt(q), o), W = ya(o + 1n - u, o);
|
|
5529
|
+
r.push(...Ye.bigInt2BytesLE(u * I % o, d)), h.push(...Ye.bigInt2BytesLE(W * I % o, d));
|
|
5528
5530
|
}
|
|
5529
5531
|
const R = t.alloc(r), j = t.alloc(h);
|
|
5530
5532
|
function T(q) {
|
|
@@ -6516,7 +6518,7 @@ var wi = function(t, e, n, a, s) {
|
|
|
6516
6518
|
);
|
|
6517
6519
|
}
|
|
6518
6520
|
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");
|
|
6519
|
-
},
|
|
6521
|
+
}, xi = function(t, e, n) {
|
|
6520
6522
|
const s = t.modules[n].n64 * 8;
|
|
6521
6523
|
function g() {
|
|
6522
6524
|
const C = t.addFunction(e + "_zero");
|
|
@@ -6609,7 +6611,7 @@ var wi = function(t, e, n, a, s) {
|
|
|
6609
6611
|
);
|
|
6610
6612
|
}
|
|
6611
6613
|
return g(), d(), t.exportFunction(e + "_zero"), t.exportFunction(e + "_constructLC"), e;
|
|
6612
|
-
},
|
|
6614
|
+
}, Si = function(t, e, n) {
|
|
6613
6615
|
const s = t.modules[n].n64 * 8;
|
|
6614
6616
|
function g() {
|
|
6615
6617
|
const l = t.addFunction(e + "_buildABC");
|
|
@@ -6879,7 +6881,7 @@ var wi = function(t, e, n, a, s) {
|
|
|
6879
6881
|
);
|
|
6880
6882
|
}
|
|
6881
6883
|
return g(), d(), C(), t.exportFunction(e + "_buildABC"), t.exportFunction(e + "_joinABC"), t.exportFunction(e + "_batchAdd"), e;
|
|
6882
|
-
},
|
|
6884
|
+
}, Ii = function(t, e, n, a, s, g, d, C) {
|
|
6883
6885
|
const l = t.addFunction(e);
|
|
6884
6886
|
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");
|
|
6885
6887
|
const o = l.getCodeBuilder(), y = o.i32_const(t.alloc(d));
|
|
@@ -6916,15 +6918,15 @@ var wi = function(t, e, n, a, s) {
|
|
|
6916
6918
|
))
|
|
6917
6919
|
), t.exportFunction(e);
|
|
6918
6920
|
};
|
|
6919
|
-
const Nt =
|
|
6920
|
-
var
|
|
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) {
|
|
6921
6923
|
const n = e || "bn128";
|
|
6922
6924
|
if (t.modules[n])
|
|
6923
6925
|
return n;
|
|
6924
|
-
const a = 21888242871839275222246405745257275088696311157297823662689037894645226208583n, s = 21888242871839275222246405745257275088548364400416034343698204186575808495617n, g = Math.floor((
|
|
6925
|
-
|
|
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");
|
|
6926
6928
|
const x = t.alloc(Nt.bigInt2BytesLE(w(3n), l)), O = Aa(t, "g1m", "f1m", x);
|
|
6927
|
-
|
|
6929
|
+
yn(t, "frm", "frm", "frm", "frm_mul"), Bs(t, "pol", "frm"), vs(t, "qap", "frm");
|
|
6928
6930
|
const L = Ca(t, "f1m_neg", "f2m", "f1m"), I = t.alloc([
|
|
6929
6931
|
...Nt.bigInt2BytesLE(w(19485874751759354771024239261021720505790618469301721065564631296452457478373n), l),
|
|
6930
6932
|
...Nt.bigInt2BytesLE(w(266929791119991161246907387137283842545076965332900288569378510910307636690n), l)
|
|
@@ -6944,7 +6946,7 @@ var As = function(t, e) {
|
|
|
6944
6946
|
)
|
|
6945
6947
|
), t.exportFunction(Y);
|
|
6946
6948
|
}
|
|
6947
|
-
U("g1m_timesFr", "g1m_timesScalar"),
|
|
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");
|
|
6948
6950
|
function w(Y) {
|
|
6949
6951
|
return BigInt(Y) * (1n << BigInt(l * 8)) % a;
|
|
6950
6952
|
}
|
|
@@ -7029,7 +7031,7 @@ var As = function(t, e) {
|
|
|
7029
7031
|
...Nt.bigInt2BytesLE(w(9), l),
|
|
7030
7032
|
...Nt.bigInt2BytesLE(w(1), l)
|
|
7031
7033
|
]), H = t.alloc([
|
|
7032
|
-
...Nt.bigInt2BytesLE(w(
|
|
7034
|
+
...Nt.bigInt2BytesLE(w(Ss(2n, a)), l),
|
|
7033
7035
|
...Nt.bigInt2BytesLE(0n, l)
|
|
7034
7036
|
]), ut = M, nt = t.alloc([
|
|
7035
7037
|
...Nt.bigInt2BytesLE(w(19485874751759354771024239261021720505790618469301721065564631296452457478373n), l),
|
|
@@ -7049,7 +7051,7 @@ var As = function(t, e) {
|
|
|
7049
7051
|
);
|
|
7050
7052
|
}
|
|
7051
7053
|
J();
|
|
7052
|
-
const ft =
|
|
7054
|
+
const ft = ws(t, n + "_mulNR6", "f6m", "f2m");
|
|
7053
7055
|
function at() {
|
|
7054
7056
|
const Y = t.addFunction(n + "_mulNR12");
|
|
7055
7057
|
Y.addParam("x", "i32"), Y.addParam("pr", "i32");
|
|
@@ -7503,7 +7505,7 @@ var As = function(t, e) {
|
|
|
7503
7505
|
(ct * rt - st * ot) % a,
|
|
7504
7506
|
(ct * ot + st * rt) % a
|
|
7505
7507
|
];
|
|
7506
|
-
return
|
|
7508
|
+
return Is(gt[0]) && (gt[0] = gt[0] + a), gt;
|
|
7507
7509
|
}
|
|
7508
7510
|
}
|
|
7509
7511
|
function $t() {
|
|
@@ -7598,7 +7600,7 @@ var As = function(t, e) {
|
|
|
7598
7600
|
f.call(L + "_add", Tt, Bt, Bt)
|
|
7599
7601
|
);
|
|
7600
7602
|
}
|
|
7601
|
-
function
|
|
7603
|
+
function re(Y, f) {
|
|
7602
7604
|
const _ = it(Y).map((st) => st == -1 ? 255 : st), Z = t.alloc(_), Q = t.addFunction(n + "__cyclotomicExp_" + f);
|
|
7603
7605
|
Q.addParam("x", "i32"), Q.addParam("r", "i32"), Q.addLocal("bit", "i32"), Q.addLocal("i", "i32");
|
|
7604
7606
|
const $ = Q.getCodeBuilder(), tt = $.getLocal("x"), V = $.getLocal("r"), ct = $.i32_const(t.alloc(y));
|
|
@@ -7637,7 +7639,7 @@ var As = function(t, e) {
|
|
|
7637
7639
|
);
|
|
7638
7640
|
}
|
|
7639
7641
|
function te() {
|
|
7640
|
-
Jt(),
|
|
7642
|
+
Jt(), re(b, "w0");
|
|
7641
7643
|
const Y = t.addFunction(n + "__finalExponentiationLastChunk");
|
|
7642
7644
|
Y.addParam("x", "i32"), Y.addParam("r", "i32");
|
|
7643
7645
|
const f = Y.getCodeBuilder(), _ = f.getLocal("x"), Z = f.getLocal("r"), Q = f.i32_const(t.alloc(y)), $ = f.i32_const(t.alloc(y)), tt = f.i32_const(t.alloc(y)), V = f.i32_const(t.alloc(y)), ct = f.i32_const(t.alloc(y)), st = f.i32_const(t.alloc(y)), rt = f.i32_const(t.alloc(y)), ot = f.i32_const(t.alloc(y)), gt = f.i32_const(t.alloc(y)), Bt = f.i32_const(t.alloc(y)), Ft = f.i32_const(t.alloc(y)), ht = f.i32_const(t.alloc(y)), xt = f.i32_const(t.alloc(y)), Tt = f.i32_const(t.alloc(y)), Ut = f.i32_const(t.alloc(y)), St = f.i32_const(t.alloc(y)), kt = f.i32_const(t.alloc(y)), k = f.i32_const(t.alloc(y)), et = f.i32_const(t.alloc(y)), dt = f.i32_const(t.alloc(y)), qt = f.i32_const(t.alloc(y));
|
|
@@ -7736,15 +7738,15 @@ var As = function(t, e) {
|
|
|
7736
7738
|
Wt(Y), t.exportFunction(n + "_pairingEq" + Y);
|
|
7737
7739
|
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");
|
|
7738
7740
|
};
|
|
7739
|
-
const Mt =
|
|
7740
|
-
var
|
|
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) {
|
|
7741
7743
|
const n = e || "bls12381";
|
|
7742
7744
|
if (t.modules[n])
|
|
7743
7745
|
return n;
|
|
7744
|
-
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 =
|
|
7745
|
-
|
|
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");
|
|
7746
7748
|
const L = t.alloc(Mt.bigInt2BytesLE(F(4n), C)), I = wa(t, "g1m", "f1m", L);
|
|
7747
|
-
|
|
7749
|
+
Cn(t, "frm", "frm", "frm", "frm_mul"), qs(t, "pol", "frm"), Ds(t, "qap", "frm");
|
|
7748
7750
|
const v = Ea(t, "f1m_neg", "f2m", "f1m"), U = t.alloc([
|
|
7749
7751
|
...Mt.bigInt2BytesLE(F(4n), C),
|
|
7750
7752
|
...Mt.bigInt2BytesLE(F(4n), C)
|
|
@@ -7764,7 +7766,7 @@ var Ss = function(t, e) {
|
|
|
7764
7766
|
)
|
|
7765
7767
|
), t.exportFunction(f);
|
|
7766
7768
|
}
|
|
7767
|
-
S("g1m_timesFr", "g1m_timesScalar"),
|
|
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");
|
|
7768
7770
|
function F(f) {
|
|
7769
7771
|
return BigInt(f) * (1n << BigInt(C * 8)) % a;
|
|
7770
7772
|
}
|
|
@@ -7860,7 +7862,7 @@ var Ss = function(t, e) {
|
|
|
7860
7862
|
);
|
|
7861
7863
|
}
|
|
7862
7864
|
nt();
|
|
7863
|
-
const J =
|
|
7865
|
+
const J = Ts(t, v + "_mulNR", "f6m", "f2m");
|
|
7864
7866
|
function ft() {
|
|
7865
7867
|
const f = t.addFunction(J + "_mulNR");
|
|
7866
7868
|
f.addParam("x", "i32"), f.addParam("pr", "i32");
|
|
@@ -8319,7 +8321,7 @@ var Ss = function(t, e) {
|
|
|
8319
8321
|
(st * ot - rt * gt) % a,
|
|
8320
8322
|
(st * gt + rt * ot) % a
|
|
8321
8323
|
];
|
|
8322
|
-
return
|
|
8324
|
+
return Ms(Bt[0]) && (Bt[0] = Bt[0] + a), Bt;
|
|
8323
8325
|
}
|
|
8324
8326
|
}
|
|
8325
8327
|
function Jt() {
|
|
@@ -8396,7 +8398,7 @@ var Ss = function(t, e) {
|
|
|
8396
8398
|
_.call(v + "_add", Ut, Ft, Ft)
|
|
8397
8399
|
);
|
|
8398
8400
|
}
|
|
8399
|
-
function
|
|
8401
|
+
function re(f, _, Z) {
|
|
8400
8402
|
const Q = it(f).map((ot) => ot == -1 ? 255 : ot), $ = t.alloc(Q), tt = t.addFunction(n + "__cyclotomicExp_" + Z);
|
|
8401
8403
|
tt.addParam("x", "i32"), tt.addParam("r", "i32"), tt.addLocal("bit", "i32"), tt.addLocal("i", "i32");
|
|
8402
8404
|
const V = tt.getCodeBuilder(), ct = V.getLocal("x"), st = V.getLocal("r"), rt = V.i32_const(t.alloc(o));
|
|
@@ -8437,7 +8439,7 @@ var Ss = function(t, e) {
|
|
|
8437
8439
|
);
|
|
8438
8440
|
}
|
|
8439
8441
|
function te() {
|
|
8440
|
-
Jt(),
|
|
8442
|
+
Jt(), re(b, z, "w0");
|
|
8441
8443
|
const f = t.addFunction(n + "_finalExponentiation");
|
|
8442
8444
|
f.addParam("x", "i32"), f.addParam("r", "i32");
|
|
8443
8445
|
const _ = f.getCodeBuilder(), Z = _.getLocal("x"), Q = _.getLocal("r"), $ = _.i32_const(t.alloc(o)), tt = _.i32_const(t.alloc(o)), V = _.i32_const(t.alloc(o)), ct = _.i32_const(t.alloc(o)), st = _.i32_const(t.alloc(o)), rt = _.i32_const(t.alloc(o)), ot = _.i32_const(t.alloc(o));
|
|
@@ -8550,7 +8552,7 @@ var Ss = function(t, e) {
|
|
|
8550
8552
|
])), V = _.i32_const(t.alloc(Mt.bigInt2BytesLE(F(Q), d))), ct = _.i32_const(t.alloc([
|
|
8551
8553
|
...Mt.bigInt2BytesLE(F($[0]), d),
|
|
8552
8554
|
...Mt.bigInt2BytesLE(F($[1]), d)
|
|
8553
|
-
])), 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),
|
|
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);
|
|
8554
8556
|
f.addCode(
|
|
8555
8557
|
_.if(
|
|
8556
8558
|
_.call(w + "_isZeroAffine", _.getLocal("p")),
|
|
@@ -8565,7 +8567,7 @@ var Ss = function(t, e) {
|
|
|
8565
8567
|
_.call(v + "_mul1", Bt, V, Tt),
|
|
8566
8568
|
_.call(v + "_neg", Ft, kt),
|
|
8567
8569
|
_.call(v + "_neg", Bt, Ht),
|
|
8568
|
-
_.call(v + "_mul", Ft, ct,
|
|
8570
|
+
_.call(v + "_mul", Ft, ct, fe),
|
|
8569
8571
|
_.call(O + "_sub", Ut, St, gt),
|
|
8570
8572
|
_.call(O + "_add", Ut, St, St),
|
|
8571
8573
|
_.call(O + "_copy", gt, Ut),
|
|
@@ -8575,23 +8577,23 @@ var Ss = function(t, e) {
|
|
|
8575
8577
|
_.call(O + "_add", Qt, Kt, gt),
|
|
8576
8578
|
_.call(O + "_sub", Qt, Kt, Kt),
|
|
8577
8579
|
_.call(O + "_copy", gt, Qt),
|
|
8578
|
-
_.call(O + "_sub",
|
|
8579
|
-
_.call(O + "_add",
|
|
8580
|
-
_.call(O + "_copy", gt,
|
|
8581
|
-
_.call(v + "_one",
|
|
8580
|
+
_.call(O + "_sub", qe, Ce, gt),
|
|
8581
|
+
_.call(O + "_add", Ce, qe, qe),
|
|
8582
|
+
_.call(O + "_copy", gt, Ce),
|
|
8583
|
+
_.call(v + "_one", gn),
|
|
8582
8584
|
_.call(w + "_timesScalar", qt, st, _.i32_const(8), qt),
|
|
8583
8585
|
_.call(w + "_addMixed", qt, xt, qt),
|
|
8584
8586
|
_.ret(
|
|
8585
8587
|
_.call(w + "_eqMixed", qt, _.getLocal("p"))
|
|
8586
8588
|
)
|
|
8587
8589
|
);
|
|
8588
|
-
const
|
|
8589
|
-
|
|
8590
|
-
const
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8590
|
+
const xe = t.addFunction(w + "_inGroup");
|
|
8591
|
+
xe.addParam("pIn", "i32"), xe.setReturnType("i32");
|
|
8592
|
+
const Ae = xe.getCodeBuilder(), Je = Ae.i32_const(t.alloc(l * 2));
|
|
8593
|
+
xe.addCode(
|
|
8594
|
+
Ae.call(w + "_toAffine", Ae.getLocal("pIn"), Je),
|
|
8595
|
+
Ae.ret(
|
|
8596
|
+
Ae.call(w + "_inGroupAffine", Je)
|
|
8595
8597
|
)
|
|
8596
8598
|
);
|
|
8597
8599
|
}
|
|
@@ -8636,12 +8638,12 @@ var Ss = function(t, e) {
|
|
|
8636
8638
|
for (let f = 1; f <= 5; f++)
|
|
8637
8639
|
vt(f), t.exportFunction(n + "_pairingEq" + f);
|
|
8638
8640
|
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");
|
|
8639
|
-
},
|
|
8641
|
+
}, Ns = Os, zs = Rs;
|
|
8640
8642
|
function Pn(c) {
|
|
8641
8643
|
if (typeof c == "bigint" || c.eq !== void 0)
|
|
8642
8644
|
return c.toString(10);
|
|
8643
8645
|
if (c instanceof Uint8Array)
|
|
8644
|
-
return
|
|
8646
|
+
return Ze(c, 0);
|
|
8645
8647
|
if (Array.isArray(c))
|
|
8646
8648
|
return c.map(Pn);
|
|
8647
8649
|
if (typeof c == "object") {
|
|
@@ -8669,14 +8671,14 @@ function kn(c) {
|
|
|
8669
8671
|
} else
|
|
8670
8672
|
return c;
|
|
8671
8673
|
}
|
|
8672
|
-
function
|
|
8674
|
+
function Us(c) {
|
|
8673
8675
|
let t = BigInt(0), e = c.length, n = 0;
|
|
8674
8676
|
const a = new DataView(c.buffer, c.byteOffset, c.byteLength);
|
|
8675
8677
|
for (; e > 0; )
|
|
8676
8678
|
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);
|
|
8677
8679
|
return t;
|
|
8678
8680
|
}
|
|
8679
|
-
function
|
|
8681
|
+
function js(c, t) {
|
|
8680
8682
|
let e = c;
|
|
8681
8683
|
const n = new Uint8Array(t), a = new DataView(n.buffer);
|
|
8682
8684
|
let s = t;
|
|
@@ -8686,16 +8688,16 @@ function ks(c, t) {
|
|
|
8686
8688
|
throw new Error("Number does not fit in this length");
|
|
8687
8689
|
return n;
|
|
8688
8690
|
}
|
|
8689
|
-
function
|
|
8691
|
+
function $s(c) {
|
|
8690
8692
|
let t = BigInt(0), e = 0;
|
|
8691
8693
|
const n = new DataView(c.buffer, c.byteOffset, c.byteLength);
|
|
8692
8694
|
for (; e < c.length; )
|
|
8693
8695
|
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);
|
|
8694
8696
|
return t;
|
|
8695
8697
|
}
|
|
8696
|
-
function
|
|
8698
|
+
function Oi(c, t) {
|
|
8697
8699
|
let e = c;
|
|
8698
|
-
typeof t > "u" && (t = Math.floor((
|
|
8700
|
+
typeof t > "u" && (t = Math.floor((Ve(c) - 1) / 8) + 1, t == 0 && (t = 1));
|
|
8699
8701
|
const n = new Uint8Array(t), a = new DataView(n.buffer);
|
|
8700
8702
|
let s = 0;
|
|
8701
8703
|
for (; s < t; )
|
|
@@ -8736,27 +8738,27 @@ function qn(c, t) {
|
|
|
8736
8738
|
} else
|
|
8737
8739
|
return t;
|
|
8738
8740
|
}
|
|
8739
|
-
const
|
|
8741
|
+
const je = [];
|
|
8740
8742
|
for (let c = 0; c < 256; c++)
|
|
8741
|
-
|
|
8742
|
-
function
|
|
8743
|
+
je[c] = Gs(c, 8);
|
|
8744
|
+
function Gs(c, t) {
|
|
8743
8745
|
let e = 0, n = c;
|
|
8744
8746
|
for (let a = 0; a < t; a++)
|
|
8745
8747
|
e <<= 1, e = e | n & 1, n >>= 1;
|
|
8746
8748
|
return e;
|
|
8747
8749
|
}
|
|
8748
|
-
function
|
|
8749
|
-
return (
|
|
8750
|
+
function Pi(c, t) {
|
|
8751
|
+
return (je[c >>> 24] | je[c >>> 16 & 255] << 8 | je[c >>> 8 & 255] << 16 | je[c & 255] << 24) >>> 32 - t;
|
|
8750
8752
|
}
|
|
8751
|
-
function
|
|
8753
|
+
function ue(c) {
|
|
8752
8754
|
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;
|
|
8753
8755
|
}
|
|
8754
|
-
function
|
|
8755
|
-
const e = c.byteLength / t, n =
|
|
8756
|
+
function ki(c, t) {
|
|
8757
|
+
const e = c.byteLength / t, n = ue(e);
|
|
8756
8758
|
if (e != 1 << n)
|
|
8757
8759
|
throw new Error("Invalid number of pointers");
|
|
8758
8760
|
for (let a = 0; a < e; a++) {
|
|
8759
|
-
const s =
|
|
8761
|
+
const s = Pi(a, n);
|
|
8760
8762
|
if (a > s) {
|
|
8761
8763
|
const g = c.slice(a * t, (a + 1) * t);
|
|
8762
8764
|
c.set(c.slice(s * t, (s + 1) * t), a * t), c.set(g, s * t);
|
|
@@ -8769,47 +8771,47 @@ function Jn(c, t) {
|
|
|
8769
8771
|
e.set(c[n], n * t);
|
|
8770
8772
|
return e;
|
|
8771
8773
|
}
|
|
8772
|
-
function
|
|
8774
|
+
function on(c, t) {
|
|
8773
8775
|
const e = c.byteLength / t, n = new Array(e);
|
|
8774
8776
|
for (let a = 0; a < e; a++)
|
|
8775
8777
|
n[a] = c.slice(a * t, a * t + t);
|
|
8776
8778
|
return n;
|
|
8777
8779
|
}
|
|
8778
|
-
const
|
|
8780
|
+
const Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8779
8781
|
__proto__: null,
|
|
8780
8782
|
array2buffer: Jn,
|
|
8781
|
-
beBuff2int:
|
|
8782
|
-
beInt2Buff:
|
|
8783
|
-
bitReverse:
|
|
8784
|
-
buffReverseBits:
|
|
8785
|
-
buffer2array:
|
|
8786
|
-
leBuff2int:
|
|
8787
|
-
leInt2Buff:
|
|
8788
|
-
log2:
|
|
8783
|
+
beBuff2int: Us,
|
|
8784
|
+
beInt2Buff: js,
|
|
8785
|
+
bitReverse: Pi,
|
|
8786
|
+
buffReverseBits: ki,
|
|
8787
|
+
buffer2array: on,
|
|
8788
|
+
leBuff2int: $s,
|
|
8789
|
+
leInt2Buff: Oi,
|
|
8790
|
+
log2: ue,
|
|
8789
8791
|
stringifyBigInts: Pn,
|
|
8790
8792
|
stringifyFElements: Tn,
|
|
8791
8793
|
unstringifyBigInts: kn,
|
|
8792
8794
|
unstringifyFElements: qn
|
|
8793
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
8795
|
+
}, Symbol.toStringTag, { value: "Module" })), se = 1 << 30;
|
|
8794
8796
|
class Vt {
|
|
8795
8797
|
constructor(t) {
|
|
8796
8798
|
this.buffers = [], this.byteLength = t;
|
|
8797
|
-
for (let e = 0; e < t; e +=
|
|
8798
|
-
const n = Math.min(t - e,
|
|
8799
|
+
for (let e = 0; e < t; e += se) {
|
|
8800
|
+
const n = Math.min(t - e, se);
|
|
8799
8801
|
this.buffers.push(new Uint8Array(n));
|
|
8800
8802
|
}
|
|
8801
8803
|
}
|
|
8802
8804
|
slice(t, e) {
|
|
8803
8805
|
e === void 0 && (e = this.byteLength), t === void 0 && (t = 0);
|
|
8804
|
-
const n = e - t, a = Math.floor(t /
|
|
8806
|
+
const n = e - t, a = Math.floor(t / se), s = Math.floor((t + n - 1) / se);
|
|
8805
8807
|
if (a == s || n == 0)
|
|
8806
|
-
return this.buffers[a].slice(t %
|
|
8807
|
-
let g, d = a, C = t %
|
|
8808
|
+
return this.buffers[a].slice(t % se, t % se + n);
|
|
8809
|
+
let g, d = a, C = t % se, l = n;
|
|
8808
8810
|
for (; l > 0; ) {
|
|
8809
|
-
const o = C + l >
|
|
8811
|
+
const o = C + l > se ? se - C : l, y = new Uint8Array(this.buffers[d].buffer, this.buffers[d].byteOffset + C, o);
|
|
8810
8812
|
if (o == n)
|
|
8811
8813
|
return y.slice();
|
|
8812
|
-
g || (n <=
|
|
8814
|
+
g || (n <= se ? g = new Uint8Array(n) : g = new Vt(n)), g.set(y, n - l), l = l - o, d++, C = 0;
|
|
8813
8815
|
}
|
|
8814
8816
|
return g;
|
|
8815
8817
|
}
|
|
@@ -8818,17 +8820,17 @@ class Vt {
|
|
|
8818
8820
|
const n = t.byteLength;
|
|
8819
8821
|
if (n == 0)
|
|
8820
8822
|
return;
|
|
8821
|
-
const a = Math.floor(e /
|
|
8823
|
+
const a = Math.floor(e / se), s = Math.floor((e + n - 1) / se);
|
|
8822
8824
|
if (a == s)
|
|
8823
|
-
return t instanceof Vt && t.buffers.length == 1 ? this.buffers[a].set(t.buffers[0], e %
|
|
8824
|
-
let g = a, d = e %
|
|
8825
|
+
return t instanceof Vt && t.buffers.length == 1 ? this.buffers[a].set(t.buffers[0], e % se) : this.buffers[a].set(t, e % se);
|
|
8826
|
+
let g = a, d = e % se, C = n;
|
|
8825
8827
|
for (; C > 0; ) {
|
|
8826
|
-
const l = d + C >
|
|
8828
|
+
const l = d + C > se ? se - d : C, o = t.slice(n - C, n - C + l);
|
|
8827
8829
|
new Uint8Array(this.buffers[g].buffer, this.buffers[g].byteOffset + d, l).set(o), C = C - l, g++, d = 0;
|
|
8828
8830
|
}
|
|
8829
8831
|
}
|
|
8830
8832
|
}
|
|
8831
|
-
function
|
|
8833
|
+
function be(c, t, e, n) {
|
|
8832
8834
|
return async function(s) {
|
|
8833
8835
|
const g = Math.floor(s.byteLength / e);
|
|
8834
8836
|
if (g * e !== s.byteLength)
|
|
@@ -8863,22 +8865,22 @@ function me(c, t, e, n) {
|
|
|
8863
8865
|
}
|
|
8864
8866
|
class xa {
|
|
8865
8867
|
constructor(t, e, n, a) {
|
|
8866
|
-
if (this.tm = t, this.prefix = e, this.p = a, this.n8 = n, this.type = "F1", this.m = 1, this.half =
|
|
8868
|
+
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)
|
|
8867
8869
|
throw new Error("n8 must be a multiple of 8");
|
|
8868
|
-
this.half =
|
|
8870
|
+
this.half = Ie(this.p, we), this.nqr = this.two;
|
|
8869
8871
|
let s = this.exp(this.nqr, this.half);
|
|
8870
8872
|
for (; !this.eq(s, this.negone); )
|
|
8871
8873
|
this.nqr = this.add(this.nqr, this.one), s = this.exp(this.nqr, this.half);
|
|
8872
8874
|
this.shift = this.mul(this.nqr, this.nqr), this.shiftInv = this.inv(this.shift), this.s = 0;
|
|
8873
|
-
let g =
|
|
8875
|
+
let g = Le(this.p, we);
|
|
8874
8876
|
for (; !jn(g); )
|
|
8875
|
-
this.s = this.s + 1, g =
|
|
8877
|
+
this.s = this.s + 1, g = Ie(g, we);
|
|
8876
8878
|
this.w = [], this.w[this.s] = this.exp(this.nqr, g);
|
|
8877
8879
|
for (let d = this.s - 1; d >= 0; d--)
|
|
8878
8880
|
this.w[d] = this.square(this.w[d + 1]);
|
|
8879
8881
|
if (!this.eq(this.w[0], this.one))
|
|
8880
8882
|
throw new Error("Error calculating roots of unity");
|
|
8881
|
-
this.batchToMontgomery =
|
|
8883
|
+
this.batchToMontgomery = be(t, e + "_batchToMontgomery", this.n8, this.n8), this.batchFromMontgomery = be(t, e + "_batchFromMontgomery", this.n8, this.n8);
|
|
8882
8884
|
}
|
|
8883
8885
|
op2(t, e, n) {
|
|
8884
8886
|
return this.tm.setBuff(this.pOp1, e), this.tm.setBuff(this.pOp2, n), this.tm.instance.exports[this.prefix + t](this.pOp1, this.pOp2, this.pOp3), this.tm.getBuff(this.pOp3, this.n8);
|
|
@@ -8932,7 +8934,7 @@ class xa {
|
|
|
8932
8934
|
return this.op1("_sqrt", t);
|
|
8933
8935
|
}
|
|
8934
8936
|
exp(t, e) {
|
|
8935
|
-
return e instanceof Uint8Array || (e =
|
|
8937
|
+
return e instanceof Uint8Array || (e = Pe(ee(e))), this.tm.setBuff(this.pOp1, t), this.tm.setBuff(this.pOp2, e), this.tm.instance.exports[this.prefix + "_exp"](this.pOp1, this.pOp2, e.byteLength, this.pOp3), this.tm.getBuff(this.pOp3, this.n8);
|
|
8936
8938
|
}
|
|
8937
8939
|
isNegative(t) {
|
|
8938
8940
|
return this.op1Bool("_isNegative", t);
|
|
@@ -8941,35 +8943,35 @@ class xa {
|
|
|
8941
8943
|
if (t instanceof Uint8Array)
|
|
8942
8944
|
return t;
|
|
8943
8945
|
let n = ee(t, e);
|
|
8944
|
-
|
|
8945
|
-
const a =
|
|
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);
|
|
8946
8948
|
return this.toMontgomery(a);
|
|
8947
8949
|
}
|
|
8948
8950
|
toString(t, e) {
|
|
8949
|
-
const n = this.fromMontgomery(t), a =
|
|
8950
|
-
return
|
|
8951
|
+
const n = this.fromMontgomery(t), a = Ze(n, 0);
|
|
8952
|
+
return gi(a, e);
|
|
8951
8953
|
}
|
|
8952
8954
|
fromRng(t) {
|
|
8953
8955
|
let e;
|
|
8954
8956
|
const n = new Uint8Array(this.n8);
|
|
8955
8957
|
do {
|
|
8956
|
-
e =
|
|
8958
|
+
e = pi;
|
|
8957
8959
|
for (let a = 0; a < this.n64; a++)
|
|
8958
|
-
e = $n(e,
|
|
8960
|
+
e = $n(e, nn(t.nextU64(), 64 * a));
|
|
8959
8961
|
e = Gn(e, this.mask);
|
|
8960
|
-
} while (
|
|
8961
|
-
return
|
|
8962
|
+
} while (di(e, this.p));
|
|
8963
|
+
return Ge(n, 0, e, this.n8), n;
|
|
8962
8964
|
}
|
|
8963
8965
|
random() {
|
|
8964
8966
|
return this.fromRng(Zn());
|
|
8965
8967
|
}
|
|
8966
8968
|
toObject(t) {
|
|
8967
8969
|
const e = this.fromMontgomery(t);
|
|
8968
|
-
return
|
|
8970
|
+
return Ze(e, 0);
|
|
8969
8971
|
}
|
|
8970
8972
|
fromObject(t) {
|
|
8971
8973
|
const e = new Uint8Array(this.n8);
|
|
8972
|
-
return
|
|
8974
|
+
return Ge(e, 0, t, this.n8), this.toMontgomery(e);
|
|
8973
8975
|
}
|
|
8974
8976
|
toRprLE(t, e, n) {
|
|
8975
8977
|
t.set(this.fromMontgomery(n), e);
|
|
@@ -9021,7 +9023,7 @@ class xa {
|
|
|
9021
9023
|
let o = 0;
|
|
9022
9024
|
for (let y = 0; y < C.length; y++)
|
|
9023
9025
|
l.set(C[y][0], o), o += C[y][0].byteLength;
|
|
9024
|
-
return e ?
|
|
9026
|
+
return e ? on(l, a) : l;
|
|
9025
9027
|
}
|
|
9026
9028
|
}
|
|
9027
9029
|
class Sa {
|
|
@@ -9086,7 +9088,7 @@ class Sa {
|
|
|
9086
9088
|
return this.op1("_sqrt", t);
|
|
9087
9089
|
}
|
|
9088
9090
|
exp(t, e) {
|
|
9089
|
-
return e instanceof Uint8Array || (e =
|
|
9091
|
+
return e instanceof Uint8Array || (e = Pe(ee(e))), this.tm.setBuff(this.pOp1, t), this.tm.setBuff(this.pOp2, e), this.tm.instance.exports[this.prefix + "_exp"](this.pOp1, this.pOp2, e.byteLength, this.pOp3), this.tm.getBuff(this.pOp3, this.n8);
|
|
9090
9092
|
}
|
|
9091
9093
|
e(t, e) {
|
|
9092
9094
|
if (t instanceof Uint8Array)
|
|
@@ -9123,7 +9125,7 @@ class Sa {
|
|
|
9123
9125
|
return t.slice(this.F.n8);
|
|
9124
9126
|
}
|
|
9125
9127
|
}
|
|
9126
|
-
class
|
|
9128
|
+
class Ws {
|
|
9127
9129
|
constructor(t, e, n) {
|
|
9128
9130
|
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);
|
|
9129
9131
|
}
|
|
@@ -9182,7 +9184,7 @@ class Ms {
|
|
|
9182
9184
|
return this.op1("_sqrt", t);
|
|
9183
9185
|
}
|
|
9184
9186
|
exp(t, e) {
|
|
9185
|
-
return e instanceof Uint8Array || (e =
|
|
9187
|
+
return e instanceof Uint8Array || (e = Pe(ee(e))), this.tm.setBuff(this.pOp1, t), this.tm.setBuff(this.pOp2, e), this.tm.instance.exports[this.prefix + "_exp"](this.pOp1, this.pOp2, e.byteLength, this.pOp3), this.getBuff(this.pOp3, this.n8);
|
|
9186
9188
|
}
|
|
9187
9189
|
e(t, e) {
|
|
9188
9190
|
if (t instanceof Uint8Array)
|
|
@@ -9224,7 +9226,7 @@ class Ms {
|
|
|
9224
9226
|
}
|
|
9225
9227
|
class Ia {
|
|
9226
9228
|
constructor(t, e, n, a, s, g) {
|
|
9227
|
-
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 =
|
|
9229
|
+
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);
|
|
9228
9230
|
}
|
|
9229
9231
|
op2(t, e, n) {
|
|
9230
9232
|
return this.tm.setBuff(this.pOp1, e), this.tm.setBuff(this.pOp2, n), this.tm.instance.exports[this.prefix + t](this.pOp1, this.pOp2, this.pOp3), this.tm.getBuff(this.pOp3, this.F.n8 * 3);
|
|
@@ -9295,7 +9297,7 @@ class Ia {
|
|
|
9295
9297
|
throw new Error("invalid point size");
|
|
9296
9298
|
}
|
|
9297
9299
|
timesScalar(t, e) {
|
|
9298
|
-
e instanceof Uint8Array || (e =
|
|
9300
|
+
e instanceof Uint8Array || (e = Pe(ee(e)));
|
|
9299
9301
|
let n;
|
|
9300
9302
|
if (t.byteLength == this.F.n8 * 3)
|
|
9301
9303
|
n = this.prefix + "_timesScalar";
|
|
@@ -9451,7 +9453,7 @@ class Ia {
|
|
|
9451
9453
|
return this.toAffine(t).slice(this.F.n8);
|
|
9452
9454
|
}
|
|
9453
9455
|
}
|
|
9454
|
-
function
|
|
9456
|
+
function Ti(c) {
|
|
9455
9457
|
let e, n;
|
|
9456
9458
|
c && (c.onmessage = function(o) {
|
|
9457
9459
|
let y;
|
|
@@ -9535,7 +9537,52 @@ function Pi(c) {
|
|
|
9535
9537
|
}
|
|
9536
9538
|
return l;
|
|
9537
9539
|
}
|
|
9538
|
-
|
|
9540
|
+
var ie = {};
|
|
9541
|
+
ie.endianness = function() {
|
|
9542
|
+
return "LE";
|
|
9543
|
+
};
|
|
9544
|
+
ie.hostname = function() {
|
|
9545
|
+
return typeof location < "u" ? location.hostname : "";
|
|
9546
|
+
};
|
|
9547
|
+
ie.loadavg = function() {
|
|
9548
|
+
return [];
|
|
9549
|
+
};
|
|
9550
|
+
ie.uptime = function() {
|
|
9551
|
+
return 0;
|
|
9552
|
+
};
|
|
9553
|
+
ie.freemem = function() {
|
|
9554
|
+
return Number.MAX_VALUE;
|
|
9555
|
+
};
|
|
9556
|
+
ie.totalmem = function() {
|
|
9557
|
+
return Number.MAX_VALUE;
|
|
9558
|
+
};
|
|
9559
|
+
ie.cpus = function() {
|
|
9560
|
+
return [];
|
|
9561
|
+
};
|
|
9562
|
+
ie.type = function() {
|
|
9563
|
+
return "Browser";
|
|
9564
|
+
};
|
|
9565
|
+
ie.release = function() {
|
|
9566
|
+
return typeof navigator < "u" ? navigator.appVersion : "";
|
|
9567
|
+
};
|
|
9568
|
+
ie.networkInterfaces = ie.getNetworkInterfaces = function() {
|
|
9569
|
+
return {};
|
|
9570
|
+
};
|
|
9571
|
+
ie.arch = function() {
|
|
9572
|
+
return "javascript";
|
|
9573
|
+
};
|
|
9574
|
+
ie.platform = function() {
|
|
9575
|
+
return "browser";
|
|
9576
|
+
};
|
|
9577
|
+
ie.tmpdir = ie.tmpDir = function() {
|
|
9578
|
+
return "/tmp";
|
|
9579
|
+
};
|
|
9580
|
+
ie.EOL = `
|
|
9581
|
+
`;
|
|
9582
|
+
ie.homedir = function() {
|
|
9583
|
+
return "/";
|
|
9584
|
+
};
|
|
9585
|
+
const Xs = Worker, An = 25;
|
|
9539
9586
|
class Oa {
|
|
9540
9587
|
constructor() {
|
|
9541
9588
|
this.promise = new Promise((t, e) => {
|
|
@@ -9543,39 +9590,39 @@ class Oa {
|
|
|
9543
9590
|
});
|
|
9544
9591
|
}
|
|
9545
9592
|
}
|
|
9546
|
-
function
|
|
9593
|
+
function Vs(c) {
|
|
9547
9594
|
return new Promise((t) => setTimeout(t, c));
|
|
9548
9595
|
}
|
|
9549
|
-
function
|
|
9550
|
-
return
|
|
9596
|
+
function Hs(c) {
|
|
9597
|
+
return Se.browser ? globalThis.btoa(c) : Lo.from(c).toString("base64");
|
|
9551
9598
|
}
|
|
9552
|
-
const
|
|
9553
|
-
async function
|
|
9554
|
-
const e = new
|
|
9555
|
-
e.memory = new WebAssembly.Memory({ initial:
|
|
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);
|
|
9556
9603
|
const n = await WebAssembly.compile(c.code);
|
|
9557
9604
|
if (e.instance = await WebAssembly.instantiate(n, {
|
|
9558
9605
|
env: {
|
|
9559
9606
|
memory: e.memory
|
|
9560
9607
|
}
|
|
9561
9608
|
}), 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)
|
|
9562
|
-
e.code = c.code, e.taskManager =
|
|
9609
|
+
e.code = c.code, e.taskManager = Ti(), await e.taskManager([{
|
|
9563
9610
|
cmd: "INIT",
|
|
9564
|
-
init:
|
|
9611
|
+
init: An,
|
|
9565
9612
|
code: e.code.slice()
|
|
9566
9613
|
}]), e.concurrency = 1;
|
|
9567
9614
|
else {
|
|
9568
9615
|
e.workers = [], e.pendingDeferreds = [], e.working = [];
|
|
9569
9616
|
let s;
|
|
9570
|
-
typeof navigator == "object" && navigator.hardwareConcurrency ? s = navigator.hardwareConcurrency : s =
|
|
9617
|
+
typeof navigator == "object" && navigator.hardwareConcurrency ? s = navigator.hardwareConcurrency : s = ie.cpus().length, s == 0 && (s = 2), s > 64 && (s = 64), e.concurrency = s;
|
|
9571
9618
|
for (let d = 0; d < s; d++)
|
|
9572
|
-
e.workers[d] = new
|
|
9619
|
+
e.workers[d] = new Xs(Js), e.workers[d].addEventListener("message", a(d)), e.working[d] = !1;
|
|
9573
9620
|
const g = [];
|
|
9574
9621
|
for (let d = 0; d < e.workers.length; d++) {
|
|
9575
9622
|
const C = c.code.slice();
|
|
9576
9623
|
g.push(e.postAction(d, [{
|
|
9577
9624
|
cmd: "INIT",
|
|
9578
|
-
init:
|
|
9625
|
+
init: An,
|
|
9579
9626
|
code: C
|
|
9580
9627
|
}], [C.buffer]));
|
|
9581
9628
|
}
|
|
@@ -9589,7 +9636,7 @@ async function $s(c, t) {
|
|
|
9589
9636
|
};
|
|
9590
9637
|
}
|
|
9591
9638
|
}
|
|
9592
|
-
class
|
|
9639
|
+
class Ys {
|
|
9593
9640
|
constructor() {
|
|
9594
9641
|
this.actionQueue = [], this.oldPFree = 0;
|
|
9595
9642
|
}
|
|
@@ -9650,10 +9697,10 @@ class Gs {
|
|
|
9650
9697
|
async terminate() {
|
|
9651
9698
|
for (let t = 0; t < this.workers.length; t++)
|
|
9652
9699
|
this.workers[t].postMessage([{ cmd: "TERMINATE" }]);
|
|
9653
|
-
await
|
|
9700
|
+
await Vs(200);
|
|
9654
9701
|
}
|
|
9655
9702
|
}
|
|
9656
|
-
function
|
|
9703
|
+
function Fn(c, t) {
|
|
9657
9704
|
const e = c[t], n = c.Fr, a = c.tm;
|
|
9658
9705
|
c[t].batchApplyKey = async function(s, g, d, C, l) {
|
|
9659
9706
|
C = C || "affine", l = l || "affine";
|
|
@@ -9707,7 +9754,7 @@ function An(c, t) {
|
|
|
9707
9754
|
return w;
|
|
9708
9755
|
};
|
|
9709
9756
|
}
|
|
9710
|
-
function
|
|
9757
|
+
function tr(c) {
|
|
9711
9758
|
const t = c.tm;
|
|
9712
9759
|
c.pairing = function(n, a) {
|
|
9713
9760
|
t.startSyncOp();
|
|
@@ -9829,7 +9876,7 @@ function ka(c, t) {
|
|
|
9829
9876
|
const x = Math.floor(d.byteLength / m);
|
|
9830
9877
|
if (x * m != d.byteLength)
|
|
9831
9878
|
throw new Error("Scalar size does not match");
|
|
9832
|
-
const O = Pa[
|
|
9879
|
+
const O = Pa[ue(m)], L = Math.floor((x * 8 - 1) / O) + 1, I = [];
|
|
9833
9880
|
for (let w = 0; w < L; w++) {
|
|
9834
9881
|
const S = [
|
|
9835
9882
|
{ cmd: "ALLOCSET", var: 0, buff: g },
|
|
@@ -9871,7 +9918,7 @@ function ka(c, t) {
|
|
|
9871
9918
|
const x = Math.floor(g.byteLength / m), O = Math.floor(d.byteLength / x);
|
|
9872
9919
|
if (O * x != d.byteLength)
|
|
9873
9920
|
throw new Error("Scalar size does not match");
|
|
9874
|
-
const L = Pa[
|
|
9921
|
+
const L = Pa[ue(x)], I = Math.floor((O * 8 - 1) / L) + 1;
|
|
9875
9922
|
let v;
|
|
9876
9923
|
v = Math.floor(x / (n.concurrency / I)), v > 4194304 && (v = 4194304), v < 1024 && (v = 1024);
|
|
9877
9924
|
const U = [];
|
|
@@ -9892,7 +9939,7 @@ function ka(c, t) {
|
|
|
9892
9939
|
return await s(d, C, "affine", l, o);
|
|
9893
9940
|
};
|
|
9894
9941
|
}
|
|
9895
|
-
function
|
|
9942
|
+
function En(c, t) {
|
|
9896
9943
|
const e = c[t], n = c.Fr, a = e.tm;
|
|
9897
9944
|
async function s(l, o, y, E, m, x) {
|
|
9898
9945
|
y = y || "affine", E = E || "affine";
|
|
@@ -9901,21 +9948,21 @@ function Fn(c, t) {
|
|
|
9901
9948
|
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");
|
|
9902
9949
|
let h = !1;
|
|
9903
9950
|
Array.isArray(l) ? (l = Jn(l, L), h = !0) : l = l.slice(0, l.byteLength);
|
|
9904
|
-
const R = l.byteLength / L, j =
|
|
9951
|
+
const R = l.byteLength / L, j = ue(R);
|
|
9905
9952
|
if (1 << j != R)
|
|
9906
9953
|
throw new Error("fft must be multiple of 2");
|
|
9907
9954
|
if (j == n.s + 1) {
|
|
9908
9955
|
let J;
|
|
9909
|
-
return o ? J = await d(l, y, E, m, x) : J = await g(l, y, E, m, x), h ?
|
|
9956
|
+
return o ? J = await d(l, y, E, m, x) : J = await g(l, y, E, m, x), h ? on(J, v) : J;
|
|
9910
9957
|
}
|
|
9911
9958
|
let T;
|
|
9912
9959
|
o && (T = n.inv(n.e(R)));
|
|
9913
9960
|
let D;
|
|
9914
|
-
|
|
9961
|
+
ki(l, L);
|
|
9915
9962
|
let A, M = Math.min(1 << O, R), H = R / M;
|
|
9916
9963
|
for (; H < a.concurrency && M >= 16; )
|
|
9917
9964
|
H *= 2, M /= 2;
|
|
9918
|
-
const ut =
|
|
9965
|
+
const ut = ue(M), nt = [];
|
|
9919
9966
|
for (let J = 0; J < H; J++) {
|
|
9920
9967
|
m && m.debug(`${x}: fft ${j} mix start: ${J}/${H}`);
|
|
9921
9968
|
const ft = [];
|
|
@@ -9971,7 +10018,7 @@ function Fn(c, t) {
|
|
|
9971
10018
|
} else
|
|
9972
10019
|
for (let J = 0; J < H; J++)
|
|
9973
10020
|
D.set(A[J], M * v * J), delete A[J];
|
|
9974
|
-
return h ?
|
|
10021
|
+
return h ? on(D, v) : D;
|
|
9975
10022
|
}
|
|
9976
10023
|
async function g(l, o, y, E, m) {
|
|
9977
10024
|
let x, O;
|
|
@@ -10004,7 +10051,7 @@ function Fn(c, t) {
|
|
|
10004
10051
|
if (l.byteLength != o.byteLength)
|
|
10005
10052
|
throw new Error("Invalid buffer size");
|
|
10006
10053
|
const j = Math.floor(l.byteLength / h);
|
|
10007
|
-
if (j != 1 <<
|
|
10054
|
+
if (j != 1 << ue(j))
|
|
10008
10055
|
throw new Error("Invalid number of points");
|
|
10009
10056
|
let T = Math.floor(j / a.concurrency);
|
|
10010
10057
|
T < 16 && (T = 16), T > 65536 && (T = 65536);
|
|
@@ -10046,7 +10093,7 @@ function Fn(c, t) {
|
|
|
10046
10093
|
x = n.n8;
|
|
10047
10094
|
else
|
|
10048
10095
|
throw new Error("Invalid group");
|
|
10049
|
-
const O = l.byteLength / x, L =
|
|
10096
|
+
const O = l.byteLength / x, L = ue(O);
|
|
10050
10097
|
if (2 ** L * x != l.byteLength)
|
|
10051
10098
|
throw E && E.error("lagrangeEvaluations iinvalid input size"), new Error("lagrangeEvaluations invalid Input size");
|
|
10052
10099
|
if (L <= n.s)
|
|
@@ -10071,10 +10118,10 @@ function Fn(c, t) {
|
|
|
10071
10118
|
E = "frm_fftMix", m = "frm_fftJoin";
|
|
10072
10119
|
else
|
|
10073
10120
|
throw new Error("Invalid group");
|
|
10074
|
-
const x = Math.floor(o.byteLength / y), O =
|
|
10075
|
-
let L = 1 <<
|
|
10121
|
+
const x = Math.floor(o.byteLength / y), O = ue(x);
|
|
10122
|
+
let L = 1 << ue(a.concurrency);
|
|
10076
10123
|
x <= L * 2 && (L = 1);
|
|
10077
|
-
const I = x / L, v =
|
|
10124
|
+
const I = x / L, v = ue(I), U = [];
|
|
10078
10125
|
for (let h = 0; h < L; h++) {
|
|
10079
10126
|
const R = [], j = o.slice(h * I * y, (h + 1) * I * y);
|
|
10080
10127
|
R.push({ cmd: "ALLOCSET", var: 0, buff: j });
|
|
@@ -10131,9 +10178,9 @@ function Fn(c, t) {
|
|
|
10131
10178
|
if (o.byteLength != y.byteLength)
|
|
10132
10179
|
throw new Error("Invalid buffer size");
|
|
10133
10180
|
const L = Math.floor(o.byteLength / x);
|
|
10134
|
-
if (L != 1 <<
|
|
10181
|
+
if (L != 1 << ue(L))
|
|
10135
10182
|
throw new Error("Invalid number of points");
|
|
10136
|
-
let I = 1 <<
|
|
10183
|
+
let I = 1 << ue(a.concurrency);
|
|
10137
10184
|
L <= I * 2 && (I = 1);
|
|
10138
10185
|
const v = L / I, U = [];
|
|
10139
10186
|
for (let h = 0; h < I; h++) {
|
|
@@ -10165,7 +10212,7 @@ function Fn(c, t) {
|
|
|
10165
10212
|
else
|
|
10166
10213
|
throw new Error("Invalid group");
|
|
10167
10214
|
const L = Math.floor(o.byteLength / E);
|
|
10168
|
-
if (L != 1 <<
|
|
10215
|
+
if (L != 1 << ue(L))
|
|
10169
10216
|
throw new Error("Invalid number of points");
|
|
10170
10217
|
const I = Math.floor(L / a.concurrency), v = [];
|
|
10171
10218
|
for (let F = 0; F < a.concurrency; F++) {
|
|
@@ -10194,9 +10241,9 @@ function Fn(c, t) {
|
|
|
10194
10241
|
return w;
|
|
10195
10242
|
};
|
|
10196
10243
|
}
|
|
10197
|
-
async function
|
|
10198
|
-
const t = await
|
|
10199
|
-
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
|
|
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) {
|
|
10200
10247
|
const s = new Uint8Array(a * n.length);
|
|
10201
10248
|
for (let g = 0; g < n.length; g++)
|
|
10202
10249
|
s.set(n[g], g * a);
|
|
@@ -10208,23 +10255,23 @@ async function ki(c) {
|
|
|
10208
10255
|
return g;
|
|
10209
10256
|
}, e;
|
|
10210
10257
|
}
|
|
10211
|
-
function
|
|
10258
|
+
function Te(c) {
|
|
10212
10259
|
return BigInt(c);
|
|
10213
10260
|
}
|
|
10214
|
-
function
|
|
10261
|
+
function Di(c) {
|
|
10215
10262
|
return c < 0n;
|
|
10216
10263
|
}
|
|
10217
|
-
function
|
|
10264
|
+
function er(c) {
|
|
10218
10265
|
return c === 0n;
|
|
10219
10266
|
}
|
|
10220
|
-
function
|
|
10221
|
-
return
|
|
10267
|
+
function nr(c) {
|
|
10268
|
+
return Di(c) ? c.toString(2).length - 1 : c.toString(2).length;
|
|
10222
10269
|
}
|
|
10223
|
-
function
|
|
10224
|
-
const t = [], e =
|
|
10270
|
+
function wn(c) {
|
|
10271
|
+
const t = [], e = Te(c);
|
|
10225
10272
|
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;
|
|
10226
10273
|
}
|
|
10227
|
-
function
|
|
10274
|
+
function ar(c) {
|
|
10228
10275
|
for (var t = [], e = 0; e < c.length; e++) {
|
|
10229
10276
|
var n = c.charCodeAt(e);
|
|
10230
10277
|
n < 128 ? t.push(n) : n < 2048 ? t.push(
|
|
@@ -10243,57 +10290,57 @@ function Vs(c) {
|
|
|
10243
10290
|
}
|
|
10244
10291
|
return t;
|
|
10245
10292
|
}
|
|
10246
|
-
function
|
|
10247
|
-
const t =
|
|
10293
|
+
function Ue(c) {
|
|
10294
|
+
const t = ar(c);
|
|
10248
10295
|
return [...Rt(t.length), ...t];
|
|
10249
10296
|
}
|
|
10250
|
-
function
|
|
10297
|
+
function Mi(c) {
|
|
10251
10298
|
const t = [];
|
|
10252
|
-
let e =
|
|
10253
|
-
if (
|
|
10299
|
+
let e = Te(c);
|
|
10300
|
+
if (Di(e))
|
|
10254
10301
|
throw new Error("Number cannot be negative");
|
|
10255
|
-
for (; !
|
|
10302
|
+
for (; !er(e); )
|
|
10256
10303
|
t.push(Number(e & 0x7Fn)), e = e >> 7n;
|
|
10257
10304
|
t.length == 0 && t.push(0);
|
|
10258
10305
|
for (let n = 0; n < t.length - 1; n++)
|
|
10259
10306
|
t[n] = t[n] | 128;
|
|
10260
10307
|
return t;
|
|
10261
10308
|
}
|
|
10262
|
-
function
|
|
10309
|
+
function Ri(c) {
|
|
10263
10310
|
let t, e;
|
|
10264
|
-
const n =
|
|
10265
|
-
c < 0 ? (e = !0, t = (1n << BigInt(n)) + c) : (e = !1, t =
|
|
10266
|
-
const a = 7 - n % 7, s = (1n << BigInt(a)) - 1n << BigInt(n), g = (1 << 7 - a) - 1 | 128, d =
|
|
10311
|
+
const n = nr(c);
|
|
10312
|
+
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);
|
|
10267
10314
|
return e || (d[d.length - 1] = d[d.length - 1] & g), d;
|
|
10268
10315
|
}
|
|
10269
10316
|
function Dn(c) {
|
|
10270
|
-
let t =
|
|
10317
|
+
let t = Te(c);
|
|
10271
10318
|
if (t > 0xFFFFFFFFn)
|
|
10272
10319
|
throw new Error("Number too big");
|
|
10273
10320
|
if (t > 0x7FFFFFFFn && (t = t - 0x100000000n), t < -2147483648n)
|
|
10274
10321
|
throw new Error("Number too small");
|
|
10275
|
-
return
|
|
10322
|
+
return Ri(t);
|
|
10276
10323
|
}
|
|
10277
|
-
function
|
|
10278
|
-
let t =
|
|
10324
|
+
function ir(c) {
|
|
10325
|
+
let t = Te(c);
|
|
10279
10326
|
if (t > 0xFFFFFFFFFFFFFFFFn)
|
|
10280
10327
|
throw new Error("Number too big");
|
|
10281
10328
|
if (t > 0x7FFFFFFFFFFFFFFFn && (t = t - 0x10000000000000000n), t < -9223372036854775808n)
|
|
10282
10329
|
throw new Error("Number too small");
|
|
10283
|
-
return
|
|
10330
|
+
return Ri(t);
|
|
10284
10331
|
}
|
|
10285
10332
|
function Rt(c) {
|
|
10286
|
-
let t =
|
|
10333
|
+
let t = Te(c);
|
|
10287
10334
|
if (t > 0xFFFFFFFFn)
|
|
10288
10335
|
throw new Error("Number too big");
|
|
10289
|
-
return
|
|
10336
|
+
return Mi(t);
|
|
10290
10337
|
}
|
|
10291
10338
|
function Ta(c) {
|
|
10292
10339
|
return Array.from(c, function(t) {
|
|
10293
10340
|
return ("0" + (t & 255).toString(16)).slice(-2);
|
|
10294
10341
|
}).join("");
|
|
10295
10342
|
}
|
|
10296
|
-
class
|
|
10343
|
+
class or {
|
|
10297
10344
|
constructor(t) {
|
|
10298
10345
|
this.func = t, this.functionName = t.functionName, this.module = t.module;
|
|
10299
10346
|
}
|
|
@@ -10422,7 +10469,7 @@ class Qs {
|
|
|
10422
10469
|
return [...t, 26];
|
|
10423
10470
|
}
|
|
10424
10471
|
i64_const(t) {
|
|
10425
|
-
return [66, ...
|
|
10472
|
+
return [66, ...ir(t)];
|
|
10426
10473
|
}
|
|
10427
10474
|
i32_const(t) {
|
|
10428
10475
|
return [65, ...Dn(t)];
|
|
@@ -10608,7 +10655,7 @@ class Qs {
|
|
|
10608
10655
|
return [];
|
|
10609
10656
|
}
|
|
10610
10657
|
}
|
|
10611
|
-
const
|
|
10658
|
+
const Bn = {
|
|
10612
10659
|
i32: 127,
|
|
10613
10660
|
i64: 126,
|
|
10614
10661
|
f32: 125,
|
|
@@ -10651,13 +10698,13 @@ class qa {
|
|
|
10651
10698
|
this.returnType = t;
|
|
10652
10699
|
}
|
|
10653
10700
|
getSignature() {
|
|
10654
|
-
const t = [...Rt(this.params.length), ...this.params.map((n) =>
|
|
10701
|
+
const t = [...Rt(this.params.length), ...this.params.map((n) => Bn[n.type])], e = this.returnType ? [1, Bn[this.returnType]] : [0];
|
|
10655
10702
|
return [96, ...t, ...e];
|
|
10656
10703
|
}
|
|
10657
10704
|
getBody() {
|
|
10658
10705
|
const t = this.locals.map((n) => [
|
|
10659
10706
|
...Rt(n.length),
|
|
10660
|
-
|
|
10707
|
+
Bn[n.type]
|
|
10661
10708
|
]), e = [
|
|
10662
10709
|
...Rt(this.locals.length),
|
|
10663
10710
|
...[].concat(...t),
|
|
@@ -10673,10 +10720,10 @@ class qa {
|
|
|
10673
10720
|
this.code.push(...[].concat(...t));
|
|
10674
10721
|
}
|
|
10675
10722
|
getCodeBuilder() {
|
|
10676
|
-
return new
|
|
10723
|
+
return new or(this);
|
|
10677
10724
|
}
|
|
10678
10725
|
}
|
|
10679
|
-
class
|
|
10726
|
+
class Ni {
|
|
10680
10727
|
constructor() {
|
|
10681
10728
|
this.functions = [], this.functionIdxByName = {}, this.nImportFunctions = 0, this.nInternalFunctions = 0, this.memory = {
|
|
10682
10729
|
pagesSize: 1,
|
|
@@ -10686,8 +10733,8 @@ class Mi {
|
|
|
10686
10733
|
}
|
|
10687
10734
|
build() {
|
|
10688
10735
|
return this._setSignatures(), new Uint8Array([
|
|
10689
|
-
...
|
|
10690
|
-
...
|
|
10736
|
+
...wn(1836278016),
|
|
10737
|
+
...wn(1),
|
|
10691
10738
|
...this._buildType(),
|
|
10692
10739
|
...this._buildImport(),
|
|
10693
10740
|
...this._buildFunctionDeclarations(),
|
|
@@ -10777,8 +10824,8 @@ class Mi {
|
|
|
10777
10824
|
_buildImport() {
|
|
10778
10825
|
const t = [];
|
|
10779
10826
|
t.push([
|
|
10780
|
-
...
|
|
10781
|
-
...
|
|
10827
|
+
...Ue(this.memory.moduleName),
|
|
10828
|
+
...Ue(this.memory.fieldName),
|
|
10782
10829
|
2,
|
|
10783
10830
|
0,
|
|
10784
10831
|
//Flags no init valua
|
|
@@ -10786,8 +10833,8 @@ class Mi {
|
|
|
10786
10833
|
]);
|
|
10787
10834
|
for (let e = 0; e < this.nImportFunctions; e++)
|
|
10788
10835
|
t.push([
|
|
10789
|
-
...
|
|
10790
|
-
...
|
|
10836
|
+
...Ue(this.functions[e].moduleName),
|
|
10837
|
+
...Ue(this.functions[e].fieldName),
|
|
10791
10838
|
0,
|
|
10792
10839
|
...Rt(this.functions[e].signatureIdx)
|
|
10793
10840
|
]);
|
|
@@ -10845,7 +10892,7 @@ class Mi {
|
|
|
10845
10892
|
const t = [];
|
|
10846
10893
|
for (let e = 0; e < this.exports.length; e++)
|
|
10847
10894
|
t.push([
|
|
10848
|
-
...
|
|
10895
|
+
...Ue(this.exports[e].exportName),
|
|
10849
10896
|
0,
|
|
10850
10897
|
...Rt(this.exports[e].idx)
|
|
10851
10898
|
]);
|
|
@@ -10871,7 +10918,7 @@ class Mi {
|
|
|
10871
10918
|
0,
|
|
10872
10919
|
11,
|
|
10873
10920
|
4,
|
|
10874
|
-
...
|
|
10921
|
+
...wn(this.free)
|
|
10875
10922
|
]);
|
|
10876
10923
|
for (let e = 0; e < this.datas.length; e++)
|
|
10877
10924
|
t.push([
|
|
@@ -10889,9 +10936,9 @@ class Mi {
|
|
|
10889
10936
|
}
|
|
10890
10937
|
}
|
|
10891
10938
|
globalThis.curve_bn128 = null;
|
|
10892
|
-
async function
|
|
10893
|
-
const e = new
|
|
10894
|
-
e.setMemory(25),
|
|
10939
|
+
async function cr(c, t) {
|
|
10940
|
+
const e = new Ni();
|
|
10941
|
+
e.setMemory(25), Ns(e), t && t(e);
|
|
10895
10942
|
const n = {};
|
|
10896
10943
|
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)
|
|
10897
10944
|
return globalThis.curve_bn128;
|
|
@@ -10904,15 +10951,15 @@ async function Js(c, t) {
|
|
|
10904
10951
|
n8r: 32,
|
|
10905
10952
|
cofactorG2: ee("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d", 16),
|
|
10906
10953
|
singleThread: !!c
|
|
10907
|
-
}, s = await
|
|
10954
|
+
}, s = await qi(a);
|
|
10908
10955
|
return s.terminate = async function() {
|
|
10909
10956
|
a.singleThread || (globalThis.curve_bn128 = null, await this.tm.terminate());
|
|
10910
10957
|
}, c || (globalThis.curve_bn128 = s), s;
|
|
10911
10958
|
}
|
|
10912
10959
|
globalThis.curve_bls12381 = null;
|
|
10913
|
-
async function
|
|
10914
|
-
const e = new
|
|
10915
|
-
e.setMemory(25),
|
|
10960
|
+
async function sr(c, t) {
|
|
10961
|
+
const e = new Ni();
|
|
10962
|
+
e.setMemory(25), zs(e), t && t(e);
|
|
10916
10963
|
const n = {};
|
|
10917
10964
|
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)
|
|
10918
10965
|
return globalThis.curve_bls12381;
|
|
@@ -10926,7 +10973,7 @@ async function Ks(c, t) {
|
|
|
10926
10973
|
cofactorG1: ee("0x396c8c005555e1568c00aaab0000aaab", 16),
|
|
10927
10974
|
cofactorG2: ee("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5", 16),
|
|
10928
10975
|
singleThread: !!c
|
|
10929
|
-
}, s = await
|
|
10976
|
+
}, s = await qi(a);
|
|
10930
10977
|
return s.terminate = async function() {
|
|
10931
10978
|
a.singleThread || (globalThis.curve_bls12381 = null, await this.tm.terminate());
|
|
10932
10979
|
}, c || (globalThis.curve_bls12381 = s), s;
|
|
@@ -10935,109 +10982,109 @@ ee("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
|
|
|
10935
10982
|
ee("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
|
10936
10983
|
ee("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16);
|
|
10937
10984
|
ee("21888242871839275222246405745257275088696311157297823662689037894645226208583");
|
|
10938
|
-
const Yt =
|
|
10985
|
+
const Yt = Dc, un = Zs;
|
|
10939
10986
|
Yt.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
|
|
10940
10987
|
Yt.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
|
10941
|
-
const
|
|
10988
|
+
const rr = Yt.e("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab", 16), lr = Yt.e("21888242871839275222246405745257275088696311157297823662689037894645226208583");
|
|
10942
10989
|
async function Kn(c) {
|
|
10943
10990
|
let t;
|
|
10944
|
-
if (Yt.eq(c,
|
|
10945
|
-
t = await
|
|
10946
|
-
else if (Yt.eq(c,
|
|
10947
|
-
t = await
|
|
10991
|
+
if (Yt.eq(c, lr))
|
|
10992
|
+
t = await cr();
|
|
10993
|
+
else if (Yt.eq(c, rr))
|
|
10994
|
+
t = await sr();
|
|
10948
10995
|
else
|
|
10949
10996
|
throw new Error(`Curve not supported: ${Yt.toString(c)}`);
|
|
10950
10997
|
return t;
|
|
10951
10998
|
}
|
|
10952
|
-
function
|
|
10999
|
+
function dn(c) {
|
|
10953
11000
|
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;
|
|
10954
11001
|
}
|
|
10955
|
-
const
|
|
10956
|
-
async function
|
|
11002
|
+
const ur = 1, dr = 2, zi = 10, fr = 2;
|
|
11003
|
+
async function de(c, t, e) {
|
|
10957
11004
|
const n = await c.read(t.G1.F.n8 * 2), a = t.G1.fromRprLEM(n, 0);
|
|
10958
11005
|
return e ? t.G1.toObject(a) : a;
|
|
10959
11006
|
}
|
|
10960
|
-
async function
|
|
11007
|
+
async function $e(c, t, e) {
|
|
10961
11008
|
const n = await c.read(t.G2.F.n8 * 2), a = t.G2.fromRprLEM(n, 0);
|
|
10962
11009
|
return e ? t.G2.toObject(a) : a;
|
|
10963
11010
|
}
|
|
10964
|
-
async function
|
|
10965
|
-
await
|
|
11011
|
+
async function _r(c, t, e) {
|
|
11012
|
+
await We(c, t, 1);
|
|
10966
11013
|
const n = await c.readULE32();
|
|
10967
|
-
if (await
|
|
10968
|
-
return await
|
|
10969
|
-
if (n ===
|
|
10970
|
-
return await
|
|
10971
|
-
if (n ===
|
|
10972
|
-
return await
|
|
11014
|
+
if (await Xe(c), n === ur)
|
|
11015
|
+
return await gr(c, t, e);
|
|
11016
|
+
if (n === dr)
|
|
11017
|
+
return await pr(c, t, e);
|
|
11018
|
+
if (n === zi)
|
|
11019
|
+
return await hr(c, t, e);
|
|
10973
11020
|
throw new Error("Protocol not supported: ");
|
|
10974
11021
|
}
|
|
10975
|
-
async function
|
|
11022
|
+
async function gr(c, t, e) {
|
|
10976
11023
|
const n = {};
|
|
10977
|
-
n.protocol = "groth16", await
|
|
11024
|
+
n.protocol = "groth16", await We(c, t, 2);
|
|
10978
11025
|
const a = await c.readULE32();
|
|
10979
|
-
n.n8q = a, n.q = await
|
|
11026
|
+
n.n8q = a, n.q = await Be(c, a);
|
|
10980
11027
|
const s = await c.readULE32();
|
|
10981
|
-
return n.n8r = s, n.r = await
|
|
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;
|
|
10982
11029
|
}
|
|
10983
|
-
async function
|
|
11030
|
+
async function pr(c, t, e) {
|
|
10984
11031
|
const n = {};
|
|
10985
|
-
n.protocol = "plonk", await
|
|
11032
|
+
n.protocol = "plonk", await We(c, t, 2);
|
|
10986
11033
|
const a = await c.readULE32();
|
|
10987
|
-
n.n8q = a, n.q = await
|
|
11034
|
+
n.n8q = a, n.q = await Be(c, a);
|
|
10988
11035
|
const s = await c.readULE32();
|
|
10989
|
-
return n.n8r = s, n.r = await
|
|
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;
|
|
10990
11037
|
}
|
|
10991
|
-
async function
|
|
11038
|
+
async function hr(c, t, e) {
|
|
10992
11039
|
const n = {};
|
|
10993
|
-
n.protocol = "fflonk", n.protocolId =
|
|
11040
|
+
n.protocol = "fflonk", n.protocolId = zi, await We(c, t, fr);
|
|
10994
11041
|
const a = await c.readULE32();
|
|
10995
|
-
n.n8q = a, n.q = await
|
|
11042
|
+
n.n8q = a, n.q = await Be(c, a), n.curve = await Kn(n.q);
|
|
10996
11043
|
const s = await c.readULE32();
|
|
10997
|
-
return n.n8r = s, n.r = await
|
|
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;
|
|
10998
11045
|
}
|
|
10999
|
-
async function
|
|
11046
|
+
async function Lr(c, t, e) {
|
|
11000
11047
|
await ua(c, 1);
|
|
11001
11048
|
const n = (Math.floor((Yt.bitLength(e) - 1) / 64) + 1) * 8;
|
|
11002
|
-
if (await c.writeULE32(n), await
|
|
11049
|
+
if (await c.writeULE32(n), await mc(c, e, n), t.byteLength % n != 0)
|
|
11003
11050
|
throw new Error("Invalid witness length");
|
|
11004
11051
|
await c.writeULE32(t.byteLength / n), await da(c), await ua(c, 2), await c.write(t), await da(c);
|
|
11005
11052
|
}
|
|
11006
|
-
async function
|
|
11007
|
-
await
|
|
11008
|
-
const e = await c.readULE32(), n = await
|
|
11009
|
-
return await
|
|
11053
|
+
async function mr(c, t) {
|
|
11054
|
+
await We(c, t, 1);
|
|
11055
|
+
const e = await c.readULE32(), n = await Be(c, e), a = await c.readULE32();
|
|
11056
|
+
return await Xe(c), { n8: e, q: n, nWitness: a };
|
|
11010
11057
|
}
|
|
11011
|
-
const { stringifyBigInts: Da } =
|
|
11012
|
-
async function
|
|
11013
|
-
const { fd: n, sections: a } = await la(t, "wtns", 2, 33554432, 8388608), s = await
|
|
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);
|
|
11014
11061
|
if (C.protocol != "groth16")
|
|
11015
11062
|
throw new Error("zkey file is not groth16");
|
|
11016
11063
|
if (!Yt.eq(C.r, s.q))
|
|
11017
11064
|
throw new Error("Curve of the witness does not match the curve of the proving key");
|
|
11018
11065
|
if (s.nWitness != C.nVars)
|
|
11019
11066
|
throw new Error(`Invalid witness length. Circuit: ${C.nVars}, witness: ${s.nWitness}`);
|
|
11020
|
-
const l = C.curve, o = l.Fr, y = l.G1, E = l.G2, m =
|
|
11067
|
+
const l = C.curve, o = l.Fr, y = l.G1, E = l.G2, m = dn(C.domainSize);
|
|
11021
11068
|
e && e.debug("Reading Wtns");
|
|
11022
|
-
const x = await
|
|
11069
|
+
const x = await Fe(n, a, 2);
|
|
11023
11070
|
e && e.debug("Reading Coeffs");
|
|
11024
|
-
const O = await
|
|
11071
|
+
const O = await Fe(g, d, 4);
|
|
11025
11072
|
e && e.debug("Building ABC");
|
|
11026
|
-
const [L, I, v] = await
|
|
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");
|
|
11027
11074
|
e && e.debug("Join ABC");
|
|
11028
|
-
const A = await
|
|
11075
|
+
const A = await Cr(l, C, F, R, D, e);
|
|
11029
11076
|
let M = {};
|
|
11030
11077
|
e && e.debug("Reading A Points");
|
|
11031
|
-
const H = await
|
|
11078
|
+
const H = await Fe(g, d, 5);
|
|
11032
11079
|
M.pi_a = await l.G1.multiExpAffine(H, x, e, "multiexp A"), e && e.debug("Reading B1 Points");
|
|
11033
|
-
const ut = await
|
|
11080
|
+
const ut = await Fe(g, d, 6);
|
|
11034
11081
|
let nt = await l.G1.multiExpAffine(ut, x, e, "multiexp B1");
|
|
11035
11082
|
e && e.debug("Reading B2 Points");
|
|
11036
|
-
const J = await
|
|
11083
|
+
const J = await Fe(g, d, 7);
|
|
11037
11084
|
M.pi_b = await l.G2.multiExpAffine(J, x, e, "multiexp B2"), e && e.debug("Reading C Points");
|
|
11038
|
-
const ft = await
|
|
11085
|
+
const ft = await Fe(g, d, 8);
|
|
11039
11086
|
M.pi_c = await l.G1.multiExpAffine(ft, x.slice((C.nPublic + 1) * l.Fr.n8), e, "multiexp C"), e && e.debug("Reading H Points");
|
|
11040
|
-
const at = await
|
|
11087
|
+
const at = await Fe(g, d, 9), _t = await l.G1.multiExpAffine(at, A, e, "multiexp H"), zt = l.Fr.random(), G = l.Fr.random();
|
|
11041
11088
|
M.pi_a = y.add(M.pi_a, C.vk_alpha_1), M.pi_a = y.add(M.pi_a, y.timesFr(C.vk_delta_1, zt)), M.pi_b = E.add(M.pi_b, C.vk_beta_2), M.pi_b = E.add(M.pi_b, E.timesFr(C.vk_delta_2, G)), nt = y.add(nt, C.vk_beta_1), nt = y.add(nt, y.timesFr(C.vk_delta_1, G)), M.pi_c = y.add(M.pi_c, _t), M.pi_c = y.add(M.pi_c, y.timesFr(M.pi_a, G)), M.pi_c = y.add(M.pi_c, y.timesFr(nt, zt)), M.pi_c = y.add(M.pi_c, y.timesFr(C.vk_delta_1, o.neg(o.mul(zt, G))));
|
|
11042
11089
|
let K = [];
|
|
11043
11090
|
for (let P = 1; P <= C.nPublic; P++) {
|
|
@@ -11046,7 +11093,7 @@ async function ur(c, t, e) {
|
|
|
11046
11093
|
}
|
|
11047
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 };
|
|
11048
11095
|
}
|
|
11049
|
-
async function
|
|
11096
|
+
async function yr(c, t, e, n, a) {
|
|
11050
11097
|
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];
|
|
11051
11098
|
for (let E = 0; E < d; E++) {
|
|
11052
11099
|
a && E % 1e6 == 0 && a.debug(`QAP AB: ${E}/${d}`);
|
|
@@ -11069,7 +11116,7 @@ async function dr(c, t, e, n, a) {
|
|
|
11069
11116
|
);
|
|
11070
11117
|
return [C, l, o];
|
|
11071
11118
|
}
|
|
11072
|
-
async function
|
|
11119
|
+
async function Cr(c, t, e, n, a, s) {
|
|
11073
11120
|
const d = c.Fr.n8, C = Math.floor(e.byteLength / c.Fr.n8), l = [];
|
|
11074
11121
|
for (let m = 0; m < C; m += 4194304) {
|
|
11075
11122
|
s && s.debug(`JoinABC: ${m}/${C}`);
|
|
@@ -11094,7 +11141,7 @@ async function fr(c, t, e, n, a, s) {
|
|
|
11094
11141
|
y.set(o[m][0], E), E += o[m][0].byteLength;
|
|
11095
11142
|
return y;
|
|
11096
11143
|
}
|
|
11097
|
-
function
|
|
11144
|
+
function Ui(c) {
|
|
11098
11145
|
var t = [];
|
|
11099
11146
|
return e(t, c), t;
|
|
11100
11147
|
function e(n, a) {
|
|
@@ -11105,7 +11152,7 @@ function Ni(c) {
|
|
|
11105
11152
|
n.push(a);
|
|
11106
11153
|
}
|
|
11107
11154
|
}
|
|
11108
|
-
function
|
|
11155
|
+
function ji(c) {
|
|
11109
11156
|
const t = BigInt(2) ** BigInt(64);
|
|
11110
11157
|
let e = BigInt("0xCBF29CE484222325");
|
|
11111
11158
|
for (var n = 0; n < c.length; n++)
|
|
@@ -11113,7 +11160,7 @@ function zi(c) {
|
|
|
11113
11160
|
let a = e.toString(16), s = 16 - a.length;
|
|
11114
11161
|
return a = "0".repeat(s).concat(a), a;
|
|
11115
11162
|
}
|
|
11116
|
-
function
|
|
11163
|
+
function Ar(c, t) {
|
|
11117
11164
|
const e = [];
|
|
11118
11165
|
let n = BigInt(c);
|
|
11119
11166
|
const a = BigInt(4294967296);
|
|
@@ -11124,7 +11171,7 @@ function _r(c, t) {
|
|
|
11124
11171
|
e.unshift(0), s--;
|
|
11125
11172
|
return e;
|
|
11126
11173
|
}
|
|
11127
|
-
async function
|
|
11174
|
+
async function Fr(c, t) {
|
|
11128
11175
|
t = t || {};
|
|
11129
11176
|
let e = 32767, n, a = !1;
|
|
11130
11177
|
for (; !a; )
|
|
@@ -11191,7 +11238,7 @@ async function gr(c, t) {
|
|
|
11191
11238
|
});
|
|
11192
11239
|
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());
|
|
11193
11240
|
const m = t && (t.sanityCheck || t.logGetSignal || t.logSetSignal || t.logStartComponent || t.logFinishComponent);
|
|
11194
|
-
return l === 2 ? g = new
|
|
11241
|
+
return l === 2 ? g = new wr(E, m) : g = new Er(n, E, m), g;
|
|
11195
11242
|
function x() {
|
|
11196
11243
|
for (var L = "", I = E.exports.getMessageChar(); I != 0; )
|
|
11197
11244
|
L += String.fromCharCode(I), I = E.exports.getMessageChar();
|
|
@@ -11204,13 +11251,13 @@ async function gr(c, t) {
|
|
|
11204
11251
|
return String.fromCharCode.apply(null, v);
|
|
11205
11252
|
}
|
|
11206
11253
|
}
|
|
11207
|
-
class
|
|
11254
|
+
class Er {
|
|
11208
11255
|
constructor(t, e, n) {
|
|
11209
11256
|
this.memory = t, this.i32 = new Uint32Array(t.buffer), this.instance = e, this.n32 = (this.instance.exports.getFrLen() >> 2) - 2;
|
|
11210
11257
|
const a = this.instance.exports.getPRawPrime(), s = new Array(this.n32);
|
|
11211
11258
|
for (let g = 0; g < this.n32; g++)
|
|
11212
11259
|
s[this.n32 - 1 - g] = this.i32[(a >> 2) + g];
|
|
11213
|
-
this.prime = Yt.fromArray(s, 4294967296), this.Fr = new
|
|
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;
|
|
11214
11261
|
}
|
|
11215
11262
|
circom_version() {
|
|
11216
11263
|
return 1;
|
|
@@ -11219,13 +11266,13 @@ class pr {
|
|
|
11219
11266
|
this.instance.exports.init(this.sanityCheck || e ? 1 : 0);
|
|
11220
11267
|
const n = this.allocInt(), a = this.allocFr();
|
|
11221
11268
|
Object.keys(t).forEach((g) => {
|
|
11222
|
-
const d =
|
|
11269
|
+
const d = ji(g), C = parseInt(d.slice(0, 8), 16), l = parseInt(d.slice(8, 16), 16);
|
|
11223
11270
|
try {
|
|
11224
11271
|
this.instance.exports.getSignalOffset32(n, 0, C, l);
|
|
11225
11272
|
} catch {
|
|
11226
11273
|
throw new Error(`Signal ${g} is not an input of the circuit.`);
|
|
11227
11274
|
}
|
|
11228
|
-
const o = this.getInt(n), y =
|
|
11275
|
+
const o = this.getInt(n), y = Ui(t[g]);
|
|
11229
11276
|
for (let E = 0; E < y.length; E++)
|
|
11230
11277
|
this.setFr(a, y[E]), this.instance.exports.setSignal(0, 0, o + E, a);
|
|
11231
11278
|
});
|
|
@@ -11292,7 +11339,7 @@ class pr {
|
|
|
11292
11339
|
}
|
|
11293
11340
|
}
|
|
11294
11341
|
}
|
|
11295
|
-
class
|
|
11342
|
+
class wr {
|
|
11296
11343
|
constructor(t, e) {
|
|
11297
11344
|
this.instance = t, this.version = this.instance.exports.getVersion(), this.n32 = this.instance.exports.getFieldNumLen32(), this.instance.exports.getRawPrime();
|
|
11298
11345
|
const n = new Array(this.n32);
|
|
@@ -11308,9 +11355,9 @@ class hr {
|
|
|
11308
11355
|
const n = Object.keys(t);
|
|
11309
11356
|
var a = 0;
|
|
11310
11357
|
if (n.forEach((s) => {
|
|
11311
|
-
const g =
|
|
11358
|
+
const g = ji(s), d = parseInt(g.slice(0, 8), 16), C = parseInt(g.slice(8, 16), 16), l = Ui(t[s]);
|
|
11312
11359
|
for (let o = 0; o < l.length; o++) {
|
|
11313
|
-
const y =
|
|
11360
|
+
const y = Ar(l[o], this.n32);
|
|
11314
11361
|
for (let E = 0; E < this.n32; E++)
|
|
11315
11362
|
this.instance.exports.writeSharedRWMemory(E, y[this.n32 - 1 - E]);
|
|
11316
11363
|
try {
|
|
@@ -11354,44 +11401,44 @@ class hr {
|
|
|
11354
11401
|
return a;
|
|
11355
11402
|
}
|
|
11356
11403
|
}
|
|
11357
|
-
const { unstringifyBigInts:
|
|
11358
|
-
async function
|
|
11359
|
-
const a =
|
|
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);
|
|
11360
11407
|
await s.close();
|
|
11361
|
-
const d = await
|
|
11408
|
+
const d = await Fr(g);
|
|
11362
11409
|
if (d.circom_version() == 1) {
|
|
11363
|
-
const C = await d.calculateBinWitness(a), l = await
|
|
11364
|
-
await
|
|
11410
|
+
const C = await d.calculateBinWitness(a), l = await Lc(e, "wtns", 2, 2);
|
|
11411
|
+
await Lr(l, C, d.prime), await l.close();
|
|
11365
11412
|
} else {
|
|
11366
|
-
const C = await
|
|
11413
|
+
const C = await ai(e), l = await d.calculateWTNSBin(a);
|
|
11367
11414
|
await C.write(l), await C.close();
|
|
11368
11415
|
}
|
|
11369
11416
|
}
|
|
11370
|
-
const { unstringifyBigInts:
|
|
11371
|
-
async function
|
|
11372
|
-
const a =
|
|
11417
|
+
const { unstringifyBigInts: xr } = un;
|
|
11418
|
+
async function Sr(c, t, e, n) {
|
|
11419
|
+
const a = xr(c), s = {
|
|
11373
11420
|
type: "mem"
|
|
11374
11421
|
};
|
|
11375
|
-
return await
|
|
11422
|
+
return await vr(a, t, s), await br(e, s, n);
|
|
11376
11423
|
}
|
|
11377
|
-
const { unstringifyBigInts: Ma } =
|
|
11378
|
-
function
|
|
11424
|
+
const { unstringifyBigInts: Ma } = un;
|
|
11425
|
+
function he(c) {
|
|
11379
11426
|
let t = c.toString(16);
|
|
11380
11427
|
for (; t.length < 64; )
|
|
11381
11428
|
t = "0" + t;
|
|
11382
11429
|
return t = `"0x${t}"`, t;
|
|
11383
11430
|
}
|
|
11384
|
-
async function
|
|
11431
|
+
async function Ir(c, t) {
|
|
11385
11432
|
const e = Ma(c), n = Ma(t);
|
|
11386
11433
|
let a = "";
|
|
11387
11434
|
for (let g = 0; g < n.length; g++)
|
|
11388
|
-
a != "" && (a = a + ","), a = a +
|
|
11435
|
+
a != "" && (a = a + ","), a = a + he(n[g]);
|
|
11389
11436
|
let s;
|
|
11390
|
-
return s = `[${
|
|
11437
|
+
return s = `[${he(e.pi_a[0])}, ${he(e.pi_a[1])}],[[${he(e.pi_b[0][1])}, ${he(e.pi_b[0][0])}],[${he(e.pi_b[1][1])}, ${he(e.pi_b[1][0])}]],[${he(e.pi_c[0])}, ${he(e.pi_c[1])}],[${a}]`, s;
|
|
11391
11438
|
}
|
|
11392
11439
|
Yt.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001", 16);
|
|
11393
11440
|
Yt.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
|
11394
|
-
var
|
|
11441
|
+
var Or = {}, $i = {};
|
|
11395
11442
|
(function(c) {
|
|
11396
11443
|
var t = /[|\\{}()[\]^$+*?.]/g, e = Object.prototype.hasOwnProperty, n = function(l, o) {
|
|
11397
11444
|
return e.apply(l, [o]);
|
|
@@ -11476,19 +11523,19 @@ function encode_char(c) {
|
|
|
11476
11523
|
return { __proto__: null };
|
|
11477
11524
|
};
|
|
11478
11525
|
}();
|
|
11479
|
-
})(
|
|
11480
|
-
const
|
|
11526
|
+
})($i);
|
|
11527
|
+
const Pr = "ejs", kr = "Embedded JavaScript templates", Tr = [
|
|
11481
11528
|
"template",
|
|
11482
11529
|
"engine",
|
|
11483
11530
|
"ejs"
|
|
11484
|
-
],
|
|
11531
|
+
], qr = "3.1.9", Dr = "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)", Mr = "Apache-2.0", Rr = {
|
|
11485
11532
|
ejs: "./bin/cli.js"
|
|
11486
|
-
},
|
|
11533
|
+
}, Nr = "./lib/ejs.js", zr = "ejs.min.js", Ur = "ejs.min.js", jr = {
|
|
11487
11534
|
type: "git",
|
|
11488
11535
|
url: "git://github.com/mde/ejs.git"
|
|
11489
|
-
},
|
|
11536
|
+
}, $r = "https://github.com/mde/ejs/issues", Gr = "https://github.com/mde/ejs", Zr = {
|
|
11490
11537
|
jake: "^10.8.5"
|
|
11491
|
-
},
|
|
11538
|
+
}, Wr = {
|
|
11492
11539
|
browserify: "^16.5.1",
|
|
11493
11540
|
eslint: "^6.8.0",
|
|
11494
11541
|
"git-directory-deploy": "^1.5.1",
|
|
@@ -11496,28 +11543,28 @@ const Fr = "ejs", Er = "Embedded JavaScript templates", wr = [
|
|
|
11496
11543
|
"lru-cache": "^4.0.1",
|
|
11497
11544
|
mocha: "^10.2.0",
|
|
11498
11545
|
"uglify-js": "^3.3.16"
|
|
11499
|
-
},
|
|
11546
|
+
}, Xr = {
|
|
11500
11547
|
node: ">=0.10.0"
|
|
11501
|
-
},
|
|
11548
|
+
}, Vr = {
|
|
11502
11549
|
test: "mocha -u tdd"
|
|
11503
|
-
},
|
|
11504
|
-
name:
|
|
11505
|
-
description:
|
|
11506
|
-
keywords:
|
|
11507
|
-
version:
|
|
11508
|
-
author:
|
|
11509
|
-
license:
|
|
11510
|
-
bin:
|
|
11511
|
-
main:
|
|
11512
|
-
jsdelivr:
|
|
11513
|
-
unpkg:
|
|
11514
|
-
repository:
|
|
11515
|
-
bugs:
|
|
11516
|
-
homepage:
|
|
11517
|
-
dependencies:
|
|
11518
|
-
devDependencies:
|
|
11519
|
-
engines:
|
|
11520
|
-
scripts:
|
|
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
|
|
11521
11568
|
};
|
|
11522
11569
|
(function(c) {
|
|
11523
11570
|
/**
|
|
@@ -11527,7 +11574,7 @@ const Fr = "ejs", Er = "Embedded JavaScript templates", wr = [
|
|
|
11527
11574
|
* @project EJS
|
|
11528
11575
|
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
11529
11576
|
*/
|
|
11530
|
-
var t =
|
|
11577
|
+
var t = bo, e = mo(), n = $i, a = !1, s = Hr.version, g = "<", d = ">", C = "%", l = "locals", o = "ejs", y = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", E = [
|
|
11531
11578
|
"delimiter",
|
|
11532
11579
|
"scope",
|
|
11533
11580
|
"context",
|
|
@@ -11823,7 +11870,7 @@ try {
|
|
|
11823
11870
|
`);
|
|
11824
11871
|
}
|
|
11825
11872
|
}, c.escapeXML = n.escapeXML, c.__express = c.renderFile, c.VERSION = s, c.name = o, typeof window < "u" && (window.ejs = c);
|
|
11826
|
-
})(
|
|
11873
|
+
})(Or);
|
|
11827
11874
|
var Yn = { exports: {} };
|
|
11828
11875
|
Yn.exports;
|
|
11829
11876
|
(function(c) {
|
|
@@ -11837,7 +11884,7 @@ Yn.exports;
|
|
|
11837
11884
|
{ n: "primitive", f: r, s: "be primitive type" },
|
|
11838
11885
|
{ n: "contains", f: $t, s: "contain {e}" },
|
|
11839
11886
|
{ n: "in", f: Jt, s: "be in {e}" },
|
|
11840
|
-
{ n: "containsKey", f:
|
|
11887
|
+
{ n: "containsKey", f: re, s: "contain key {e}" },
|
|
11841
11888
|
{ n: "keyIn", f: te, s: "be key in {e}" },
|
|
11842
11889
|
{ n: "zero", f: h, s: "be 0" },
|
|
11843
11890
|
{ n: "one", f: R, s: "be 1" },
|
|
@@ -12084,11 +12131,11 @@ Yn.exports;
|
|
|
12084
12131
|
function Jt(k, et) {
|
|
12085
12132
|
return $t(et, k);
|
|
12086
12133
|
}
|
|
12087
|
-
function
|
|
12134
|
+
function re(k, et) {
|
|
12088
12135
|
return F(k) ? I && Lt(k, Map) ? k.has(et) : pt(k) && !T(+et) ? !1 : !!k[et] : !1;
|
|
12089
12136
|
}
|
|
12090
12137
|
function te(k, et) {
|
|
12091
|
-
return
|
|
12138
|
+
return re(et, k);
|
|
12092
12139
|
}
|
|
12093
12140
|
function Pt(k, et) {
|
|
12094
12141
|
return F(k) && k.length === et;
|
|
@@ -12119,8 +12166,8 @@ Yn.exports;
|
|
|
12119
12166
|
m(et) || s.object(et);
|
|
12120
12167
|
var qt = y(k || {});
|
|
12121
12168
|
wt(et, function(Ht, Qt) {
|
|
12122
|
-
qt.some(function(Kt,
|
|
12123
|
-
return Kt === Ht ? (qt.splice(
|
|
12169
|
+
qt.some(function(Kt, fe) {
|
|
12170
|
+
return Kt === Ht ? (qt.splice(fe, 1), !0) : !1;
|
|
12124
12171
|
}), Zt(Qt) ? g.assigned(k) ? dt[Ht] = !!Qt.m : dt[Ht] = Qt(k[Ht]) : dt[Ht] = Wt(k[Ht], Qt);
|
|
12125
12172
|
});
|
|
12126
12173
|
}
|
|
@@ -12234,12 +12281,12 @@ Yn.exports;
|
|
|
12234
12281
|
function ht(k) {
|
|
12235
12282
|
var et, dt, qt, Ht;
|
|
12236
12283
|
return et = k.shift(), dt = k.pop(), qt = k.pop(), Ht = k.pop(), wt(Ht, function(Qt, Kt) {
|
|
12237
|
-
var
|
|
12238
|
-
|
|
12284
|
+
var fe = e[Qt];
|
|
12285
|
+
fe && dt && (fe = fe.replace("to", dt + "to")), Object.defineProperty(qt, Qt, {
|
|
12239
12286
|
configurable: !1,
|
|
12240
12287
|
enumerable: !0,
|
|
12241
12288
|
writable: !1,
|
|
12242
|
-
value: et.apply(null, k.concat(Kt,
|
|
12289
|
+
value: et.apply(null, k.concat(Kt, fe))
|
|
12243
12290
|
});
|
|
12244
12291
|
}), qt;
|
|
12245
12292
|
}
|
|
@@ -12264,9 +12311,9 @@ Yn.exports;
|
|
|
12264
12311
|
function kt(k) {
|
|
12265
12312
|
c !== null && c.exports ? c.exports = k : t.check = k;
|
|
12266
12313
|
}
|
|
12267
|
-
})(
|
|
12314
|
+
})(en);
|
|
12268
12315
|
})(Yn);
|
|
12269
|
-
var ta = Yn.exports,
|
|
12316
|
+
var ta = Yn.exports, Qr = { exports: {} };
|
|
12270
12317
|
(function(c) {
|
|
12271
12318
|
c.exports = {
|
|
12272
12319
|
array: "arr",
|
|
@@ -12279,22 +12326,22 @@ var ta = Yn.exports, Ur = { exports: {} };
|
|
|
12279
12326
|
end: "end",
|
|
12280
12327
|
error: "err"
|
|
12281
12328
|
}, 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`;
|
|
12282
|
-
})(
|
|
12283
|
-
|
|
12284
|
-
const
|
|
12285
|
-
|
|
12286
|
-
var
|
|
12287
|
-
function
|
|
12288
|
-
return Ra.not.instanceStrict(this,
|
|
12329
|
+
})(Qr);
|
|
12330
|
+
ja.EventEmitter;
|
|
12331
|
+
const Jr = zn, Gi = $a().Readable, Ra = ta;
|
|
12332
|
+
Jr.inherits(cn, Gi);
|
|
12333
|
+
var Zi = cn;
|
|
12334
|
+
function cn(c, t) {
|
|
12335
|
+
return Ra.not.instanceStrict(this, cn) ? new cn(c) : (Ra.assert.function(c, "Invalid read implementation"), this._read = function() {
|
|
12289
12336
|
c();
|
|
12290
|
-
},
|
|
12337
|
+
}, Gi.call(this, t));
|
|
12291
12338
|
}
|
|
12292
|
-
const
|
|
12293
|
-
|
|
12339
|
+
const Kr = ta, Wi = Zi, Yr = zn;
|
|
12340
|
+
Yr.inherits(Mn, Wi);
|
|
12294
12341
|
function Mn(c, t) {
|
|
12295
|
-
return
|
|
12342
|
+
return Kr.not.instanceStrict(this, Mn) ? new Mn(c, t) : Wi.call(this, c, { ...t, objectMode: !0 });
|
|
12296
12343
|
}
|
|
12297
|
-
class
|
|
12344
|
+
class fn extends Array {
|
|
12298
12345
|
constructor(t) {
|
|
12299
12346
|
let e, n;
|
|
12300
12347
|
if (!Na(t))
|
|
@@ -12335,17 +12382,17 @@ function Rn(c) {
|
|
|
12335
12382
|
function za(c, t) {
|
|
12336
12383
|
return c === 0 ? 0 : c < 0 ? (t - Math.abs(c)) % t : c % t;
|
|
12337
12384
|
}
|
|
12338
|
-
function
|
|
12385
|
+
function _n() {
|
|
12339
12386
|
throw new Error("Not implemented");
|
|
12340
12387
|
}
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
function
|
|
12388
|
+
fn.prototype.push = _n;
|
|
12389
|
+
fn.prototype.pop = _n;
|
|
12390
|
+
fn.prototype.shift = _n;
|
|
12391
|
+
fn.prototype.unshift = _n;
|
|
12392
|
+
function tn(c) {
|
|
12346
12393
|
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.');
|
|
12347
12394
|
}
|
|
12348
|
-
var
|
|
12395
|
+
var tl = { exports: {} };
|
|
12349
12396
|
/*! jsonpath 1.1.1 */
|
|
12350
12397
|
(function(c, t) {
|
|
12351
12398
|
(function(e) {
|
|
@@ -12355,7 +12402,7 @@ var Zr = { exports: {} };
|
|
|
12355
12402
|
function g(l, o) {
|
|
12356
12403
|
if (!a[l]) {
|
|
12357
12404
|
if (!n[l]) {
|
|
12358
|
-
var y = typeof
|
|
12405
|
+
var y = typeof tn == "function" && tn;
|
|
12359
12406
|
if (!o && y)
|
|
12360
12407
|
return y(l, !0);
|
|
12361
12408
|
if (d)
|
|
@@ -12371,7 +12418,7 @@ var Zr = { exports: {} };
|
|
|
12371
12418
|
}
|
|
12372
12419
|
return a[l].exports;
|
|
12373
12420
|
}
|
|
12374
|
-
for (var d = typeof
|
|
12421
|
+
for (var d = typeof tn == "function" && tn, C = 0; C < s.length; C++)
|
|
12375
12422
|
g(s[C]);
|
|
12376
12423
|
return g;
|
|
12377
12424
|
}({ "./aesprim": [function(e, n, a) {
|
|
@@ -12889,8 +12936,8 @@ var Zr = { exports: {} };
|
|
|
12889
12936
|
};
|
|
12890
12937
|
}
|
|
12891
12938
|
function it() {
|
|
12892
|
-
var p = "", B, N, X, lt, Ct, Gt, Xt = !1,
|
|
12893
|
-
for (
|
|
12939
|
+
var p = "", B, N, X, lt, Ct, Gt, Xt = !1, oe, ae;
|
|
12940
|
+
for (oe = I, ae = v, B = x[L], h(
|
|
12894
12941
|
B === "'" || B === '"',
|
|
12895
12942
|
"String literal must starts with a quote"
|
|
12896
12943
|
), N = L, ++L; L < U; )
|
|
@@ -12939,7 +12986,7 @@ var Zr = { exports: {} };
|
|
|
12939
12986
|
type: g.StringLiteral,
|
|
12940
12987
|
value: p,
|
|
12941
12988
|
octal: Xt,
|
|
12942
|
-
startLineNumber:
|
|
12989
|
+
startLineNumber: oe,
|
|
12943
12990
|
startLineStart: ae,
|
|
12944
12991
|
lineNumber: I,
|
|
12945
12992
|
lineStart: v,
|
|
@@ -13093,7 +13140,7 @@ var Zr = { exports: {} };
|
|
|
13093
13140
|
function Jt(p, B) {
|
|
13094
13141
|
this.line = p, this.column = B;
|
|
13095
13142
|
}
|
|
13096
|
-
function
|
|
13143
|
+
function re(p, B, N, X) {
|
|
13097
13144
|
this.start = new Jt(p, B), this.end = new Jt(N, X);
|
|
13098
13145
|
}
|
|
13099
13146
|
m = {
|
|
@@ -13107,7 +13154,7 @@ var Zr = { exports: {} };
|
|
|
13107
13154
|
}
|
|
13108
13155
|
},
|
|
13109
13156
|
markEnd: function(p, B) {
|
|
13110
|
-
return r.range && (p.range = [B.start, L]), r.loc && (p.loc = new
|
|
13157
|
+
return r.range && (p.range = [B.start, L]), r.loc && (p.loc = new re(
|
|
13111
13158
|
B.startLineNumber === void 0 ? B.lineNumber : B.startLineNumber,
|
|
13112
13159
|
B.start - (B.startLineStart === void 0 ? B.lineStart : B.startLineStart),
|
|
13113
13160
|
I,
|
|
@@ -13476,7 +13523,7 @@ var Zr = { exports: {} };
|
|
|
13476
13523
|
}
|
|
13477
13524
|
function $(p, B) {
|
|
13478
13525
|
var N, X, lt;
|
|
13479
|
-
return N = O, lt = S, X =
|
|
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);
|
|
13480
13527
|
}
|
|
13481
13528
|
function tt() {
|
|
13482
13529
|
var p, B;
|
|
@@ -13515,7 +13562,7 @@ var Zr = { exports: {} };
|
|
|
13515
13562
|
O && S.octal && Dt(S, y.StrictOctalLiteral), N = w.createLiteral(pt());
|
|
13516
13563
|
else if (p === g.Keyword) {
|
|
13517
13564
|
if (Y("function"))
|
|
13518
|
-
return
|
|
13565
|
+
return lo();
|
|
13519
13566
|
Y("this") ? (pt(), N = w.createThisExpression()) : Zt(pt());
|
|
13520
13567
|
} else
|
|
13521
13568
|
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());
|
|
@@ -13626,12 +13673,12 @@ var Zr = { exports: {} };
|
|
|
13626
13673
|
return N;
|
|
13627
13674
|
}
|
|
13628
13675
|
function k() {
|
|
13629
|
-
var p, B, N, X, lt, Ct, Gt, Xt,
|
|
13630
|
-
if (p = S,
|
|
13631
|
-
return
|
|
13632
|
-
for (X.prec = lt, pt(), B = [p, S], Gt = St(), Ct = [
|
|
13676
|
+
var p, B, N, X, lt, Ct, Gt, Xt, oe, ae;
|
|
13677
|
+
if (p = S, oe = St(), X = S, lt = kt(X, F.allowIn), lt === 0)
|
|
13678
|
+
return oe;
|
|
13679
|
+
for (X.prec = lt, pt(), B = [p, S], Gt = St(), Ct = [oe, X, Gt]; (lt = kt(S, F.allowIn)) > 0; ) {
|
|
13633
13680
|
for (; Ct.length > 2 && lt <= Ct[Ct.length - 2].prec; )
|
|
13634
|
-
Gt = Ct.pop(), Xt = Ct.pop().value,
|
|
13681
|
+
Gt = Ct.pop(), Xt = Ct.pop().value, oe = Ct.pop(), N = w.createBinaryExpression(Xt, oe, Gt), B.pop(), p = B[B.length - 1], w.markEnd(N, p), Ct.push(N);
|
|
13635
13682
|
X = pt(), X.prec = lt, Ct.push(X), B.push(S), N = St(), Ct.push(N);
|
|
13636
13683
|
}
|
|
13637
13684
|
for (ae = Ct.length - 1, N = Ct[ae], B.pop(); ae > 1; )
|
|
@@ -13656,7 +13703,7 @@ var Zr = { exports: {} };
|
|
|
13656
13703
|
return p;
|
|
13657
13704
|
}
|
|
13658
13705
|
function Ht() {
|
|
13659
|
-
for (var p = [], B; L < U && !(wt("}") || (B =
|
|
13706
|
+
for (var p = [], B; L < U && !(wt("}") || (B = De(), typeof B > "u")); )
|
|
13660
13707
|
p.push(B);
|
|
13661
13708
|
return p;
|
|
13662
13709
|
}
|
|
@@ -13668,150 +13715,150 @@ var Zr = { exports: {} };
|
|
|
13668
13715
|
var p, B;
|
|
13669
13716
|
return B = S, p = pt(), p.type !== g.Identifier && Zt(p), w.markEnd(w.createIdentifier(p.value), B);
|
|
13670
13717
|
}
|
|
13671
|
-
function
|
|
13718
|
+
function fe(p) {
|
|
13672
13719
|
var B = null, N, X;
|
|
13673
13720
|
return X = S, N = Kt(), O && J(N.name) && Dt({}, y.StrictVarName), p === "const" ? (vt("="), B = dt()) : wt("=") && (pt(), B = dt()), w.markEnd(w.createVariableDeclarator(N, B), X);
|
|
13674
13721
|
}
|
|
13675
|
-
function
|
|
13722
|
+
function Ce(p) {
|
|
13676
13723
|
var B = [];
|
|
13677
13724
|
do {
|
|
13678
|
-
if (B.push(
|
|
13725
|
+
if (B.push(fe(p)), !wt(","))
|
|
13679
13726
|
break;
|
|
13680
13727
|
pt();
|
|
13681
13728
|
} while (L < U);
|
|
13682
13729
|
return B;
|
|
13683
13730
|
}
|
|
13684
|
-
function
|
|
13731
|
+
function qe() {
|
|
13685
13732
|
var p;
|
|
13686
|
-
return Wt("var"), p =
|
|
13733
|
+
return Wt("var"), p = Ce(), _(), w.createVariableDeclaration(p, "var");
|
|
13687
13734
|
}
|
|
13688
|
-
function
|
|
13735
|
+
function gn(p) {
|
|
13689
13736
|
var B, N;
|
|
13690
|
-
return N = S, Wt(p), B =
|
|
13737
|
+
return N = S, Wt(p), B = Ce(p), _(), w.markEnd(w.createVariableDeclaration(B, p), N);
|
|
13691
13738
|
}
|
|
13692
|
-
function
|
|
13739
|
+
function xe() {
|
|
13693
13740
|
return vt(";"), w.createEmptyStatement();
|
|
13694
13741
|
}
|
|
13695
|
-
function
|
|
13742
|
+
function Ae() {
|
|
13696
13743
|
var p = qt();
|
|
13697
13744
|
return _(), w.createExpressionStatement(p);
|
|
13698
13745
|
}
|
|
13699
|
-
function
|
|
13746
|
+
function Je() {
|
|
13700
13747
|
var p, B, N;
|
|
13701
|
-
return Wt("if"), vt("("), p = qt(), vt(")"), B =
|
|
13748
|
+
return Wt("if"), vt("("), p = qt(), vt(")"), B = _e(), Y("else") ? (pt(), N = _e()) : N = null, w.createIfStatement(p, B, N);
|
|
13702
13749
|
}
|
|
13703
|
-
function
|
|
13750
|
+
function Hi() {
|
|
13704
13751
|
var p, B, N;
|
|
13705
|
-
return Wt("do"), N = F.inIteration, F.inIteration = !0, p =
|
|
13752
|
+
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);
|
|
13706
13753
|
}
|
|
13707
|
-
function
|
|
13754
|
+
function Qi() {
|
|
13708
13755
|
var p, B, N;
|
|
13709
|
-
return Wt("while"), vt("("), p = qt(), vt(")"), N = F.inIteration, F.inIteration = !0, B =
|
|
13756
|
+
return Wt("while"), vt("("), p = qt(), vt(")"), N = F.inIteration, F.inIteration = !0, B = _e(), F.inIteration = N, w.createWhileStatement(p, B);
|
|
13710
13757
|
}
|
|
13711
|
-
function
|
|
13758
|
+
function Ji() {
|
|
13712
13759
|
var p, B, N;
|
|
13713
|
-
return N = S, p = pt(), B =
|
|
13760
|
+
return N = S, p = pt(), B = Ce(), w.markEnd(w.createVariableDeclaration(B, p.value), N);
|
|
13714
13761
|
}
|
|
13715
|
-
function
|
|
13762
|
+
function Ki() {
|
|
13716
13763
|
var p, B, N, X, lt, Ct, Gt;
|
|
13717
|
-
return p = B = N = null, Wt("for"), vt("("), wt(";") ? pt() : (Y("var") || Y("let") ? (F.allowIn = !1, p =
|
|
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);
|
|
13718
13765
|
}
|
|
13719
|
-
function
|
|
13766
|
+
function Yi() {
|
|
13720
13767
|
var p = null, B;
|
|
13721
13768
|
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));
|
|
13722
13769
|
}
|
|
13723
|
-
function
|
|
13770
|
+
function to() {
|
|
13724
13771
|
var p = null, B;
|
|
13725
13772
|
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));
|
|
13726
13773
|
}
|
|
13727
|
-
function
|
|
13774
|
+
function eo() {
|
|
13728
13775
|
var p = null;
|
|
13729
13776
|
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));
|
|
13730
13777
|
}
|
|
13731
|
-
function
|
|
13778
|
+
function no() {
|
|
13732
13779
|
var p, B;
|
|
13733
|
-
return O && (G(), Dt({}, y.StrictModeWith)), Wt("with"), vt("("), p = qt(), vt(")"), B =
|
|
13780
|
+
return O && (G(), Dt({}, y.StrictModeWith)), Wt("with"), vt("("), p = qt(), vt(")"), B = _e(), w.createWithStatement(p, B);
|
|
13734
13781
|
}
|
|
13735
|
-
function
|
|
13782
|
+
function ao() {
|
|
13736
13783
|
var p, B = [], N, X;
|
|
13737
13784
|
for (X = S, Y("default") ? (pt(), p = null) : (Wt("case"), p = qt()), vt(":"); L < U && !(wt("}") || Y("default") || Y("case")); )
|
|
13738
|
-
N =
|
|
13785
|
+
N = _e(), B.push(N);
|
|
13739
13786
|
return w.markEnd(w.createSwitchCase(p, B), X);
|
|
13740
13787
|
}
|
|
13741
|
-
function
|
|
13788
|
+
function io() {
|
|
13742
13789
|
var p, B, N, X, lt;
|
|
13743
13790
|
if (Wt("switch"), vt("("), p = qt(), vt(")"), vt("{"), B = [], wt("}"))
|
|
13744
13791
|
return pt(), w.createSwitchStatement(p, B);
|
|
13745
13792
|
for (X = F.inSwitch, F.inSwitch = !0, lt = !1; L < U && !wt("}"); )
|
|
13746
|
-
N =
|
|
13793
|
+
N = ao(), N.test === null && (lt && Pt({}, y.MultipleDefaultsInSwitch), lt = !0), B.push(N);
|
|
13747
13794
|
return F.inSwitch = X, vt("}"), w.createSwitchStatement(p, B);
|
|
13748
13795
|
}
|
|
13749
|
-
function
|
|
13796
|
+
function oo() {
|
|
13750
13797
|
var p;
|
|
13751
13798
|
return Wt("throw"), te() && Pt({}, y.NewlineAfterThrow), p = qt(), _(), w.createThrowStatement(p);
|
|
13752
13799
|
}
|
|
13753
|
-
function
|
|
13800
|
+
function co() {
|
|
13754
13801
|
var p, B, N;
|
|
13755
13802
|
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);
|
|
13756
13803
|
}
|
|
13757
|
-
function
|
|
13804
|
+
function so() {
|
|
13758
13805
|
var p, B = [], N = null;
|
|
13759
|
-
return Wt("try"), p = Qt(), Y("catch") && B.push(
|
|
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);
|
|
13760
13807
|
}
|
|
13761
|
-
function
|
|
13808
|
+
function ro() {
|
|
13762
13809
|
return Wt("debugger"), _(), w.createDebuggerStatement();
|
|
13763
13810
|
}
|
|
13764
|
-
function
|
|
13811
|
+
function _e() {
|
|
13765
13812
|
var p = S.type, B, N, X, lt;
|
|
13766
13813
|
if (p === g.EOF && Zt(S), p === g.Punctuator && S.value === "{")
|
|
13767
13814
|
return Qt();
|
|
13768
13815
|
if (lt = S, p === g.Punctuator)
|
|
13769
13816
|
switch (S.value) {
|
|
13770
13817
|
case ";":
|
|
13771
|
-
return w.markEnd(
|
|
13818
|
+
return w.markEnd(xe(), lt);
|
|
13772
13819
|
case "(":
|
|
13773
|
-
return w.markEnd(
|
|
13820
|
+
return w.markEnd(Ae(), lt);
|
|
13774
13821
|
}
|
|
13775
13822
|
if (p === g.Keyword)
|
|
13776
13823
|
switch (S.value) {
|
|
13777
13824
|
case "break":
|
|
13778
|
-
return w.markEnd(
|
|
13825
|
+
return w.markEnd(to(), lt);
|
|
13779
13826
|
case "continue":
|
|
13780
|
-
return w.markEnd(
|
|
13827
|
+
return w.markEnd(Yi(), lt);
|
|
13781
13828
|
case "debugger":
|
|
13782
|
-
return w.markEnd(
|
|
13829
|
+
return w.markEnd(ro(), lt);
|
|
13783
13830
|
case "do":
|
|
13784
|
-
return w.markEnd(
|
|
13831
|
+
return w.markEnd(Hi(), lt);
|
|
13785
13832
|
case "for":
|
|
13786
|
-
return w.markEnd(
|
|
13833
|
+
return w.markEnd(Ki(), lt);
|
|
13787
13834
|
case "function":
|
|
13788
13835
|
return w.markEnd(aa(), lt);
|
|
13789
13836
|
case "if":
|
|
13790
|
-
return w.markEnd(
|
|
13837
|
+
return w.markEnd(Je(), lt);
|
|
13791
13838
|
case "return":
|
|
13792
|
-
return w.markEnd(
|
|
13839
|
+
return w.markEnd(eo(), lt);
|
|
13793
13840
|
case "switch":
|
|
13794
|
-
return w.markEnd(
|
|
13841
|
+
return w.markEnd(io(), lt);
|
|
13795
13842
|
case "throw":
|
|
13796
|
-
return w.markEnd(ao(), lt);
|
|
13797
|
-
case "try":
|
|
13798
13843
|
return w.markEnd(oo(), lt);
|
|
13844
|
+
case "try":
|
|
13845
|
+
return w.markEnd(so(), lt);
|
|
13799
13846
|
case "var":
|
|
13800
|
-
return w.markEnd(
|
|
13847
|
+
return w.markEnd(qe(), lt);
|
|
13801
13848
|
case "while":
|
|
13802
|
-
return w.markEnd(
|
|
13849
|
+
return w.markEnd(Qi(), lt);
|
|
13803
13850
|
case "with":
|
|
13804
|
-
return w.markEnd(
|
|
13851
|
+
return w.markEnd(no(), lt);
|
|
13805
13852
|
}
|
|
13806
|
-
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 =
|
|
13853
|
+
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));
|
|
13807
13854
|
}
|
|
13808
|
-
function
|
|
13809
|
-
var p, B = [], N, X, lt, Ct, Gt, Xt,
|
|
13810
|
-
for (ae = S, vt("{"); L < U && !(S.type !== g.StringLiteral || (N = S, p =
|
|
13855
|
+
function pn() {
|
|
13856
|
+
var p, B = [], N, X, lt, Ct, Gt, Xt, oe, ae;
|
|
13857
|
+
for (ae = S, vt("{"); L < U && !(S.type !== g.StringLiteral || (N = S, p = De(), B.push(p), p.expression.type !== l.Literal)); )
|
|
13811
13858
|
X = x.slice(N.start + 1, N.end - 1), X === "use strict" ? (O = !0, lt && Dt(lt, y.StrictOctalLiteral)) : !lt && N.octal && (lt = N);
|
|
13812
|
-
for (Ct = F.labelSet, Gt = F.inIteration, Xt = F.inSwitch,
|
|
13859
|
+
for (Ct = F.labelSet, Gt = F.inIteration, Xt = F.inSwitch, oe = F.inFunctionBody, F.labelSet = {}, F.inIteration = !1, F.inSwitch = !1, F.inFunctionBody = !0; L < U && !(wt("}") || (p = De(), typeof p > "u")); )
|
|
13813
13860
|
B.push(p);
|
|
13814
|
-
return vt("}"), F.labelSet = Ct, F.inIteration = Gt, F.inSwitch = Xt, F.inFunctionBody =
|
|
13861
|
+
return vt("}"), F.labelSet = Ct, F.inIteration = Gt, F.inSwitch = Xt, F.inFunctionBody = oe, w.markEnd(w.createBlockStatement(B), ae);
|
|
13815
13862
|
}
|
|
13816
13863
|
function na(p) {
|
|
13817
13864
|
var B, N = [], X, lt, Ct, Gt, Xt;
|
|
@@ -13826,37 +13873,37 @@ var Zr = { exports: {} };
|
|
|
13826
13873
|
};
|
|
13827
13874
|
}
|
|
13828
13875
|
function aa() {
|
|
13829
|
-
var p, B = [], N, X, lt, Ct, Gt, Xt,
|
|
13830
|
-
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),
|
|
13876
|
+
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);
|
|
13831
13878
|
}
|
|
13832
|
-
function
|
|
13833
|
-
var p, B = null, N, X, lt, Ct, Gt = [], Xt,
|
|
13834
|
-
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),
|
|
13879
|
+
function lo() {
|
|
13880
|
+
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);
|
|
13835
13882
|
}
|
|
13836
|
-
function
|
|
13883
|
+
function De() {
|
|
13837
13884
|
if (S.type === g.Keyword)
|
|
13838
13885
|
switch (S.value) {
|
|
13839
13886
|
case "const":
|
|
13840
13887
|
case "let":
|
|
13841
|
-
return
|
|
13888
|
+
return gn(S.value);
|
|
13842
13889
|
case "function":
|
|
13843
13890
|
return aa();
|
|
13844
13891
|
default:
|
|
13845
|
-
return
|
|
13892
|
+
return _e();
|
|
13846
13893
|
}
|
|
13847
13894
|
if (S.type !== g.EOF)
|
|
13848
|
-
return
|
|
13895
|
+
return _e();
|
|
13849
13896
|
}
|
|
13850
|
-
function
|
|
13851
|
-
for (var p, B = [], N, X, lt; L < U && (N = S, !(N.type !== g.StringLiteral || (p =
|
|
13897
|
+
function uo() {
|
|
13898
|
+
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))); )
|
|
13852
13899
|
X = x.slice(N.start + 1, N.end - 1), X === "use strict" ? (O = !0, lt && Dt(lt, y.StrictOctalLiteral)) : !lt && N.octal && (lt = N);
|
|
13853
|
-
for (; L < U && (p =
|
|
13900
|
+
for (; L < U && (p = De(), !(typeof p > "u")); )
|
|
13854
13901
|
B.push(p);
|
|
13855
13902
|
return B;
|
|
13856
13903
|
}
|
|
13857
|
-
function
|
|
13904
|
+
function fo() {
|
|
13858
13905
|
var p, B;
|
|
13859
|
-
return G(), $t(), B = S, O = !1, p =
|
|
13906
|
+
return G(), $t(), B = S, O = !1, p = uo(), w.markEnd(w.createProgram(p), B);
|
|
13860
13907
|
}
|
|
13861
13908
|
function ia() {
|
|
13862
13909
|
var p, B, N, X = [];
|
|
@@ -13867,7 +13914,7 @@ var Zr = { exports: {} };
|
|
|
13867
13914
|
}, r.range && (N.range = B.range), r.loc && (N.loc = B.loc), X.push(N);
|
|
13868
13915
|
r.tokens = X;
|
|
13869
13916
|
}
|
|
13870
|
-
function
|
|
13917
|
+
function _o(p, B) {
|
|
13871
13918
|
var N, X, lt;
|
|
13872
13919
|
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 = {
|
|
13873
13920
|
allowIn: !0,
|
|
@@ -13898,7 +13945,7 @@ var Zr = { exports: {} };
|
|
|
13898
13945
|
}
|
|
13899
13946
|
return lt;
|
|
13900
13947
|
}
|
|
13901
|
-
function
|
|
13948
|
+
function go(p, B) {
|
|
13902
13949
|
var N, X;
|
|
13903
13950
|
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 = {
|
|
13904
13951
|
allowIn: !0,
|
|
@@ -13909,7 +13956,7 @@ var Zr = { exports: {} };
|
|
|
13909
13956
|
lastCommentStart: -1
|
|
13910
13957
|
}, 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 = []));
|
|
13911
13958
|
try {
|
|
13912
|
-
N =
|
|
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);
|
|
13913
13960
|
} catch (lt) {
|
|
13914
13961
|
throw lt;
|
|
13915
13962
|
} finally {
|
|
@@ -13917,7 +13964,7 @@ var Zr = { exports: {} };
|
|
|
13917
13964
|
}
|
|
13918
13965
|
return N;
|
|
13919
13966
|
}
|
|
13920
|
-
s.version = "1.2.2", s.tokenize =
|
|
13967
|
+
s.version = "1.2.2", s.tokenize = _o, s.parse = go, s.Syntax = function() {
|
|
13921
13968
|
var p, B = {};
|
|
13922
13969
|
typeof Object.create == "function" && (B = /* @__PURE__ */ Object.create(null));
|
|
13923
13970
|
for (p in l)
|
|
@@ -15197,7 +15244,7 @@ Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[T] || T) + "'" : at =
|
|
|
15197
15244
|
function zt(G, K) {
|
|
15198
15245
|
return Object.prototype.hasOwnProperty.call(G, K);
|
|
15199
15246
|
}
|
|
15200
|
-
}).call(this, e("_process"), typeof
|
|
15247
|
+
}).call(this, e("_process"), typeof en < "u" ? en : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
15201
15248
|
}, { "./support/isBuffer": 10, _process: 14, inherits: 9 }], 12: [function(e, n, a) {
|
|
15202
15249
|
}, {}], 13: [function(e, n, a) {
|
|
15203
15250
|
(function(s) {
|
|
@@ -15513,12 +15560,13 @@ Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[T] || T) + "'" : at =
|
|
|
15513
15560
|
n.exports = e("./lib/index");
|
|
15514
15561
|
}, { "./lib/index": 5 }] }, {}, ["jsonpath"])("jsonpath");
|
|
15515
15562
|
});
|
|
15516
|
-
})(
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15563
|
+
})(tl);
|
|
15564
|
+
$a();
|
|
15565
|
+
ja.EventEmitter;
|
|
15566
|
+
const el = ta, Xi = Zi, nl = zn;
|
|
15567
|
+
nl.inherits(Nn, Xi);
|
|
15520
15568
|
function Nn(c, t) {
|
|
15521
|
-
return
|
|
15569
|
+
return el.not.instanceStrict(this, Nn) ? new Nn(c, t) : Xi.call(this, c, { ...t, encoding: "utf8" });
|
|
15522
15570
|
}
|
|
15523
15571
|
var ea = { exports: {} };
|
|
15524
15572
|
ea.exports;
|
|
@@ -15597,13 +15645,13 @@ ea.exports;
|
|
|
15597
15645
|
function L(I, v) {
|
|
15598
15646
|
setTimeout(I, Math.abs(v));
|
|
15599
15647
|
}
|
|
15600
|
-
})(
|
|
15648
|
+
})(en);
|
|
15601
15649
|
})(ea);
|
|
15602
15650
|
ea.exports;
|
|
15603
|
-
const
|
|
15651
|
+
const al = typeof Se < "u" && Se.versions != null && Se.versions.node != null, vn = (
|
|
15604
15652
|
// @ts-expect-error webpack check is done like this
|
|
15605
15653
|
typeof __webpack_require__ < "u"
|
|
15606
|
-
),
|
|
15654
|
+
), Vi = new yo(), il = async (c) => {
|
|
15607
15655
|
const { input: t, wasmFilePath: e, zKeyFilePath: n, chainId: a } = c.payload.data, {
|
|
15608
15656
|
hostLocation: { origin: s },
|
|
15609
15657
|
constants: {
|
|
@@ -15612,21 +15660,21 @@ const Vr = typeof process < "u" && process.versions != null && process.versions.
|
|
|
15612
15660
|
}
|
|
15613
15661
|
} = c.metadata;
|
|
15614
15662
|
let C = e, l = n;
|
|
15615
|
-
if (console.log({ isWebpack:
|
|
15616
|
-
g && !
|
|
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}`);
|
|
15617
15665
|
const o = require("path");
|
|
15618
15666
|
C = o.resolve(C), l = o.resolve(l);
|
|
15619
15667
|
} else
|
|
15620
15668
|
a === d.localhost && (C = `${s}/${e}`, l = `${s}/${n}`);
|
|
15621
15669
|
try {
|
|
15622
|
-
const { proof: o, publicSignals: y } = await
|
|
15623
|
-
|
|
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 });
|
|
15624
15672
|
} catch (o) {
|
|
15625
15673
|
console.log(o);
|
|
15626
15674
|
}
|
|
15627
15675
|
};
|
|
15628
|
-
|
|
15676
|
+
Vi.attachWorkerSideOnMessage(il);
|
|
15629
15677
|
export {
|
|
15630
|
-
|
|
15631
|
-
|
|
15678
|
+
Vi as default,
|
|
15679
|
+
il as onWorkerMessage
|
|
15632
15680
|
};
|