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