@btc-vision/walletconnect 1.9.12 → 1.9.13
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/browser/context/WalletConnectContext.d.ts +5 -4
- package/browser/context/WalletConnectContext.d.ts.map +1 -0
- package/browser/hooks/WalletConnectHook.d.ts +2 -1
- package/browser/hooks/WalletConnectHook.d.ts.map +1 -0
- package/browser/index.d.ts +1 -0
- package/browser/index.d.ts.map +1 -0
- package/browser/index.js +799 -2
- package/browser/noble-curves.js +3353 -0
- package/browser/noble-hashes.js +3097 -0
- package/browser/provider/WalletConnectProvider.d.ts +2 -3
- package/browser/provider/WalletConnectProvider.d.ts.map +1 -0
- package/browser/types.d.ts +4 -3
- package/browser/types.d.ts.map +1 -0
- package/browser/utils/accessibility/definitions.d.ts +1 -0
- package/browser/utils/accessibility/definitions.d.ts.map +1 -0
- package/browser/utils/accessibility/errorDecoder.d.ts +1 -0
- package/browser/utils/accessibility/errorDecoder.d.ts.map +1 -0
- package/browser/utils/accessibility/patterns.d.ts +1 -0
- package/browser/utils/accessibility/patterns.d.ts.map +1 -0
- package/browser/valibot.js +5261 -0
- package/browser/vendors.js +63226 -0
- package/browser/walletconnect.css +1 -0
- package/browser/wallets/controller.d.ts +5 -4
- package/browser/wallets/controller.d.ts.map +1 -0
- package/browser/wallets/index.d.ts +3 -3
- package/browser/wallets/index.d.ts.map +1 -0
- package/browser/wallets/opwallet/controller.d.ts +3 -2
- package/browser/wallets/opwallet/controller.d.ts.map +1 -0
- package/browser/wallets/opwallet/interface.d.ts +2 -1
- package/browser/wallets/opwallet/interface.d.ts.map +1 -0
- package/browser/wallets/supported-wallets.d.ts +5 -1
- package/browser/wallets/supported-wallets.d.ts.map +1 -0
- package/browser/wallets/types.d.ts +3 -2
- package/browser/wallets/types.d.ts.map +1 -0
- package/browser/wallets/unisat/controller.d.ts +3 -2
- package/browser/wallets/unisat/controller.d.ts.map +1 -0
- package/browser/wallets/unisat/interface.d.ts +2 -1
- package/browser/wallets/unisat/interface.d.ts.map +1 -0
- package/build/context/WalletConnectContext.d.ts +2 -1
- package/build/context/WalletConnectContext.d.ts.map +1 -0
- package/build/context/WalletConnectContext.js +0 -3
- package/build/hooks/WalletConnectHook.d.ts +1 -0
- package/build/hooks/WalletConnectHook.d.ts.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/provider/WalletConnectProvider.d.ts +1 -0
- package/build/provider/WalletConnectProvider.d.ts.map +1 -0
- package/build/provider/WalletConnectProvider.js +2 -3
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types.d.ts +2 -1
- package/build/types.d.ts.map +1 -0
- package/build/types.js +1 -2
- package/build/utils/accessibility/definitions.d.ts +1 -0
- package/build/utils/accessibility/definitions.d.ts.map +1 -0
- package/build/utils/accessibility/errorDecoder.d.ts +1 -0
- package/build/utils/accessibility/errorDecoder.d.ts.map +1 -0
- package/build/utils/accessibility/patterns.d.ts +1 -0
- package/build/utils/accessibility/patterns.d.ts.map +1 -0
- package/build/wallets/controller.d.ts +2 -1
- package/build/wallets/controller.d.ts.map +1 -0
- package/build/wallets/controller.js +10 -15
- package/build/wallets/index.d.ts +3 -3
- package/build/wallets/index.d.ts.map +1 -0
- package/build/wallets/index.js +4 -3
- package/build/wallets/opwallet/controller.d.ts +1 -0
- package/build/wallets/opwallet/controller.d.ts.map +1 -0
- package/build/wallets/opwallet/controller.js +6 -6
- package/build/wallets/opwallet/interface.d.ts +1 -0
- package/build/wallets/opwallet/interface.d.ts.map +1 -0
- package/build/wallets/opwallet/interface.js +0 -1
- package/build/wallets/supported-wallets.d.ts +5 -1
- package/build/wallets/supported-wallets.d.ts.map +1 -0
- package/build/wallets/supported-wallets.js +5 -1
- package/build/wallets/types.d.ts +2 -1
- package/build/wallets/types.d.ts.map +1 -0
- package/build/wallets/types.js +1 -4
- package/build/wallets/unisat/controller.d.ts +1 -0
- package/build/wallets/unisat/controller.d.ts.map +1 -0
- package/build/wallets/unisat/controller.js +6 -6
- package/build/wallets/unisat/interface.d.ts +1 -0
- package/build/wallets/unisat/interface.d.ts.map +1 -0
- package/build/wallets/unisat/interface.js +0 -1
- package/package.json +33 -32
- package/src/README.md +9 -3
- package/src/context/WalletConnectContext.ts +1 -1
- package/src/hooks/WalletConnectHook.tsx +1 -4
- package/src/provider/WalletConnectProvider.tsx +1 -1
- package/src/types.ts +1 -1
- package/src/utils/style.css +9 -0
- package/src/wallets/controller.ts +2 -7
- package/src/wallets/index.ts +4 -5
- package/src/wallets/supported-wallets.ts +4 -1
- package/src/wallets/types.ts +3 -7
- package/tsconfig.base.json +1 -3
- package/tsconfig.json +4 -3
- package/vite.config.browser.ts +92 -0
- package/.babelrc +0 -4
- package/browser/168.index.js +0 -1
- package/browser/index.js.LICENSE.txt +0 -20
- package/build/utils/style.css +0 -135
- package/build/utils/theme.css +0 -26
- package/gulpfile.js +0 -145
- package/tsconfig.webpack.json +0 -18
- package/webpack.config.js +0 -87
|
@@ -0,0 +1,3097 @@
|
|
|
1
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
+
function b0(t) {
|
|
3
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
4
|
+
}
|
|
5
|
+
function ie(t, ...e) {
|
|
6
|
+
if (!b0(t))
|
|
7
|
+
throw new Error("Uint8Array expected");
|
|
8
|
+
if (e.length > 0 && !e.includes(t.length))
|
|
9
|
+
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
10
|
+
}
|
|
11
|
+
function le(t, e = !0) {
|
|
12
|
+
if (t.destroyed)
|
|
13
|
+
throw new Error("Hash instance has been destroyed");
|
|
14
|
+
if (e && t.finished)
|
|
15
|
+
throw new Error("Hash#digest() has already been called");
|
|
16
|
+
}
|
|
17
|
+
function x0(t, e) {
|
|
18
|
+
ie(t);
|
|
19
|
+
const s = e.outputLen;
|
|
20
|
+
if (t.length < s)
|
|
21
|
+
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
22
|
+
}
|
|
23
|
+
function ne(...t) {
|
|
24
|
+
for (let e = 0; e < t.length; e++)
|
|
25
|
+
t[e].fill(0);
|
|
26
|
+
}
|
|
27
|
+
function Jt(t) {
|
|
28
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
29
|
+
}
|
|
30
|
+
function z(t, e) {
|
|
31
|
+
return t << 32 - e | t >>> e;
|
|
32
|
+
}
|
|
33
|
+
function H0(t) {
|
|
34
|
+
if (typeof t != "string")
|
|
35
|
+
throw new Error("string expected");
|
|
36
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
37
|
+
}
|
|
38
|
+
function We(t) {
|
|
39
|
+
return typeof t == "string" && (t = H0(t)), ie(t), t;
|
|
40
|
+
}
|
|
41
|
+
let p0 = class {
|
|
42
|
+
};
|
|
43
|
+
function A0(t) {
|
|
44
|
+
const e = (r) => t().update(We(r)).digest(), s = t();
|
|
45
|
+
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
46
|
+
}
|
|
47
|
+
function y0(t, e, s, r) {
|
|
48
|
+
if (typeof t.setBigUint64 == "function")
|
|
49
|
+
return t.setBigUint64(e, s, r);
|
|
50
|
+
const c = BigInt(32), n = BigInt(4294967295), i = Number(s >> c & n), h = Number(s & n), f = r ? 4 : 0, u = r ? 0 : 4;
|
|
51
|
+
t.setUint32(e + f, i, r), t.setUint32(e + u, h, r);
|
|
52
|
+
}
|
|
53
|
+
function g0(t, e, s) {
|
|
54
|
+
return t & e ^ ~t & s;
|
|
55
|
+
}
|
|
56
|
+
function _0(t, e, s) {
|
|
57
|
+
return t & e ^ t & s ^ e & s;
|
|
58
|
+
}
|
|
59
|
+
let w0 = class extends p0 {
|
|
60
|
+
constructor(e, s, r, c) {
|
|
61
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = r, this.isLE = c, this.buffer = new Uint8Array(e), this.view = Jt(this.buffer);
|
|
62
|
+
}
|
|
63
|
+
update(e) {
|
|
64
|
+
le(this), e = We(e), ie(e);
|
|
65
|
+
const { view: s, buffer: r, blockLen: c } = this, n = e.length;
|
|
66
|
+
for (let i = 0; i < n; ) {
|
|
67
|
+
const h = Math.min(c - this.pos, n - i);
|
|
68
|
+
if (h === c) {
|
|
69
|
+
const f = Jt(e);
|
|
70
|
+
for (; c <= n - i; i += c)
|
|
71
|
+
this.process(f, i);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
r.set(e.subarray(i, i + h), this.pos), this.pos += h, i += h, this.pos === c && (this.process(s, 0), this.pos = 0);
|
|
75
|
+
}
|
|
76
|
+
return this.length += e.length, this.roundClean(), this;
|
|
77
|
+
}
|
|
78
|
+
digestInto(e) {
|
|
79
|
+
le(this), x0(e, this), this.finished = !0;
|
|
80
|
+
const { buffer: s, view: r, blockLen: c, isLE: n } = this;
|
|
81
|
+
let { pos: i } = this;
|
|
82
|
+
s[i++] = 128, ne(this.buffer.subarray(i)), this.padOffset > c - i && (this.process(r, 0), i = 0);
|
|
83
|
+
for (let a = i; a < c; a++)
|
|
84
|
+
s[a] = 0;
|
|
85
|
+
y0(r, c - 8, BigInt(this.length * 8), n), this.process(r, 0);
|
|
86
|
+
const h = Jt(e), f = this.outputLen;
|
|
87
|
+
if (f % 4)
|
|
88
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
89
|
+
const u = f / 4, l = this.get();
|
|
90
|
+
if (u > l.length)
|
|
91
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
92
|
+
for (let a = 0; a < u; a++)
|
|
93
|
+
h.setUint32(4 * a, l[a], n);
|
|
94
|
+
}
|
|
95
|
+
digest() {
|
|
96
|
+
const { buffer: e, outputLen: s } = this;
|
|
97
|
+
this.digestInto(e);
|
|
98
|
+
const r = e.slice(0, s);
|
|
99
|
+
return this.destroy(), r;
|
|
100
|
+
}
|
|
101
|
+
_cloneInto(e) {
|
|
102
|
+
e || (e = new this.constructor()), e.set(...this.get());
|
|
103
|
+
const { blockLen: s, buffer: r, length: c, finished: n, destroyed: i, pos: h } = this;
|
|
104
|
+
return e.destroyed = i, e.finished = n, e.length = c, e.pos = h, c % s && e.buffer.set(r), e;
|
|
105
|
+
}
|
|
106
|
+
clone() {
|
|
107
|
+
return this._cloneInto();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const ht = /* @__PURE__ */ Uint32Array.from([
|
|
111
|
+
1779033703,
|
|
112
|
+
3144134277,
|
|
113
|
+
1013904242,
|
|
114
|
+
2773480762,
|
|
115
|
+
1359893119,
|
|
116
|
+
2600822924,
|
|
117
|
+
528734635,
|
|
118
|
+
1541459225
|
|
119
|
+
]), S0 = /* @__PURE__ */ Uint32Array.from([
|
|
120
|
+
1116352408,
|
|
121
|
+
1899447441,
|
|
122
|
+
3049323471,
|
|
123
|
+
3921009573,
|
|
124
|
+
961987163,
|
|
125
|
+
1508970993,
|
|
126
|
+
2453635748,
|
|
127
|
+
2870763221,
|
|
128
|
+
3624381080,
|
|
129
|
+
310598401,
|
|
130
|
+
607225278,
|
|
131
|
+
1426881987,
|
|
132
|
+
1925078388,
|
|
133
|
+
2162078206,
|
|
134
|
+
2614888103,
|
|
135
|
+
3248222580,
|
|
136
|
+
3835390401,
|
|
137
|
+
4022224774,
|
|
138
|
+
264347078,
|
|
139
|
+
604807628,
|
|
140
|
+
770255983,
|
|
141
|
+
1249150122,
|
|
142
|
+
1555081692,
|
|
143
|
+
1996064986,
|
|
144
|
+
2554220882,
|
|
145
|
+
2821834349,
|
|
146
|
+
2952996808,
|
|
147
|
+
3210313671,
|
|
148
|
+
3336571891,
|
|
149
|
+
3584528711,
|
|
150
|
+
113926993,
|
|
151
|
+
338241895,
|
|
152
|
+
666307205,
|
|
153
|
+
773529912,
|
|
154
|
+
1294757372,
|
|
155
|
+
1396182291,
|
|
156
|
+
1695183700,
|
|
157
|
+
1986661051,
|
|
158
|
+
2177026350,
|
|
159
|
+
2456956037,
|
|
160
|
+
2730485921,
|
|
161
|
+
2820302411,
|
|
162
|
+
3259730800,
|
|
163
|
+
3345764771,
|
|
164
|
+
3516065817,
|
|
165
|
+
3600352804,
|
|
166
|
+
4094571909,
|
|
167
|
+
275423344,
|
|
168
|
+
430227734,
|
|
169
|
+
506948616,
|
|
170
|
+
659060556,
|
|
171
|
+
883997877,
|
|
172
|
+
958139571,
|
|
173
|
+
1322822218,
|
|
174
|
+
1537002063,
|
|
175
|
+
1747873779,
|
|
176
|
+
1955562222,
|
|
177
|
+
2024104815,
|
|
178
|
+
2227730452,
|
|
179
|
+
2361852424,
|
|
180
|
+
2428436474,
|
|
181
|
+
2756734187,
|
|
182
|
+
3204031479,
|
|
183
|
+
3329325298
|
|
184
|
+
]), at = /* @__PURE__ */ new Uint32Array(64);
|
|
185
|
+
let L0 = class extends w0 {
|
|
186
|
+
constructor(e = 32) {
|
|
187
|
+
super(64, e, 8, !1), this.A = ht[0] | 0, this.B = ht[1] | 0, this.C = ht[2] | 0, this.D = ht[3] | 0, this.E = ht[4] | 0, this.F = ht[5] | 0, this.G = ht[6] | 0, this.H = ht[7] | 0;
|
|
188
|
+
}
|
|
189
|
+
get() {
|
|
190
|
+
const { A: e, B: s, C: r, D: c, E: n, F: i, G: h, H: f } = this;
|
|
191
|
+
return [e, s, r, c, n, i, h, f];
|
|
192
|
+
}
|
|
193
|
+
// prettier-ignore
|
|
194
|
+
set(e, s, r, c, n, i, h, f) {
|
|
195
|
+
this.A = e | 0, this.B = s | 0, this.C = r | 0, this.D = c | 0, this.E = n | 0, this.F = i | 0, this.G = h | 0, this.H = f | 0;
|
|
196
|
+
}
|
|
197
|
+
process(e, s) {
|
|
198
|
+
for (let a = 0; a < 16; a++, s += 4)
|
|
199
|
+
at[a] = e.getUint32(s, !1);
|
|
200
|
+
for (let a = 16; a < 64; a++) {
|
|
201
|
+
const y = at[a - 15], p = at[a - 2], S = z(y, 7) ^ z(y, 18) ^ y >>> 3, L = z(p, 17) ^ z(p, 19) ^ p >>> 10;
|
|
202
|
+
at[a] = L + at[a - 7] + S + at[a - 16] | 0;
|
|
203
|
+
}
|
|
204
|
+
let { A: r, B: c, C: n, D: i, E: h, F: f, G: u, H: l } = this;
|
|
205
|
+
for (let a = 0; a < 64; a++) {
|
|
206
|
+
const y = z(h, 6) ^ z(h, 11) ^ z(h, 25), p = l + y + g0(h, f, u) + S0[a] + at[a] | 0, L = (z(r, 2) ^ z(r, 13) ^ z(r, 22)) + _0(r, c, n) | 0;
|
|
207
|
+
l = u, u = f, f = h, h = i + p | 0, i = n, n = c, c = r, r = p + L | 0;
|
|
208
|
+
}
|
|
209
|
+
r = r + this.A | 0, c = c + this.B | 0, n = n + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, f = f + this.F | 0, u = u + this.G | 0, l = l + this.H | 0, this.set(r, c, n, i, h, f, u, l);
|
|
210
|
+
}
|
|
211
|
+
roundClean() {
|
|
212
|
+
ne(at);
|
|
213
|
+
}
|
|
214
|
+
destroy() {
|
|
215
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), ne(this.buffer);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const I0 = /* @__PURE__ */ A0(() => new L0()), sn = I0;
|
|
219
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
220
|
+
function B0(t) {
|
|
221
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
222
|
+
}
|
|
223
|
+
function be(t, e = "") {
|
|
224
|
+
if (!Number.isSafeInteger(t) || t < 0) {
|
|
225
|
+
const s = e && `"${e}" `;
|
|
226
|
+
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function Dt(t, e, s = "") {
|
|
230
|
+
const r = B0(t), c = t?.length, n = e !== void 0;
|
|
231
|
+
if (!r || n && c !== e) {
|
|
232
|
+
const i = s && `"${s}" `, h = n ? ` of length ${e}` : "", f = r ? `length=${c}` : `type=${typeof t}`;
|
|
233
|
+
throw new Error(i + "expected Uint8Array" + h + ", got " + f);
|
|
234
|
+
}
|
|
235
|
+
return t;
|
|
236
|
+
}
|
|
237
|
+
function Rt(t, e = !0) {
|
|
238
|
+
if (t.destroyed)
|
|
239
|
+
throw new Error("Hash instance has been destroyed");
|
|
240
|
+
if (e && t.finished)
|
|
241
|
+
throw new Error("Hash#digest() has already been called");
|
|
242
|
+
}
|
|
243
|
+
function Pe(t, e) {
|
|
244
|
+
Dt(t, void 0, "digestInto() output");
|
|
245
|
+
const s = e.outputLen;
|
|
246
|
+
if (t.length < s)
|
|
247
|
+
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
248
|
+
}
|
|
249
|
+
function m0(t) {
|
|
250
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
251
|
+
}
|
|
252
|
+
function ot(...t) {
|
|
253
|
+
for (let e = 0; e < t.length; e++)
|
|
254
|
+
t[e].fill(0);
|
|
255
|
+
}
|
|
256
|
+
function Qt(t) {
|
|
257
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
258
|
+
}
|
|
259
|
+
function tt(t, e) {
|
|
260
|
+
return t << 32 - e | t >>> e;
|
|
261
|
+
}
|
|
262
|
+
function wt(t, e) {
|
|
263
|
+
return t << e | t >>> 32 - e >>> 0;
|
|
264
|
+
}
|
|
265
|
+
const U0 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
266
|
+
function E0(t) {
|
|
267
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
268
|
+
}
|
|
269
|
+
function V0(t) {
|
|
270
|
+
for (let e = 0; e < t.length; e++)
|
|
271
|
+
t[e] = E0(t[e]);
|
|
272
|
+
return t;
|
|
273
|
+
}
|
|
274
|
+
const xe = U0 ? (t) => t : V0;
|
|
275
|
+
function nn(...t) {
|
|
276
|
+
let e = 0;
|
|
277
|
+
for (let r = 0; r < t.length; r++) {
|
|
278
|
+
const c = t[r];
|
|
279
|
+
Dt(c), e += c.length;
|
|
280
|
+
}
|
|
281
|
+
const s = new Uint8Array(e);
|
|
282
|
+
for (let r = 0, c = 0; r < t.length; r++) {
|
|
283
|
+
const n = t[r];
|
|
284
|
+
s.set(n, c), c += n.length;
|
|
285
|
+
}
|
|
286
|
+
return s;
|
|
287
|
+
}
|
|
288
|
+
function qt(t, e = {}) {
|
|
289
|
+
const s = (c, n) => t(n).update(c).digest(), r = t(void 0);
|
|
290
|
+
return s.outputLen = r.outputLen, s.blockLen = r.blockLen, s.create = (c) => t(c), Object.assign(s, e), Object.freeze(s);
|
|
291
|
+
}
|
|
292
|
+
function rn(t = 32) {
|
|
293
|
+
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
294
|
+
if (typeof e?.getRandomValues != "function")
|
|
295
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
296
|
+
return e.getRandomValues(new Uint8Array(t));
|
|
297
|
+
}
|
|
298
|
+
const re = (t) => ({
|
|
299
|
+
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
300
|
+
});
|
|
301
|
+
function Ne(t, e, s) {
|
|
302
|
+
return t & e ^ ~t & s;
|
|
303
|
+
}
|
|
304
|
+
function qe(t, e, s) {
|
|
305
|
+
return t & e ^ t & s ^ e & s;
|
|
306
|
+
}
|
|
307
|
+
let ce = class {
|
|
308
|
+
blockLen;
|
|
309
|
+
outputLen;
|
|
310
|
+
padOffset;
|
|
311
|
+
isLE;
|
|
312
|
+
// For partial updates less than block size
|
|
313
|
+
buffer;
|
|
314
|
+
view;
|
|
315
|
+
finished = !1;
|
|
316
|
+
length = 0;
|
|
317
|
+
pos = 0;
|
|
318
|
+
destroyed = !1;
|
|
319
|
+
constructor(e, s, r, c) {
|
|
320
|
+
this.blockLen = e, this.outputLen = s, this.padOffset = r, this.isLE = c, this.buffer = new Uint8Array(e), this.view = Qt(this.buffer);
|
|
321
|
+
}
|
|
322
|
+
update(e) {
|
|
323
|
+
Rt(this), Dt(e);
|
|
324
|
+
const { view: s, buffer: r, blockLen: c } = this, n = e.length;
|
|
325
|
+
for (let i = 0; i < n; ) {
|
|
326
|
+
const h = Math.min(c - this.pos, n - i);
|
|
327
|
+
if (h === c) {
|
|
328
|
+
const f = Qt(e);
|
|
329
|
+
for (; c <= n - i; i += c)
|
|
330
|
+
this.process(f, i);
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
r.set(e.subarray(i, i + h), this.pos), this.pos += h, i += h, this.pos === c && (this.process(s, 0), this.pos = 0);
|
|
334
|
+
}
|
|
335
|
+
return this.length += e.length, this.roundClean(), this;
|
|
336
|
+
}
|
|
337
|
+
digestInto(e) {
|
|
338
|
+
Rt(this), Pe(e, this), this.finished = !0;
|
|
339
|
+
const { buffer: s, view: r, blockLen: c, isLE: n } = this;
|
|
340
|
+
let { pos: i } = this;
|
|
341
|
+
s[i++] = 128, ot(this.buffer.subarray(i)), this.padOffset > c - i && (this.process(r, 0), i = 0);
|
|
342
|
+
for (let a = i; a < c; a++)
|
|
343
|
+
s[a] = 0;
|
|
344
|
+
r.setBigUint64(c - 8, BigInt(this.length * 8), n), this.process(r, 0);
|
|
345
|
+
const h = Qt(e), f = this.outputLen;
|
|
346
|
+
if (f % 4)
|
|
347
|
+
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
348
|
+
const u = f / 4, l = this.get();
|
|
349
|
+
if (u > l.length)
|
|
350
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
351
|
+
for (let a = 0; a < u; a++)
|
|
352
|
+
h.setUint32(4 * a, l[a], n);
|
|
353
|
+
}
|
|
354
|
+
digest() {
|
|
355
|
+
const { buffer: e, outputLen: s } = this;
|
|
356
|
+
this.digestInto(e);
|
|
357
|
+
const r = e.slice(0, s);
|
|
358
|
+
return this.destroy(), r;
|
|
359
|
+
}
|
|
360
|
+
_cloneInto(e) {
|
|
361
|
+
e ||= new this.constructor(), e.set(...this.get());
|
|
362
|
+
const { blockLen: s, buffer: r, length: c, finished: n, destroyed: i, pos: h } = this;
|
|
363
|
+
return e.destroyed = i, e.finished = n, e.length = c, e.pos = h, c % s && e.buffer.set(r), e;
|
|
364
|
+
}
|
|
365
|
+
clone() {
|
|
366
|
+
return this._cloneInto();
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
const ft = /* @__PURE__ */ Uint32Array.from([
|
|
370
|
+
1779033703,
|
|
371
|
+
3144134277,
|
|
372
|
+
1013904242,
|
|
373
|
+
2773480762,
|
|
374
|
+
1359893119,
|
|
375
|
+
2600822924,
|
|
376
|
+
528734635,
|
|
377
|
+
1541459225
|
|
378
|
+
]), Ut = /* @__PURE__ */ Uint32Array.from([
|
|
379
|
+
1732584193,
|
|
380
|
+
4023233417,
|
|
381
|
+
2562383102,
|
|
382
|
+
271733878,
|
|
383
|
+
3285377520
|
|
384
|
+
]), dt = /* @__PURE__ */ new Uint32Array(80);
|
|
385
|
+
class k0 extends ce {
|
|
386
|
+
A = Ut[0] | 0;
|
|
387
|
+
B = Ut[1] | 0;
|
|
388
|
+
C = Ut[2] | 0;
|
|
389
|
+
D = Ut[3] | 0;
|
|
390
|
+
E = Ut[4] | 0;
|
|
391
|
+
constructor() {
|
|
392
|
+
super(64, 20, 8, !1);
|
|
393
|
+
}
|
|
394
|
+
get() {
|
|
395
|
+
const { A: e, B: s, C: r, D: c, E: n } = this;
|
|
396
|
+
return [e, s, r, c, n];
|
|
397
|
+
}
|
|
398
|
+
set(e, s, r, c, n) {
|
|
399
|
+
this.A = e | 0, this.B = s | 0, this.C = r | 0, this.D = c | 0, this.E = n | 0;
|
|
400
|
+
}
|
|
401
|
+
process(e, s) {
|
|
402
|
+
for (let f = 0; f < 16; f++, s += 4)
|
|
403
|
+
dt[f] = e.getUint32(s, !1);
|
|
404
|
+
for (let f = 16; f < 80; f++)
|
|
405
|
+
dt[f] = wt(dt[f - 3] ^ dt[f - 8] ^ dt[f - 14] ^ dt[f - 16], 1);
|
|
406
|
+
let { A: r, B: c, C: n, D: i, E: h } = this;
|
|
407
|
+
for (let f = 0; f < 80; f++) {
|
|
408
|
+
let u, l;
|
|
409
|
+
f < 20 ? (u = Ne(c, n, i), l = 1518500249) : f < 40 ? (u = c ^ n ^ i, l = 1859775393) : f < 60 ? (u = qe(c, n, i), l = 2400959708) : (u = c ^ n ^ i, l = 3395469782);
|
|
410
|
+
const a = wt(r, 5) + u + h + l + dt[f] | 0;
|
|
411
|
+
h = i, i = n, n = wt(c, 30), c = r, r = a;
|
|
412
|
+
}
|
|
413
|
+
r = r + this.A | 0, c = c + this.B | 0, n = n + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, this.set(r, c, n, i, h);
|
|
414
|
+
}
|
|
415
|
+
roundClean() {
|
|
416
|
+
ot(dt);
|
|
417
|
+
}
|
|
418
|
+
destroy() {
|
|
419
|
+
this.set(0, 0, 0, 0, 0), ot(this.buffer);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
const on = /* @__PURE__ */ qt(() => new k0()), C0 = /* @__PURE__ */ Uint8Array.from([
|
|
423
|
+
7,
|
|
424
|
+
4,
|
|
425
|
+
13,
|
|
426
|
+
1,
|
|
427
|
+
10,
|
|
428
|
+
6,
|
|
429
|
+
15,
|
|
430
|
+
3,
|
|
431
|
+
12,
|
|
432
|
+
0,
|
|
433
|
+
9,
|
|
434
|
+
5,
|
|
435
|
+
2,
|
|
436
|
+
14,
|
|
437
|
+
11,
|
|
438
|
+
8
|
|
439
|
+
]), Ke = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), D0 = Ke.map((t) => (9 * t + 5) % 16), Xe = /* @__PURE__ */ (() => {
|
|
440
|
+
const s = [[Ke], [D0]];
|
|
441
|
+
for (let r = 0; r < 4; r++)
|
|
442
|
+
for (let c of s)
|
|
443
|
+
c.push(c[r].map((n) => C0[n]));
|
|
444
|
+
return s;
|
|
445
|
+
})(), $e = Xe[0], Je = Xe[1], Qe = /* @__PURE__ */ [
|
|
446
|
+
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
447
|
+
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
448
|
+
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
449
|
+
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
450
|
+
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
451
|
+
].map((t) => Uint8Array.from(t)), F0 = /* @__PURE__ */ $e.map((t, e) => t.map((s) => Qe[e][s])), T0 = /* @__PURE__ */ Je.map((t, e) => t.map((s) => Qe[e][s])), O0 = /* @__PURE__ */ Uint32Array.from([
|
|
452
|
+
0,
|
|
453
|
+
1518500249,
|
|
454
|
+
1859775393,
|
|
455
|
+
2400959708,
|
|
456
|
+
2840853838
|
|
457
|
+
]), M0 = /* @__PURE__ */ Uint32Array.from([
|
|
458
|
+
1352829926,
|
|
459
|
+
1548603684,
|
|
460
|
+
1836072691,
|
|
461
|
+
2053994217,
|
|
462
|
+
0
|
|
463
|
+
]);
|
|
464
|
+
function He(t, e, s, r) {
|
|
465
|
+
return t === 0 ? e ^ s ^ r : t === 1 ? e & s | ~e & r : t === 2 ? (e | ~s) ^ r : t === 3 ? e & r | s & ~r : e ^ (s | ~r);
|
|
466
|
+
}
|
|
467
|
+
const Ft = /* @__PURE__ */ new Uint32Array(16);
|
|
468
|
+
class G0 extends ce {
|
|
469
|
+
h0 = 1732584193;
|
|
470
|
+
h1 = -271733879;
|
|
471
|
+
h2 = -1732584194;
|
|
472
|
+
h3 = 271733878;
|
|
473
|
+
h4 = -1009589776;
|
|
474
|
+
constructor() {
|
|
475
|
+
super(64, 20, 8, !0);
|
|
476
|
+
}
|
|
477
|
+
get() {
|
|
478
|
+
const { h0: e, h1: s, h2: r, h3: c, h4: n } = this;
|
|
479
|
+
return [e, s, r, c, n];
|
|
480
|
+
}
|
|
481
|
+
set(e, s, r, c, n) {
|
|
482
|
+
this.h0 = e | 0, this.h1 = s | 0, this.h2 = r | 0, this.h3 = c | 0, this.h4 = n | 0;
|
|
483
|
+
}
|
|
484
|
+
process(e, s) {
|
|
485
|
+
for (let p = 0; p < 16; p++, s += 4)
|
|
486
|
+
Ft[p] = e.getUint32(s, !0);
|
|
487
|
+
let r = this.h0 | 0, c = r, n = this.h1 | 0, i = n, h = this.h2 | 0, f = h, u = this.h3 | 0, l = u, a = this.h4 | 0, y = a;
|
|
488
|
+
for (let p = 0; p < 5; p++) {
|
|
489
|
+
const S = 4 - p, L = O0[p], C = M0[p], R = $e[p], T = Je[p], w = F0[p], k = T0[p];
|
|
490
|
+
for (let A = 0; A < 16; A++) {
|
|
491
|
+
const I = wt(r + He(p, n, h, u) + Ft[R[A]] + L, w[A]) + a | 0;
|
|
492
|
+
r = a, a = u, u = wt(h, 10) | 0, h = n, n = I;
|
|
493
|
+
}
|
|
494
|
+
for (let A = 0; A < 16; A++) {
|
|
495
|
+
const I = wt(c + He(S, i, f, l) + Ft[T[A]] + C, k[A]) + y | 0;
|
|
496
|
+
c = y, y = l, l = wt(f, 10) | 0, f = i, i = I;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
this.set(this.h1 + h + l | 0, this.h2 + u + y | 0, this.h3 + a + c | 0, this.h4 + r + i | 0, this.h0 + n + f | 0);
|
|
500
|
+
}
|
|
501
|
+
roundClean() {
|
|
502
|
+
ot(Ft);
|
|
503
|
+
}
|
|
504
|
+
destroy() {
|
|
505
|
+
this.destroyed = !0, ot(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
const hn = /* @__PURE__ */ qt(() => new G0()), Tt = /* @__PURE__ */ BigInt(2 ** 32 - 1), pe = /* @__PURE__ */ BigInt(32);
|
|
509
|
+
function v0(t, e = !1) {
|
|
510
|
+
return e ? { h: Number(t & Tt), l: Number(t >> pe & Tt) } : { h: Number(t >> pe & Tt) | 0, l: Number(t & Tt) | 0 };
|
|
511
|
+
}
|
|
512
|
+
function j0(t, e = !1) {
|
|
513
|
+
const s = t.length;
|
|
514
|
+
let r = new Uint32Array(s), c = new Uint32Array(s);
|
|
515
|
+
for (let n = 0; n < s; n++) {
|
|
516
|
+
const { h: i, l: h } = v0(t[n], e);
|
|
517
|
+
[r[n], c[n]] = [i, h];
|
|
518
|
+
}
|
|
519
|
+
return [r, c];
|
|
520
|
+
}
|
|
521
|
+
const R0 = (t, e, s) => t << s | e >>> 32 - s, W0 = (t, e, s) => e << s | t >>> 32 - s, P0 = (t, e, s) => e << s - 32 | t >>> 64 - s, N0 = (t, e, s) => t << s - 32 | e >>> 64 - s, q0 = /* @__PURE__ */ Uint32Array.from([
|
|
522
|
+
1116352408,
|
|
523
|
+
1899447441,
|
|
524
|
+
3049323471,
|
|
525
|
+
3921009573,
|
|
526
|
+
961987163,
|
|
527
|
+
1508970993,
|
|
528
|
+
2453635748,
|
|
529
|
+
2870763221,
|
|
530
|
+
3624381080,
|
|
531
|
+
310598401,
|
|
532
|
+
607225278,
|
|
533
|
+
1426881987,
|
|
534
|
+
1925078388,
|
|
535
|
+
2162078206,
|
|
536
|
+
2614888103,
|
|
537
|
+
3248222580,
|
|
538
|
+
3835390401,
|
|
539
|
+
4022224774,
|
|
540
|
+
264347078,
|
|
541
|
+
604807628,
|
|
542
|
+
770255983,
|
|
543
|
+
1249150122,
|
|
544
|
+
1555081692,
|
|
545
|
+
1996064986,
|
|
546
|
+
2554220882,
|
|
547
|
+
2821834349,
|
|
548
|
+
2952996808,
|
|
549
|
+
3210313671,
|
|
550
|
+
3336571891,
|
|
551
|
+
3584528711,
|
|
552
|
+
113926993,
|
|
553
|
+
338241895,
|
|
554
|
+
666307205,
|
|
555
|
+
773529912,
|
|
556
|
+
1294757372,
|
|
557
|
+
1396182291,
|
|
558
|
+
1695183700,
|
|
559
|
+
1986661051,
|
|
560
|
+
2177026350,
|
|
561
|
+
2456956037,
|
|
562
|
+
2730485921,
|
|
563
|
+
2820302411,
|
|
564
|
+
3259730800,
|
|
565
|
+
3345764771,
|
|
566
|
+
3516065817,
|
|
567
|
+
3600352804,
|
|
568
|
+
4094571909,
|
|
569
|
+
275423344,
|
|
570
|
+
430227734,
|
|
571
|
+
506948616,
|
|
572
|
+
659060556,
|
|
573
|
+
883997877,
|
|
574
|
+
958139571,
|
|
575
|
+
1322822218,
|
|
576
|
+
1537002063,
|
|
577
|
+
1747873779,
|
|
578
|
+
1955562222,
|
|
579
|
+
2024104815,
|
|
580
|
+
2227730452,
|
|
581
|
+
2361852424,
|
|
582
|
+
2428436474,
|
|
583
|
+
2756734187,
|
|
584
|
+
3204031479,
|
|
585
|
+
3329325298
|
|
586
|
+
]), ut = /* @__PURE__ */ new Uint32Array(64);
|
|
587
|
+
class K0 extends ce {
|
|
588
|
+
constructor(e) {
|
|
589
|
+
super(64, e, 8, !1);
|
|
590
|
+
}
|
|
591
|
+
get() {
|
|
592
|
+
const { A: e, B: s, C: r, D: c, E: n, F: i, G: h, H: f } = this;
|
|
593
|
+
return [e, s, r, c, n, i, h, f];
|
|
594
|
+
}
|
|
595
|
+
// prettier-ignore
|
|
596
|
+
set(e, s, r, c, n, i, h, f) {
|
|
597
|
+
this.A = e | 0, this.B = s | 0, this.C = r | 0, this.D = c | 0, this.E = n | 0, this.F = i | 0, this.G = h | 0, this.H = f | 0;
|
|
598
|
+
}
|
|
599
|
+
process(e, s) {
|
|
600
|
+
for (let a = 0; a < 16; a++, s += 4)
|
|
601
|
+
ut[a] = e.getUint32(s, !1);
|
|
602
|
+
for (let a = 16; a < 64; a++) {
|
|
603
|
+
const y = ut[a - 15], p = ut[a - 2], S = tt(y, 7) ^ tt(y, 18) ^ y >>> 3, L = tt(p, 17) ^ tt(p, 19) ^ p >>> 10;
|
|
604
|
+
ut[a] = L + ut[a - 7] + S + ut[a - 16] | 0;
|
|
605
|
+
}
|
|
606
|
+
let { A: r, B: c, C: n, D: i, E: h, F: f, G: u, H: l } = this;
|
|
607
|
+
for (let a = 0; a < 64; a++) {
|
|
608
|
+
const y = tt(h, 6) ^ tt(h, 11) ^ tt(h, 25), p = l + y + Ne(h, f, u) + q0[a] + ut[a] | 0, L = (tt(r, 2) ^ tt(r, 13) ^ tt(r, 22)) + qe(r, c, n) | 0;
|
|
609
|
+
l = u, u = f, f = h, h = i + p | 0, i = n, n = c, c = r, r = p + L | 0;
|
|
610
|
+
}
|
|
611
|
+
r = r + this.A | 0, c = c + this.B | 0, n = n + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, f = f + this.F | 0, u = u + this.G | 0, l = l + this.H | 0, this.set(r, c, n, i, h, f, u, l);
|
|
612
|
+
}
|
|
613
|
+
roundClean() {
|
|
614
|
+
ot(ut);
|
|
615
|
+
}
|
|
616
|
+
destroy() {
|
|
617
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), ot(this.buffer);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
class X0 extends K0 {
|
|
621
|
+
// We cannot use array here since array allows indexing by variable
|
|
622
|
+
// which means optimizer/compiler cannot use registers.
|
|
623
|
+
A = ft[0] | 0;
|
|
624
|
+
B = ft[1] | 0;
|
|
625
|
+
C = ft[2] | 0;
|
|
626
|
+
D = ft[3] | 0;
|
|
627
|
+
E = ft[4] | 0;
|
|
628
|
+
F = ft[5] | 0;
|
|
629
|
+
G = ft[6] | 0;
|
|
630
|
+
H = ft[7] | 0;
|
|
631
|
+
constructor() {
|
|
632
|
+
super(32);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
const an = /* @__PURE__ */ qt(
|
|
636
|
+
() => new X0(),
|
|
637
|
+
/* @__PURE__ */ re(1)
|
|
638
|
+
);
|
|
639
|
+
var W = {}, $ = {}, Yt = {}, Et = {}, Ae;
|
|
640
|
+
function $0() {
|
|
641
|
+
return Ae || (Ae = 1, Object.defineProperty(Et, "__esModule", { value: !0 }), Et.crypto = void 0, Et.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Et;
|
|
642
|
+
}
|
|
643
|
+
var ye;
|
|
644
|
+
function oe() {
|
|
645
|
+
return ye || (ye = 1, (function(t) {
|
|
646
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
647
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.wrapXOFConstructorWithOpts = t.wrapConstructorWithOpts = t.wrapConstructor = t.Hash = t.nextTick = t.swap32IfBE = t.byteSwapIfBE = t.swap8IfBE = t.isLE = void 0, t.isBytes = s, t.anumber = r, t.abytes = c, t.ahash = n, t.aexists = i, t.aoutput = h, t.u8 = f, t.u32 = u, t.clean = l, t.createView = a, t.rotr = y, t.rotl = p, t.byteSwap = S, t.byteSwap32 = L, t.bytesToHex = T, t.hexToBytes = A, t.asyncLoop = m, t.utf8ToBytes = E, t.bytesToUtf8 = d, t.toBytes = b, t.kdfInputToBytes = x, t.concatBytes = B, t.checkOpts = g, t.createHasher = F, t.createOptHasher = G, t.createXOFer = v, t.randomBytes = N;
|
|
648
|
+
const e = /* @__PURE__ */ $0();
|
|
649
|
+
function s(o) {
|
|
650
|
+
return o instanceof Uint8Array || ArrayBuffer.isView(o) && o.constructor.name === "Uint8Array";
|
|
651
|
+
}
|
|
652
|
+
function r(o) {
|
|
653
|
+
if (!Number.isSafeInteger(o) || o < 0)
|
|
654
|
+
throw new Error("positive integer expected, got " + o);
|
|
655
|
+
}
|
|
656
|
+
function c(o, ...H) {
|
|
657
|
+
if (!s(o))
|
|
658
|
+
throw new Error("Uint8Array expected");
|
|
659
|
+
if (H.length > 0 && !H.includes(o.length))
|
|
660
|
+
throw new Error("Uint8Array expected of length " + H + ", got length=" + o.length);
|
|
661
|
+
}
|
|
662
|
+
function n(o) {
|
|
663
|
+
if (typeof o != "function" || typeof o.create != "function")
|
|
664
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
665
|
+
r(o.outputLen), r(o.blockLen);
|
|
666
|
+
}
|
|
667
|
+
function i(o, H = !0) {
|
|
668
|
+
if (o.destroyed)
|
|
669
|
+
throw new Error("Hash instance has been destroyed");
|
|
670
|
+
if (H && o.finished)
|
|
671
|
+
throw new Error("Hash#digest() has already been called");
|
|
672
|
+
}
|
|
673
|
+
function h(o, H) {
|
|
674
|
+
c(o);
|
|
675
|
+
const _ = H.outputLen;
|
|
676
|
+
if (o.length < _)
|
|
677
|
+
throw new Error("digestInto() expects output buffer of length at least " + _);
|
|
678
|
+
}
|
|
679
|
+
function f(o) {
|
|
680
|
+
return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
|
|
681
|
+
}
|
|
682
|
+
function u(o) {
|
|
683
|
+
return new Uint32Array(o.buffer, o.byteOffset, Math.floor(o.byteLength / 4));
|
|
684
|
+
}
|
|
685
|
+
function l(...o) {
|
|
686
|
+
for (let H = 0; H < o.length; H++)
|
|
687
|
+
o[H].fill(0);
|
|
688
|
+
}
|
|
689
|
+
function a(o) {
|
|
690
|
+
return new DataView(o.buffer, o.byteOffset, o.byteLength);
|
|
691
|
+
}
|
|
692
|
+
function y(o, H) {
|
|
693
|
+
return o << 32 - H | o >>> H;
|
|
694
|
+
}
|
|
695
|
+
function p(o, H) {
|
|
696
|
+
return o << H | o >>> 32 - H >>> 0;
|
|
697
|
+
}
|
|
698
|
+
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
699
|
+
function S(o) {
|
|
700
|
+
return o << 24 & 4278190080 | o << 8 & 16711680 | o >>> 8 & 65280 | o >>> 24 & 255;
|
|
701
|
+
}
|
|
702
|
+
t.swap8IfBE = t.isLE ? (o) => o : (o) => S(o), t.byteSwapIfBE = t.swap8IfBE;
|
|
703
|
+
function L(o) {
|
|
704
|
+
for (let H = 0; H < o.length; H++)
|
|
705
|
+
o[H] = S(o[H]);
|
|
706
|
+
return o;
|
|
707
|
+
}
|
|
708
|
+
t.swap32IfBE = t.isLE ? (o) => o : L;
|
|
709
|
+
const C = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", R = /* @__PURE__ */ Array.from({ length: 256 }, (o, H) => H.toString(16).padStart(2, "0"));
|
|
710
|
+
function T(o) {
|
|
711
|
+
if (c(o), C)
|
|
712
|
+
return o.toHex();
|
|
713
|
+
let H = "";
|
|
714
|
+
for (let _ = 0; _ < o.length; _++)
|
|
715
|
+
H += R[o[_]];
|
|
716
|
+
return H;
|
|
717
|
+
}
|
|
718
|
+
const w = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
719
|
+
function k(o) {
|
|
720
|
+
if (o >= w._0 && o <= w._9)
|
|
721
|
+
return o - w._0;
|
|
722
|
+
if (o >= w.A && o <= w.F)
|
|
723
|
+
return o - (w.A - 10);
|
|
724
|
+
if (o >= w.a && o <= w.f)
|
|
725
|
+
return o - (w.a - 10);
|
|
726
|
+
}
|
|
727
|
+
function A(o) {
|
|
728
|
+
if (typeof o != "string")
|
|
729
|
+
throw new Error("hex string expected, got " + typeof o);
|
|
730
|
+
if (C)
|
|
731
|
+
return Uint8Array.fromHex(o);
|
|
732
|
+
const H = o.length, _ = H / 2;
|
|
733
|
+
if (H % 2)
|
|
734
|
+
throw new Error("hex string expected, got unpadded hex of length " + H);
|
|
735
|
+
const V = new Uint8Array(_);
|
|
736
|
+
for (let D = 0, j = 0; D < _; D++, j += 2) {
|
|
737
|
+
const Y = k(o.charCodeAt(j)), q = k(o.charCodeAt(j + 1));
|
|
738
|
+
if (Y === void 0 || q === void 0) {
|
|
739
|
+
const K = o[j] + o[j + 1];
|
|
740
|
+
throw new Error('hex string expected, got non-hex character "' + K + '" at index ' + j);
|
|
741
|
+
}
|
|
742
|
+
V[D] = Y * 16 + q;
|
|
743
|
+
}
|
|
744
|
+
return V;
|
|
745
|
+
}
|
|
746
|
+
const I = async () => {
|
|
747
|
+
};
|
|
748
|
+
t.nextTick = I;
|
|
749
|
+
async function m(o, H, _) {
|
|
750
|
+
let V = Date.now();
|
|
751
|
+
for (let D = 0; D < o; D++) {
|
|
752
|
+
_(D);
|
|
753
|
+
const j = Date.now() - V;
|
|
754
|
+
j >= 0 && j < H || (await (0, t.nextTick)(), V += j);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
function E(o) {
|
|
758
|
+
if (typeof o != "string")
|
|
759
|
+
throw new Error("string expected");
|
|
760
|
+
return new Uint8Array(new TextEncoder().encode(o));
|
|
761
|
+
}
|
|
762
|
+
function d(o) {
|
|
763
|
+
return new TextDecoder().decode(o);
|
|
764
|
+
}
|
|
765
|
+
function b(o) {
|
|
766
|
+
return typeof o == "string" && (o = E(o)), c(o), o;
|
|
767
|
+
}
|
|
768
|
+
function x(o) {
|
|
769
|
+
return typeof o == "string" && (o = E(o)), c(o), o;
|
|
770
|
+
}
|
|
771
|
+
function B(...o) {
|
|
772
|
+
let H = 0;
|
|
773
|
+
for (let V = 0; V < o.length; V++) {
|
|
774
|
+
const D = o[V];
|
|
775
|
+
c(D), H += D.length;
|
|
776
|
+
}
|
|
777
|
+
const _ = new Uint8Array(H);
|
|
778
|
+
for (let V = 0, D = 0; V < o.length; V++) {
|
|
779
|
+
const j = o[V];
|
|
780
|
+
_.set(j, D), D += j.length;
|
|
781
|
+
}
|
|
782
|
+
return _;
|
|
783
|
+
}
|
|
784
|
+
function g(o, H) {
|
|
785
|
+
if (H !== void 0 && {}.toString.call(H) !== "[object Object]")
|
|
786
|
+
throw new Error("options should be object or undefined");
|
|
787
|
+
return Object.assign(o, H);
|
|
788
|
+
}
|
|
789
|
+
class U {
|
|
790
|
+
}
|
|
791
|
+
t.Hash = U;
|
|
792
|
+
function F(o) {
|
|
793
|
+
const H = (V) => o().update(b(V)).digest(), _ = o();
|
|
794
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = () => o(), H;
|
|
795
|
+
}
|
|
796
|
+
function G(o) {
|
|
797
|
+
const H = (V, D) => o(D).update(b(V)).digest(), _ = o({});
|
|
798
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = (V) => o(V), H;
|
|
799
|
+
}
|
|
800
|
+
function v(o) {
|
|
801
|
+
const H = (V, D) => o(D).update(b(V)).digest(), _ = o({});
|
|
802
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = (V) => o(V), H;
|
|
803
|
+
}
|
|
804
|
+
t.wrapConstructor = F, t.wrapConstructorWithOpts = G, t.wrapXOFConstructorWithOpts = v;
|
|
805
|
+
function N(o = 32) {
|
|
806
|
+
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
807
|
+
return e.crypto.getRandomValues(new Uint8Array(o));
|
|
808
|
+
if (e.crypto && typeof e.crypto.randomBytes == "function")
|
|
809
|
+
return Uint8Array.from(e.crypto.randomBytes(o));
|
|
810
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
811
|
+
}
|
|
812
|
+
})(Yt)), Yt;
|
|
813
|
+
}
|
|
814
|
+
var ge;
|
|
815
|
+
function J0() {
|
|
816
|
+
if (ge) return $;
|
|
817
|
+
ge = 1, Object.defineProperty($, "__esModule", { value: !0 }), $.SHA512_IV = $.SHA384_IV = $.SHA224_IV = $.SHA256_IV = $.HashMD = void 0, $.setBigUint64 = e, $.Chi = s, $.Maj = r;
|
|
818
|
+
const t = /* @__PURE__ */ oe();
|
|
819
|
+
function e(n, i, h, f) {
|
|
820
|
+
if (typeof n.setBigUint64 == "function")
|
|
821
|
+
return n.setBigUint64(i, h, f);
|
|
822
|
+
const u = BigInt(32), l = BigInt(4294967295), a = Number(h >> u & l), y = Number(h & l), p = f ? 4 : 0, S = f ? 0 : 4;
|
|
823
|
+
n.setUint32(i + p, a, f), n.setUint32(i + S, y, f);
|
|
824
|
+
}
|
|
825
|
+
function s(n, i, h) {
|
|
826
|
+
return n & i ^ ~n & h;
|
|
827
|
+
}
|
|
828
|
+
function r(n, i, h) {
|
|
829
|
+
return n & i ^ n & h ^ i & h;
|
|
830
|
+
}
|
|
831
|
+
class c extends t.Hash {
|
|
832
|
+
constructor(i, h, f, u) {
|
|
833
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = i, this.outputLen = h, this.padOffset = f, this.isLE = u, this.buffer = new Uint8Array(i), this.view = (0, t.createView)(this.buffer);
|
|
834
|
+
}
|
|
835
|
+
update(i) {
|
|
836
|
+
(0, t.aexists)(this), i = (0, t.toBytes)(i), (0, t.abytes)(i);
|
|
837
|
+
const { view: h, buffer: f, blockLen: u } = this, l = i.length;
|
|
838
|
+
for (let a = 0; a < l; ) {
|
|
839
|
+
const y = Math.min(u - this.pos, l - a);
|
|
840
|
+
if (y === u) {
|
|
841
|
+
const p = (0, t.createView)(i);
|
|
842
|
+
for (; u <= l - a; a += u)
|
|
843
|
+
this.process(p, a);
|
|
844
|
+
continue;
|
|
845
|
+
}
|
|
846
|
+
f.set(i.subarray(a, a + y), this.pos), this.pos += y, a += y, this.pos === u && (this.process(h, 0), this.pos = 0);
|
|
847
|
+
}
|
|
848
|
+
return this.length += i.length, this.roundClean(), this;
|
|
849
|
+
}
|
|
850
|
+
digestInto(i) {
|
|
851
|
+
(0, t.aexists)(this), (0, t.aoutput)(i, this), this.finished = !0;
|
|
852
|
+
const { buffer: h, view: f, blockLen: u, isLE: l } = this;
|
|
853
|
+
let { pos: a } = this;
|
|
854
|
+
h[a++] = 128, (0, t.clean)(this.buffer.subarray(a)), this.padOffset > u - a && (this.process(f, 0), a = 0);
|
|
855
|
+
for (let C = a; C < u; C++)
|
|
856
|
+
h[C] = 0;
|
|
857
|
+
e(f, u - 8, BigInt(this.length * 8), l), this.process(f, 0);
|
|
858
|
+
const y = (0, t.createView)(i), p = this.outputLen;
|
|
859
|
+
if (p % 4)
|
|
860
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
861
|
+
const S = p / 4, L = this.get();
|
|
862
|
+
if (S > L.length)
|
|
863
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
864
|
+
for (let C = 0; C < S; C++)
|
|
865
|
+
y.setUint32(4 * C, L[C], l);
|
|
866
|
+
}
|
|
867
|
+
digest() {
|
|
868
|
+
const { buffer: i, outputLen: h } = this;
|
|
869
|
+
this.digestInto(i);
|
|
870
|
+
const f = i.slice(0, h);
|
|
871
|
+
return this.destroy(), f;
|
|
872
|
+
}
|
|
873
|
+
_cloneInto(i) {
|
|
874
|
+
i || (i = new this.constructor()), i.set(...this.get());
|
|
875
|
+
const { blockLen: h, buffer: f, length: u, finished: l, destroyed: a, pos: y } = this;
|
|
876
|
+
return i.destroyed = a, i.finished = l, i.length = u, i.pos = y, u % h && i.buffer.set(f), i;
|
|
877
|
+
}
|
|
878
|
+
clone() {
|
|
879
|
+
return this._cloneInto();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return $.HashMD = c, $.SHA256_IV = Uint32Array.from([
|
|
883
|
+
1779033703,
|
|
884
|
+
3144134277,
|
|
885
|
+
1013904242,
|
|
886
|
+
2773480762,
|
|
887
|
+
1359893119,
|
|
888
|
+
2600822924,
|
|
889
|
+
528734635,
|
|
890
|
+
1541459225
|
|
891
|
+
]), $.SHA224_IV = Uint32Array.from([
|
|
892
|
+
3238371032,
|
|
893
|
+
914150663,
|
|
894
|
+
812702999,
|
|
895
|
+
4144912697,
|
|
896
|
+
4290775857,
|
|
897
|
+
1750603025,
|
|
898
|
+
1694076839,
|
|
899
|
+
3204075428
|
|
900
|
+
]), $.SHA384_IV = Uint32Array.from([
|
|
901
|
+
3418070365,
|
|
902
|
+
3238371032,
|
|
903
|
+
1654270250,
|
|
904
|
+
914150663,
|
|
905
|
+
2438529370,
|
|
906
|
+
812702999,
|
|
907
|
+
355462360,
|
|
908
|
+
4144912697,
|
|
909
|
+
1731405415,
|
|
910
|
+
4290775857,
|
|
911
|
+
2394180231,
|
|
912
|
+
1750603025,
|
|
913
|
+
3675008525,
|
|
914
|
+
1694076839,
|
|
915
|
+
1203062813,
|
|
916
|
+
3204075428
|
|
917
|
+
]), $.SHA512_IV = Uint32Array.from([
|
|
918
|
+
1779033703,
|
|
919
|
+
4089235720,
|
|
920
|
+
3144134277,
|
|
921
|
+
2227873595,
|
|
922
|
+
1013904242,
|
|
923
|
+
4271175723,
|
|
924
|
+
2773480762,
|
|
925
|
+
1595750129,
|
|
926
|
+
1359893119,
|
|
927
|
+
2917565137,
|
|
928
|
+
2600822924,
|
|
929
|
+
725511199,
|
|
930
|
+
528734635,
|
|
931
|
+
4215389547,
|
|
932
|
+
1541459225,
|
|
933
|
+
327033209
|
|
934
|
+
]), $;
|
|
935
|
+
}
|
|
936
|
+
var O = {}, _e;
|
|
937
|
+
function Q0() {
|
|
938
|
+
if (_e) return O;
|
|
939
|
+
_e = 1, Object.defineProperty(O, "__esModule", { value: !0 }), O.toBig = O.shrSL = O.shrSH = O.rotrSL = O.rotrSH = O.rotrBL = O.rotrBH = O.rotr32L = O.rotr32H = O.rotlSL = O.rotlSH = O.rotlBL = O.rotlBH = O.add5L = O.add5H = O.add4L = O.add4H = O.add3L = O.add3H = void 0, O.add = R, O.fromBig = s, O.split = r;
|
|
940
|
+
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
941
|
+
function s(d, b = !1) {
|
|
942
|
+
return b ? { h: Number(d & t), l: Number(d >> e & t) } : { h: Number(d >> e & t) | 0, l: Number(d & t) | 0 };
|
|
943
|
+
}
|
|
944
|
+
function r(d, b = !1) {
|
|
945
|
+
const x = d.length;
|
|
946
|
+
let B = new Uint32Array(x), g = new Uint32Array(x);
|
|
947
|
+
for (let U = 0; U < x; U++) {
|
|
948
|
+
const { h: F, l: G } = s(d[U], b);
|
|
949
|
+
[B[U], g[U]] = [F, G];
|
|
950
|
+
}
|
|
951
|
+
return [B, g];
|
|
952
|
+
}
|
|
953
|
+
const c = (d, b) => BigInt(d >>> 0) << e | BigInt(b >>> 0);
|
|
954
|
+
O.toBig = c;
|
|
955
|
+
const n = (d, b, x) => d >>> x;
|
|
956
|
+
O.shrSH = n;
|
|
957
|
+
const i = (d, b, x) => d << 32 - x | b >>> x;
|
|
958
|
+
O.shrSL = i;
|
|
959
|
+
const h = (d, b, x) => d >>> x | b << 32 - x;
|
|
960
|
+
O.rotrSH = h;
|
|
961
|
+
const f = (d, b, x) => d << 32 - x | b >>> x;
|
|
962
|
+
O.rotrSL = f;
|
|
963
|
+
const u = (d, b, x) => d << 64 - x | b >>> x - 32;
|
|
964
|
+
O.rotrBH = u;
|
|
965
|
+
const l = (d, b, x) => d >>> x - 32 | b << 64 - x;
|
|
966
|
+
O.rotrBL = l;
|
|
967
|
+
const a = (d, b) => b;
|
|
968
|
+
O.rotr32H = a;
|
|
969
|
+
const y = (d, b) => d;
|
|
970
|
+
O.rotr32L = y;
|
|
971
|
+
const p = (d, b, x) => d << x | b >>> 32 - x;
|
|
972
|
+
O.rotlSH = p;
|
|
973
|
+
const S = (d, b, x) => b << x | d >>> 32 - x;
|
|
974
|
+
O.rotlSL = S;
|
|
975
|
+
const L = (d, b, x) => b << x - 32 | d >>> 64 - x;
|
|
976
|
+
O.rotlBH = L;
|
|
977
|
+
const C = (d, b, x) => d << x - 32 | b >>> 64 - x;
|
|
978
|
+
O.rotlBL = C;
|
|
979
|
+
function R(d, b, x, B) {
|
|
980
|
+
const g = (b >>> 0) + (B >>> 0);
|
|
981
|
+
return { h: d + x + (g / 2 ** 32 | 0) | 0, l: g | 0 };
|
|
982
|
+
}
|
|
983
|
+
const T = (d, b, x) => (d >>> 0) + (b >>> 0) + (x >>> 0);
|
|
984
|
+
O.add3L = T;
|
|
985
|
+
const w = (d, b, x, B) => b + x + B + (d / 2 ** 32 | 0) | 0;
|
|
986
|
+
O.add3H = w;
|
|
987
|
+
const k = (d, b, x, B) => (d >>> 0) + (b >>> 0) + (x >>> 0) + (B >>> 0);
|
|
988
|
+
O.add4L = k;
|
|
989
|
+
const A = (d, b, x, B, g) => b + x + B + g + (d / 2 ** 32 | 0) | 0;
|
|
990
|
+
O.add4H = A;
|
|
991
|
+
const I = (d, b, x, B, g) => (d >>> 0) + (b >>> 0) + (x >>> 0) + (B >>> 0) + (g >>> 0);
|
|
992
|
+
O.add5L = I;
|
|
993
|
+
const m = (d, b, x, B, g, U) => b + x + B + g + U + (d / 2 ** 32 | 0) | 0;
|
|
994
|
+
O.add5H = m;
|
|
995
|
+
const E = {
|
|
996
|
+
fromBig: s,
|
|
997
|
+
split: r,
|
|
998
|
+
toBig: c,
|
|
999
|
+
shrSH: n,
|
|
1000
|
+
shrSL: i,
|
|
1001
|
+
rotrSH: h,
|
|
1002
|
+
rotrSL: f,
|
|
1003
|
+
rotrBH: u,
|
|
1004
|
+
rotrBL: l,
|
|
1005
|
+
rotr32H: a,
|
|
1006
|
+
rotr32L: y,
|
|
1007
|
+
rotlSH: p,
|
|
1008
|
+
rotlSL: S,
|
|
1009
|
+
rotlBH: L,
|
|
1010
|
+
rotlBL: C,
|
|
1011
|
+
add: R,
|
|
1012
|
+
add3L: T,
|
|
1013
|
+
add3H: w,
|
|
1014
|
+
add4L: k,
|
|
1015
|
+
add4H: A,
|
|
1016
|
+
add5H: m,
|
|
1017
|
+
add5L: I
|
|
1018
|
+
};
|
|
1019
|
+
return O.default = E, O;
|
|
1020
|
+
}
|
|
1021
|
+
var we;
|
|
1022
|
+
function fn() {
|
|
1023
|
+
if (we) return W;
|
|
1024
|
+
we = 1, Object.defineProperty(W, "__esModule", { value: !0 }), W.sha512_224 = W.sha512_256 = W.sha384 = W.sha512 = W.sha224 = W.sha256 = W.SHA512_256 = W.SHA512_224 = W.SHA384 = W.SHA512 = W.SHA224 = W.SHA256 = void 0;
|
|
1025
|
+
const t = /* @__PURE__ */ J0(), e = /* @__PURE__ */ Q0(), s = /* @__PURE__ */ oe(), r = /* @__PURE__ */ Uint32Array.from([
|
|
1026
|
+
1116352408,
|
|
1027
|
+
1899447441,
|
|
1028
|
+
3049323471,
|
|
1029
|
+
3921009573,
|
|
1030
|
+
961987163,
|
|
1031
|
+
1508970993,
|
|
1032
|
+
2453635748,
|
|
1033
|
+
2870763221,
|
|
1034
|
+
3624381080,
|
|
1035
|
+
310598401,
|
|
1036
|
+
607225278,
|
|
1037
|
+
1426881987,
|
|
1038
|
+
1925078388,
|
|
1039
|
+
2162078206,
|
|
1040
|
+
2614888103,
|
|
1041
|
+
3248222580,
|
|
1042
|
+
3835390401,
|
|
1043
|
+
4022224774,
|
|
1044
|
+
264347078,
|
|
1045
|
+
604807628,
|
|
1046
|
+
770255983,
|
|
1047
|
+
1249150122,
|
|
1048
|
+
1555081692,
|
|
1049
|
+
1996064986,
|
|
1050
|
+
2554220882,
|
|
1051
|
+
2821834349,
|
|
1052
|
+
2952996808,
|
|
1053
|
+
3210313671,
|
|
1054
|
+
3336571891,
|
|
1055
|
+
3584528711,
|
|
1056
|
+
113926993,
|
|
1057
|
+
338241895,
|
|
1058
|
+
666307205,
|
|
1059
|
+
773529912,
|
|
1060
|
+
1294757372,
|
|
1061
|
+
1396182291,
|
|
1062
|
+
1695183700,
|
|
1063
|
+
1986661051,
|
|
1064
|
+
2177026350,
|
|
1065
|
+
2456956037,
|
|
1066
|
+
2730485921,
|
|
1067
|
+
2820302411,
|
|
1068
|
+
3259730800,
|
|
1069
|
+
3345764771,
|
|
1070
|
+
3516065817,
|
|
1071
|
+
3600352804,
|
|
1072
|
+
4094571909,
|
|
1073
|
+
275423344,
|
|
1074
|
+
430227734,
|
|
1075
|
+
506948616,
|
|
1076
|
+
659060556,
|
|
1077
|
+
883997877,
|
|
1078
|
+
958139571,
|
|
1079
|
+
1322822218,
|
|
1080
|
+
1537002063,
|
|
1081
|
+
1747873779,
|
|
1082
|
+
1955562222,
|
|
1083
|
+
2024104815,
|
|
1084
|
+
2227730452,
|
|
1085
|
+
2361852424,
|
|
1086
|
+
2428436474,
|
|
1087
|
+
2756734187,
|
|
1088
|
+
3204031479,
|
|
1089
|
+
3329325298
|
|
1090
|
+
]), c = /* @__PURE__ */ new Uint32Array(64);
|
|
1091
|
+
class n extends t.HashMD {
|
|
1092
|
+
constructor(w = 32) {
|
|
1093
|
+
super(64, w, 8, !1), this.A = t.SHA256_IV[0] | 0, this.B = t.SHA256_IV[1] | 0, this.C = t.SHA256_IV[2] | 0, this.D = t.SHA256_IV[3] | 0, this.E = t.SHA256_IV[4] | 0, this.F = t.SHA256_IV[5] | 0, this.G = t.SHA256_IV[6] | 0, this.H = t.SHA256_IV[7] | 0;
|
|
1094
|
+
}
|
|
1095
|
+
get() {
|
|
1096
|
+
const { A: w, B: k, C: A, D: I, E: m, F: E, G: d, H: b } = this;
|
|
1097
|
+
return [w, k, A, I, m, E, d, b];
|
|
1098
|
+
}
|
|
1099
|
+
// prettier-ignore
|
|
1100
|
+
set(w, k, A, I, m, E, d, b) {
|
|
1101
|
+
this.A = w | 0, this.B = k | 0, this.C = A | 0, this.D = I | 0, this.E = m | 0, this.F = E | 0, this.G = d | 0, this.H = b | 0;
|
|
1102
|
+
}
|
|
1103
|
+
process(w, k) {
|
|
1104
|
+
for (let g = 0; g < 16; g++, k += 4)
|
|
1105
|
+
c[g] = w.getUint32(k, !1);
|
|
1106
|
+
for (let g = 16; g < 64; g++) {
|
|
1107
|
+
const U = c[g - 15], F = c[g - 2], G = (0, s.rotr)(U, 7) ^ (0, s.rotr)(U, 18) ^ U >>> 3, v = (0, s.rotr)(F, 17) ^ (0, s.rotr)(F, 19) ^ F >>> 10;
|
|
1108
|
+
c[g] = v + c[g - 7] + G + c[g - 16] | 0;
|
|
1109
|
+
}
|
|
1110
|
+
let { A, B: I, C: m, D: E, E: d, F: b, G: x, H: B } = this;
|
|
1111
|
+
for (let g = 0; g < 64; g++) {
|
|
1112
|
+
const U = (0, s.rotr)(d, 6) ^ (0, s.rotr)(d, 11) ^ (0, s.rotr)(d, 25), F = B + U + (0, t.Chi)(d, b, x) + r[g] + c[g] | 0, v = ((0, s.rotr)(A, 2) ^ (0, s.rotr)(A, 13) ^ (0, s.rotr)(A, 22)) + (0, t.Maj)(A, I, m) | 0;
|
|
1113
|
+
B = x, x = b, b = d, d = E + F | 0, E = m, m = I, I = A, A = F + v | 0;
|
|
1114
|
+
}
|
|
1115
|
+
A = A + this.A | 0, I = I + this.B | 0, m = m + this.C | 0, E = E + this.D | 0, d = d + this.E | 0, b = b + this.F | 0, x = x + this.G | 0, B = B + this.H | 0, this.set(A, I, m, E, d, b, x, B);
|
|
1116
|
+
}
|
|
1117
|
+
roundClean() {
|
|
1118
|
+
(0, s.clean)(c);
|
|
1119
|
+
}
|
|
1120
|
+
destroy() {
|
|
1121
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
W.SHA256 = n;
|
|
1125
|
+
class i extends n {
|
|
1126
|
+
constructor() {
|
|
1127
|
+
super(28), this.A = t.SHA224_IV[0] | 0, this.B = t.SHA224_IV[1] | 0, this.C = t.SHA224_IV[2] | 0, this.D = t.SHA224_IV[3] | 0, this.E = t.SHA224_IV[4] | 0, this.F = t.SHA224_IV[5] | 0, this.G = t.SHA224_IV[6] | 0, this.H = t.SHA224_IV[7] | 0;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
W.SHA224 = i;
|
|
1131
|
+
const h = e.split([
|
|
1132
|
+
"0x428a2f98d728ae22",
|
|
1133
|
+
"0x7137449123ef65cd",
|
|
1134
|
+
"0xb5c0fbcfec4d3b2f",
|
|
1135
|
+
"0xe9b5dba58189dbbc",
|
|
1136
|
+
"0x3956c25bf348b538",
|
|
1137
|
+
"0x59f111f1b605d019",
|
|
1138
|
+
"0x923f82a4af194f9b",
|
|
1139
|
+
"0xab1c5ed5da6d8118",
|
|
1140
|
+
"0xd807aa98a3030242",
|
|
1141
|
+
"0x12835b0145706fbe",
|
|
1142
|
+
"0x243185be4ee4b28c",
|
|
1143
|
+
"0x550c7dc3d5ffb4e2",
|
|
1144
|
+
"0x72be5d74f27b896f",
|
|
1145
|
+
"0x80deb1fe3b1696b1",
|
|
1146
|
+
"0x9bdc06a725c71235",
|
|
1147
|
+
"0xc19bf174cf692694",
|
|
1148
|
+
"0xe49b69c19ef14ad2",
|
|
1149
|
+
"0xefbe4786384f25e3",
|
|
1150
|
+
"0x0fc19dc68b8cd5b5",
|
|
1151
|
+
"0x240ca1cc77ac9c65",
|
|
1152
|
+
"0x2de92c6f592b0275",
|
|
1153
|
+
"0x4a7484aa6ea6e483",
|
|
1154
|
+
"0x5cb0a9dcbd41fbd4",
|
|
1155
|
+
"0x76f988da831153b5",
|
|
1156
|
+
"0x983e5152ee66dfab",
|
|
1157
|
+
"0xa831c66d2db43210",
|
|
1158
|
+
"0xb00327c898fb213f",
|
|
1159
|
+
"0xbf597fc7beef0ee4",
|
|
1160
|
+
"0xc6e00bf33da88fc2",
|
|
1161
|
+
"0xd5a79147930aa725",
|
|
1162
|
+
"0x06ca6351e003826f",
|
|
1163
|
+
"0x142929670a0e6e70",
|
|
1164
|
+
"0x27b70a8546d22ffc",
|
|
1165
|
+
"0x2e1b21385c26c926",
|
|
1166
|
+
"0x4d2c6dfc5ac42aed",
|
|
1167
|
+
"0x53380d139d95b3df",
|
|
1168
|
+
"0x650a73548baf63de",
|
|
1169
|
+
"0x766a0abb3c77b2a8",
|
|
1170
|
+
"0x81c2c92e47edaee6",
|
|
1171
|
+
"0x92722c851482353b",
|
|
1172
|
+
"0xa2bfe8a14cf10364",
|
|
1173
|
+
"0xa81a664bbc423001",
|
|
1174
|
+
"0xc24b8b70d0f89791",
|
|
1175
|
+
"0xc76c51a30654be30",
|
|
1176
|
+
"0xd192e819d6ef5218",
|
|
1177
|
+
"0xd69906245565a910",
|
|
1178
|
+
"0xf40e35855771202a",
|
|
1179
|
+
"0x106aa07032bbd1b8",
|
|
1180
|
+
"0x19a4c116b8d2d0c8",
|
|
1181
|
+
"0x1e376c085141ab53",
|
|
1182
|
+
"0x2748774cdf8eeb99",
|
|
1183
|
+
"0x34b0bcb5e19b48a8",
|
|
1184
|
+
"0x391c0cb3c5c95a63",
|
|
1185
|
+
"0x4ed8aa4ae3418acb",
|
|
1186
|
+
"0x5b9cca4f7763e373",
|
|
1187
|
+
"0x682e6ff3d6b2b8a3",
|
|
1188
|
+
"0x748f82ee5defb2fc",
|
|
1189
|
+
"0x78a5636f43172f60",
|
|
1190
|
+
"0x84c87814a1f0ab72",
|
|
1191
|
+
"0x8cc702081a6439ec",
|
|
1192
|
+
"0x90befffa23631e28",
|
|
1193
|
+
"0xa4506cebde82bde9",
|
|
1194
|
+
"0xbef9a3f7b2c67915",
|
|
1195
|
+
"0xc67178f2e372532b",
|
|
1196
|
+
"0xca273eceea26619c",
|
|
1197
|
+
"0xd186b8c721c0c207",
|
|
1198
|
+
"0xeada7dd6cde0eb1e",
|
|
1199
|
+
"0xf57d4f7fee6ed178",
|
|
1200
|
+
"0x06f067aa72176fba",
|
|
1201
|
+
"0x0a637dc5a2c898a6",
|
|
1202
|
+
"0x113f9804bef90dae",
|
|
1203
|
+
"0x1b710b35131c471b",
|
|
1204
|
+
"0x28db77f523047d84",
|
|
1205
|
+
"0x32caab7b40c72493",
|
|
1206
|
+
"0x3c9ebe0a15c9bebc",
|
|
1207
|
+
"0x431d67c49c100d4c",
|
|
1208
|
+
"0x4cc5d4becb3e42b6",
|
|
1209
|
+
"0x597f299cfc657e2a",
|
|
1210
|
+
"0x5fcb6fab3ad6faec",
|
|
1211
|
+
"0x6c44198c4a475817"
|
|
1212
|
+
].map((T) => BigInt(T))), f = h[0], u = h[1], l = /* @__PURE__ */ new Uint32Array(80), a = /* @__PURE__ */ new Uint32Array(80);
|
|
1213
|
+
class y extends t.HashMD {
|
|
1214
|
+
constructor(w = 64) {
|
|
1215
|
+
super(128, w, 16, !1), this.Ah = t.SHA512_IV[0] | 0, this.Al = t.SHA512_IV[1] | 0, this.Bh = t.SHA512_IV[2] | 0, this.Bl = t.SHA512_IV[3] | 0, this.Ch = t.SHA512_IV[4] | 0, this.Cl = t.SHA512_IV[5] | 0, this.Dh = t.SHA512_IV[6] | 0, this.Dl = t.SHA512_IV[7] | 0, this.Eh = t.SHA512_IV[8] | 0, this.El = t.SHA512_IV[9] | 0, this.Fh = t.SHA512_IV[10] | 0, this.Fl = t.SHA512_IV[11] | 0, this.Gh = t.SHA512_IV[12] | 0, this.Gl = t.SHA512_IV[13] | 0, this.Hh = t.SHA512_IV[14] | 0, this.Hl = t.SHA512_IV[15] | 0;
|
|
1216
|
+
}
|
|
1217
|
+
// prettier-ignore
|
|
1218
|
+
get() {
|
|
1219
|
+
const { Ah: w, Al: k, Bh: A, Bl: I, Ch: m, Cl: E, Dh: d, Dl: b, Eh: x, El: B, Fh: g, Fl: U, Gh: F, Gl: G, Hh: v, Hl: N } = this;
|
|
1220
|
+
return [w, k, A, I, m, E, d, b, x, B, g, U, F, G, v, N];
|
|
1221
|
+
}
|
|
1222
|
+
// prettier-ignore
|
|
1223
|
+
set(w, k, A, I, m, E, d, b, x, B, g, U, F, G, v, N) {
|
|
1224
|
+
this.Ah = w | 0, this.Al = k | 0, this.Bh = A | 0, this.Bl = I | 0, this.Ch = m | 0, this.Cl = E | 0, this.Dh = d | 0, this.Dl = b | 0, this.Eh = x | 0, this.El = B | 0, this.Fh = g | 0, this.Fl = U | 0, this.Gh = F | 0, this.Gl = G | 0, this.Hh = v | 0, this.Hl = N | 0;
|
|
1225
|
+
}
|
|
1226
|
+
process(w, k) {
|
|
1227
|
+
for (let _ = 0; _ < 16; _++, k += 4)
|
|
1228
|
+
l[_] = w.getUint32(k), a[_] = w.getUint32(k += 4);
|
|
1229
|
+
for (let _ = 16; _ < 80; _++) {
|
|
1230
|
+
const V = l[_ - 15] | 0, D = a[_ - 15] | 0, j = e.rotrSH(V, D, 1) ^ e.rotrSH(V, D, 8) ^ e.shrSH(V, D, 7), Y = e.rotrSL(V, D, 1) ^ e.rotrSL(V, D, 8) ^ e.shrSL(V, D, 7), q = l[_ - 2] | 0, K = a[_ - 2] | 0, nt = e.rotrSH(q, K, 19) ^ e.rotrBH(q, K, 61) ^ e.shrSH(q, K, 6), gt = e.rotrSL(q, K, 19) ^ e.rotrBL(q, K, 61) ^ e.shrSL(q, K, 6), it = e.add4L(Y, gt, a[_ - 7], a[_ - 16]), _t = e.add4H(it, j, nt, l[_ - 7], l[_ - 16]);
|
|
1231
|
+
l[_] = _t | 0, a[_] = it | 0;
|
|
1232
|
+
}
|
|
1233
|
+
let { Ah: A, Al: I, Bh: m, Bl: E, Ch: d, Cl: b, Dh: x, Dl: B, Eh: g, El: U, Fh: F, Fl: G, Gh: v, Gl: N, Hh: o, Hl: H } = this;
|
|
1234
|
+
for (let _ = 0; _ < 80; _++) {
|
|
1235
|
+
const V = e.rotrSH(g, U, 14) ^ e.rotrSH(g, U, 18) ^ e.rotrBH(g, U, 41), D = e.rotrSL(g, U, 14) ^ e.rotrSL(g, U, 18) ^ e.rotrBL(g, U, 41), j = g & F ^ ~g & v, Y = U & G ^ ~U & N, q = e.add5L(H, D, Y, u[_], a[_]), K = e.add5H(q, o, V, j, f[_], l[_]), nt = q | 0, gt = e.rotrSH(A, I, 28) ^ e.rotrBH(A, I, 34) ^ e.rotrBH(A, I, 39), it = e.rotrSL(A, I, 28) ^ e.rotrBL(A, I, 34) ^ e.rotrBL(A, I, 39), _t = A & m ^ A & d ^ m & d, $t = I & E ^ I & b ^ E & b;
|
|
1236
|
+
o = v | 0, H = N | 0, v = F | 0, N = G | 0, F = g | 0, G = U | 0, { h: g, l: U } = e.add(x | 0, B | 0, K | 0, nt | 0), x = d | 0, B = b | 0, d = m | 0, b = E | 0, m = A | 0, E = I | 0;
|
|
1237
|
+
const mt = e.add3L(nt, it, $t);
|
|
1238
|
+
A = e.add3H(mt, K, gt, _t), I = mt | 0;
|
|
1239
|
+
}
|
|
1240
|
+
({ h: A, l: I } = e.add(this.Ah | 0, this.Al | 0, A | 0, I | 0)), { h: m, l: E } = e.add(this.Bh | 0, this.Bl | 0, m | 0, E | 0), { h: d, l: b } = e.add(this.Ch | 0, this.Cl | 0, d | 0, b | 0), { h: x, l: B } = e.add(this.Dh | 0, this.Dl | 0, x | 0, B | 0), { h: g, l: U } = e.add(this.Eh | 0, this.El | 0, g | 0, U | 0), { h: F, l: G } = e.add(this.Fh | 0, this.Fl | 0, F | 0, G | 0), { h: v, l: N } = e.add(this.Gh | 0, this.Gl | 0, v | 0, N | 0), { h: o, l: H } = e.add(this.Hh | 0, this.Hl | 0, o | 0, H | 0), this.set(A, I, m, E, d, b, x, B, g, U, F, G, v, N, o, H);
|
|
1241
|
+
}
|
|
1242
|
+
roundClean() {
|
|
1243
|
+
(0, s.clean)(l, a);
|
|
1244
|
+
}
|
|
1245
|
+
destroy() {
|
|
1246
|
+
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
W.SHA512 = y;
|
|
1250
|
+
class p extends y {
|
|
1251
|
+
constructor() {
|
|
1252
|
+
super(48), this.Ah = t.SHA384_IV[0] | 0, this.Al = t.SHA384_IV[1] | 0, this.Bh = t.SHA384_IV[2] | 0, this.Bl = t.SHA384_IV[3] | 0, this.Ch = t.SHA384_IV[4] | 0, this.Cl = t.SHA384_IV[5] | 0, this.Dh = t.SHA384_IV[6] | 0, this.Dl = t.SHA384_IV[7] | 0, this.Eh = t.SHA384_IV[8] | 0, this.El = t.SHA384_IV[9] | 0, this.Fh = t.SHA384_IV[10] | 0, this.Fl = t.SHA384_IV[11] | 0, this.Gh = t.SHA384_IV[12] | 0, this.Gl = t.SHA384_IV[13] | 0, this.Hh = t.SHA384_IV[14] | 0, this.Hl = t.SHA384_IV[15] | 0;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
W.SHA384 = p;
|
|
1256
|
+
const S = /* @__PURE__ */ Uint32Array.from([
|
|
1257
|
+
2352822216,
|
|
1258
|
+
424955298,
|
|
1259
|
+
1944164710,
|
|
1260
|
+
2312950998,
|
|
1261
|
+
502970286,
|
|
1262
|
+
855612546,
|
|
1263
|
+
1738396948,
|
|
1264
|
+
1479516111,
|
|
1265
|
+
258812777,
|
|
1266
|
+
2077511080,
|
|
1267
|
+
2011393907,
|
|
1268
|
+
79989058,
|
|
1269
|
+
1067287976,
|
|
1270
|
+
1780299464,
|
|
1271
|
+
286451373,
|
|
1272
|
+
2446758561
|
|
1273
|
+
]), L = /* @__PURE__ */ Uint32Array.from([
|
|
1274
|
+
573645204,
|
|
1275
|
+
4230739756,
|
|
1276
|
+
2673172387,
|
|
1277
|
+
3360449730,
|
|
1278
|
+
596883563,
|
|
1279
|
+
1867755857,
|
|
1280
|
+
2520282905,
|
|
1281
|
+
1497426621,
|
|
1282
|
+
2519219938,
|
|
1283
|
+
2827943907,
|
|
1284
|
+
3193839141,
|
|
1285
|
+
1401305490,
|
|
1286
|
+
721525244,
|
|
1287
|
+
746961066,
|
|
1288
|
+
246885852,
|
|
1289
|
+
2177182882
|
|
1290
|
+
]);
|
|
1291
|
+
class C extends y {
|
|
1292
|
+
constructor() {
|
|
1293
|
+
super(28), this.Ah = S[0] | 0, this.Al = S[1] | 0, this.Bh = S[2] | 0, this.Bl = S[3] | 0, this.Ch = S[4] | 0, this.Cl = S[5] | 0, this.Dh = S[6] | 0, this.Dl = S[7] | 0, this.Eh = S[8] | 0, this.El = S[9] | 0, this.Fh = S[10] | 0, this.Fl = S[11] | 0, this.Gh = S[12] | 0, this.Gl = S[13] | 0, this.Hh = S[14] | 0, this.Hl = S[15] | 0;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
W.SHA512_224 = C;
|
|
1297
|
+
class R extends y {
|
|
1298
|
+
constructor() {
|
|
1299
|
+
super(32), this.Ah = L[0] | 0, this.Al = L[1] | 0, this.Bh = L[2] | 0, this.Bl = L[3] | 0, this.Ch = L[4] | 0, this.Cl = L[5] | 0, this.Dh = L[6] | 0, this.Dl = L[7] | 0, this.Eh = L[8] | 0, this.El = L[9] | 0, this.Fh = L[10] | 0, this.Fl = L[11] | 0, this.Gh = L[12] | 0, this.Gl = L[13] | 0, this.Hh = L[14] | 0, this.Hl = L[15] | 0;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
return W.SHA512_256 = R, W.sha256 = (0, s.createHasher)(() => new n()), W.sha224 = (0, s.createHasher)(() => new i()), W.sha512 = (0, s.createHasher)(() => new y()), W.sha384 = (0, s.createHasher)(() => new p()), W.sha512_256 = (0, s.createHasher)(() => new R()), W.sha512_224 = (0, s.createHasher)(() => new C()), W;
|
|
1303
|
+
}
|
|
1304
|
+
var Zt = {}, Se;
|
|
1305
|
+
function dn() {
|
|
1306
|
+
return Se || (Se = 1, (function(t) {
|
|
1307
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
|
|
1308
|
+
const e = /* @__PURE__ */ oe();
|
|
1309
|
+
class s extends e.Hash {
|
|
1310
|
+
constructor(n, i) {
|
|
1311
|
+
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(n);
|
|
1312
|
+
const h = (0, e.toBytes)(i);
|
|
1313
|
+
if (this.iHash = n.create(), typeof this.iHash.update != "function")
|
|
1314
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1315
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1316
|
+
const f = this.blockLen, u = new Uint8Array(f);
|
|
1317
|
+
u.set(h.length > f ? n.create().update(h).digest() : h);
|
|
1318
|
+
for (let l = 0; l < u.length; l++)
|
|
1319
|
+
u[l] ^= 54;
|
|
1320
|
+
this.iHash.update(u), this.oHash = n.create();
|
|
1321
|
+
for (let l = 0; l < u.length; l++)
|
|
1322
|
+
u[l] ^= 106;
|
|
1323
|
+
this.oHash.update(u), (0, e.clean)(u);
|
|
1324
|
+
}
|
|
1325
|
+
update(n) {
|
|
1326
|
+
return (0, e.aexists)(this), this.iHash.update(n), this;
|
|
1327
|
+
}
|
|
1328
|
+
digestInto(n) {
|
|
1329
|
+
(0, e.aexists)(this), (0, e.abytes)(n, this.outputLen), this.finished = !0, this.iHash.digestInto(n), this.oHash.update(n), this.oHash.digestInto(n), this.destroy();
|
|
1330
|
+
}
|
|
1331
|
+
digest() {
|
|
1332
|
+
const n = new Uint8Array(this.oHash.outputLen);
|
|
1333
|
+
return this.digestInto(n), n;
|
|
1334
|
+
}
|
|
1335
|
+
_cloneInto(n) {
|
|
1336
|
+
n || (n = Object.create(Object.getPrototypeOf(this), {}));
|
|
1337
|
+
const { oHash: i, iHash: h, finished: f, destroyed: u, blockLen: l, outputLen: a } = this;
|
|
1338
|
+
return n = n, n.finished = f, n.destroyed = u, n.blockLen = l, n.outputLen = a, n.oHash = i._cloneInto(n.oHash), n.iHash = h._cloneInto(n.iHash), n;
|
|
1339
|
+
}
|
|
1340
|
+
clone() {
|
|
1341
|
+
return this._cloneInto();
|
|
1342
|
+
}
|
|
1343
|
+
destroy() {
|
|
1344
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
t.HMAC = s;
|
|
1348
|
+
const r = (c, n, i) => new s(c, n).update(i).digest();
|
|
1349
|
+
t.hmac = r, t.hmac.create = (c, n) => new s(c, n);
|
|
1350
|
+
})(Zt)), Zt;
|
|
1351
|
+
}
|
|
1352
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1353
|
+
function Y0(t) {
|
|
1354
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1355
|
+
}
|
|
1356
|
+
function Le(t) {
|
|
1357
|
+
if (!Number.isSafeInteger(t) || t < 0)
|
|
1358
|
+
throw new Error("positive integer expected, got " + t);
|
|
1359
|
+
}
|
|
1360
|
+
function Kt(t, ...e) {
|
|
1361
|
+
if (!Y0(t))
|
|
1362
|
+
throw new Error("Uint8Array expected");
|
|
1363
|
+
if (e.length > 0 && !e.includes(t.length))
|
|
1364
|
+
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
1365
|
+
}
|
|
1366
|
+
function Z0(t) {
|
|
1367
|
+
if (typeof t != "function" || typeof t.create != "function")
|
|
1368
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
1369
|
+
Le(t.outputLen), Le(t.blockLen);
|
|
1370
|
+
}
|
|
1371
|
+
function Wt(t, e = !0) {
|
|
1372
|
+
if (t.destroyed)
|
|
1373
|
+
throw new Error("Hash instance has been destroyed");
|
|
1374
|
+
if (e && t.finished)
|
|
1375
|
+
throw new Error("Hash#digest() has already been called");
|
|
1376
|
+
}
|
|
1377
|
+
function z0(t, e) {
|
|
1378
|
+
Kt(t);
|
|
1379
|
+
const s = e.outputLen;
|
|
1380
|
+
if (t.length < s)
|
|
1381
|
+
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
1382
|
+
}
|
|
1383
|
+
function yt(...t) {
|
|
1384
|
+
for (let e = 0; e < t.length; e++)
|
|
1385
|
+
t[e].fill(0);
|
|
1386
|
+
}
|
|
1387
|
+
function zt(t) {
|
|
1388
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
1389
|
+
}
|
|
1390
|
+
function et(t, e) {
|
|
1391
|
+
return t << 32 - e | t >>> e;
|
|
1392
|
+
}
|
|
1393
|
+
function Ot(t, e) {
|
|
1394
|
+
return t << e | t >>> 32 - e >>> 0;
|
|
1395
|
+
}
|
|
1396
|
+
function ts(t) {
|
|
1397
|
+
if (typeof t != "string")
|
|
1398
|
+
throw new Error("string expected");
|
|
1399
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
1400
|
+
}
|
|
1401
|
+
function he(t) {
|
|
1402
|
+
return typeof t == "string" && (t = ts(t)), Kt(t), t;
|
|
1403
|
+
}
|
|
1404
|
+
let Ye = class {
|
|
1405
|
+
};
|
|
1406
|
+
function ae(t) {
|
|
1407
|
+
const e = (r) => t().update(he(r)).digest(), s = t();
|
|
1408
|
+
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
1409
|
+
}
|
|
1410
|
+
let Ze = class extends Ye {
|
|
1411
|
+
constructor(e, s) {
|
|
1412
|
+
super(), this.finished = !1, this.destroyed = !1, Z0(e);
|
|
1413
|
+
const r = he(s);
|
|
1414
|
+
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
1415
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1416
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1417
|
+
const c = this.blockLen, n = new Uint8Array(c);
|
|
1418
|
+
n.set(r.length > c ? e.create().update(r).digest() : r);
|
|
1419
|
+
for (let i = 0; i < n.length; i++)
|
|
1420
|
+
n[i] ^= 54;
|
|
1421
|
+
this.iHash.update(n), this.oHash = e.create();
|
|
1422
|
+
for (let i = 0; i < n.length; i++)
|
|
1423
|
+
n[i] ^= 106;
|
|
1424
|
+
this.oHash.update(n), yt(n);
|
|
1425
|
+
}
|
|
1426
|
+
update(e) {
|
|
1427
|
+
return Wt(this), this.iHash.update(e), this;
|
|
1428
|
+
}
|
|
1429
|
+
digestInto(e) {
|
|
1430
|
+
Wt(this), Kt(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
1431
|
+
}
|
|
1432
|
+
digest() {
|
|
1433
|
+
const e = new Uint8Array(this.oHash.outputLen);
|
|
1434
|
+
return this.digestInto(e), e;
|
|
1435
|
+
}
|
|
1436
|
+
_cloneInto(e) {
|
|
1437
|
+
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
1438
|
+
const { oHash: s, iHash: r, finished: c, destroyed: n, blockLen: i, outputLen: h } = this;
|
|
1439
|
+
return e = e, e.finished = c, e.destroyed = n, e.blockLen = i, e.outputLen = h, e.oHash = s._cloneInto(e.oHash), e.iHash = r._cloneInto(e.iHash), e;
|
|
1440
|
+
}
|
|
1441
|
+
clone() {
|
|
1442
|
+
return this._cloneInto();
|
|
1443
|
+
}
|
|
1444
|
+
destroy() {
|
|
1445
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
const es = (t, e, s) => new Ze(t, e).update(s).digest();
|
|
1449
|
+
es.create = (t, e) => new Ze(t, e);
|
|
1450
|
+
function ss(t, e, s, r) {
|
|
1451
|
+
if (typeof t.setBigUint64 == "function")
|
|
1452
|
+
return t.setBigUint64(e, s, r);
|
|
1453
|
+
const c = BigInt(32), n = BigInt(4294967295), i = Number(s >> c & n), h = Number(s & n), f = r ? 4 : 0, u = r ? 0 : 4;
|
|
1454
|
+
t.setUint32(e + f, i, r), t.setUint32(e + u, h, r);
|
|
1455
|
+
}
|
|
1456
|
+
function ns(t, e, s) {
|
|
1457
|
+
return t & e ^ ~t & s;
|
|
1458
|
+
}
|
|
1459
|
+
function is(t, e, s) {
|
|
1460
|
+
return t & e ^ t & s ^ e & s;
|
|
1461
|
+
}
|
|
1462
|
+
let fe = class extends Ye {
|
|
1463
|
+
constructor(e, s, r, c) {
|
|
1464
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = r, this.isLE = c, this.buffer = new Uint8Array(e), this.view = zt(this.buffer);
|
|
1465
|
+
}
|
|
1466
|
+
update(e) {
|
|
1467
|
+
Wt(this), e = he(e), Kt(e);
|
|
1468
|
+
const { view: s, buffer: r, blockLen: c } = this, n = e.length;
|
|
1469
|
+
for (let i = 0; i < n; ) {
|
|
1470
|
+
const h = Math.min(c - this.pos, n - i);
|
|
1471
|
+
if (h === c) {
|
|
1472
|
+
const f = zt(e);
|
|
1473
|
+
for (; c <= n - i; i += c)
|
|
1474
|
+
this.process(f, i);
|
|
1475
|
+
continue;
|
|
1476
|
+
}
|
|
1477
|
+
r.set(e.subarray(i, i + h), this.pos), this.pos += h, i += h, this.pos === c && (this.process(s, 0), this.pos = 0);
|
|
1478
|
+
}
|
|
1479
|
+
return this.length += e.length, this.roundClean(), this;
|
|
1480
|
+
}
|
|
1481
|
+
digestInto(e) {
|
|
1482
|
+
Wt(this), z0(e, this), this.finished = !0;
|
|
1483
|
+
const { buffer: s, view: r, blockLen: c, isLE: n } = this;
|
|
1484
|
+
let { pos: i } = this;
|
|
1485
|
+
s[i++] = 128, yt(this.buffer.subarray(i)), this.padOffset > c - i && (this.process(r, 0), i = 0);
|
|
1486
|
+
for (let a = i; a < c; a++)
|
|
1487
|
+
s[a] = 0;
|
|
1488
|
+
ss(r, c - 8, BigInt(this.length * 8), n), this.process(r, 0);
|
|
1489
|
+
const h = zt(e), f = this.outputLen;
|
|
1490
|
+
if (f % 4)
|
|
1491
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
1492
|
+
const u = f / 4, l = this.get();
|
|
1493
|
+
if (u > l.length)
|
|
1494
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
1495
|
+
for (let a = 0; a < u; a++)
|
|
1496
|
+
h.setUint32(4 * a, l[a], n);
|
|
1497
|
+
}
|
|
1498
|
+
digest() {
|
|
1499
|
+
const { buffer: e, outputLen: s } = this;
|
|
1500
|
+
this.digestInto(e);
|
|
1501
|
+
const r = e.slice(0, s);
|
|
1502
|
+
return this.destroy(), r;
|
|
1503
|
+
}
|
|
1504
|
+
_cloneInto(e) {
|
|
1505
|
+
e || (e = new this.constructor()), e.set(...this.get());
|
|
1506
|
+
const { blockLen: s, buffer: r, length: c, finished: n, destroyed: i, pos: h } = this;
|
|
1507
|
+
return e.destroyed = i, e.finished = n, e.length = c, e.pos = h, c % s && e.buffer.set(r), e;
|
|
1508
|
+
}
|
|
1509
|
+
clone() {
|
|
1510
|
+
return this._cloneInto();
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
const lt = /* @__PURE__ */ Uint32Array.from([
|
|
1514
|
+
1779033703,
|
|
1515
|
+
3144134277,
|
|
1516
|
+
1013904242,
|
|
1517
|
+
2773480762,
|
|
1518
|
+
1359893119,
|
|
1519
|
+
2600822924,
|
|
1520
|
+
528734635,
|
|
1521
|
+
1541459225
|
|
1522
|
+
]), J = /* @__PURE__ */ Uint32Array.from([
|
|
1523
|
+
1779033703,
|
|
1524
|
+
4089235720,
|
|
1525
|
+
3144134277,
|
|
1526
|
+
2227873595,
|
|
1527
|
+
1013904242,
|
|
1528
|
+
4271175723,
|
|
1529
|
+
2773480762,
|
|
1530
|
+
1595750129,
|
|
1531
|
+
1359893119,
|
|
1532
|
+
2917565137,
|
|
1533
|
+
2600822924,
|
|
1534
|
+
725511199,
|
|
1535
|
+
528734635,
|
|
1536
|
+
4215389547,
|
|
1537
|
+
1541459225,
|
|
1538
|
+
327033209
|
|
1539
|
+
]), rs = /* @__PURE__ */ Uint8Array.from([
|
|
1540
|
+
7,
|
|
1541
|
+
4,
|
|
1542
|
+
13,
|
|
1543
|
+
1,
|
|
1544
|
+
10,
|
|
1545
|
+
6,
|
|
1546
|
+
15,
|
|
1547
|
+
3,
|
|
1548
|
+
12,
|
|
1549
|
+
0,
|
|
1550
|
+
9,
|
|
1551
|
+
5,
|
|
1552
|
+
2,
|
|
1553
|
+
14,
|
|
1554
|
+
11,
|
|
1555
|
+
8
|
|
1556
|
+
]), ze = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), cs = ze.map((t) => (9 * t + 5) % 16), t0 = /* @__PURE__ */ (() => {
|
|
1557
|
+
const s = [[ze], [cs]];
|
|
1558
|
+
for (let r = 0; r < 4; r++)
|
|
1559
|
+
for (let c of s)
|
|
1560
|
+
c.push(c[r].map((n) => rs[n]));
|
|
1561
|
+
return s;
|
|
1562
|
+
})(), e0 = t0[0], s0 = t0[1], n0 = /* @__PURE__ */ [
|
|
1563
|
+
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
1564
|
+
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
1565
|
+
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
1566
|
+
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
1567
|
+
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
1568
|
+
].map((t) => Uint8Array.from(t)), os = /* @__PURE__ */ e0.map((t, e) => t.map((s) => n0[e][s])), hs = /* @__PURE__ */ s0.map((t, e) => t.map((s) => n0[e][s])), as = /* @__PURE__ */ Uint32Array.from([
|
|
1569
|
+
0,
|
|
1570
|
+
1518500249,
|
|
1571
|
+
1859775393,
|
|
1572
|
+
2400959708,
|
|
1573
|
+
2840853838
|
|
1574
|
+
]), fs = /* @__PURE__ */ Uint32Array.from([
|
|
1575
|
+
1352829926,
|
|
1576
|
+
1548603684,
|
|
1577
|
+
1836072691,
|
|
1578
|
+
2053994217,
|
|
1579
|
+
0
|
|
1580
|
+
]);
|
|
1581
|
+
function Ie(t, e, s, r) {
|
|
1582
|
+
return t === 0 ? e ^ s ^ r : t === 1 ? e & s | ~e & r : t === 2 ? (e | ~s) ^ r : t === 3 ? e & r | s & ~r : e ^ (s | ~r);
|
|
1583
|
+
}
|
|
1584
|
+
const Mt = /* @__PURE__ */ new Uint32Array(16);
|
|
1585
|
+
class ds extends fe {
|
|
1586
|
+
constructor() {
|
|
1587
|
+
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
1588
|
+
}
|
|
1589
|
+
get() {
|
|
1590
|
+
const { h0: e, h1: s, h2: r, h3: c, h4: n } = this;
|
|
1591
|
+
return [e, s, r, c, n];
|
|
1592
|
+
}
|
|
1593
|
+
set(e, s, r, c, n) {
|
|
1594
|
+
this.h0 = e | 0, this.h1 = s | 0, this.h2 = r | 0, this.h3 = c | 0, this.h4 = n | 0;
|
|
1595
|
+
}
|
|
1596
|
+
process(e, s) {
|
|
1597
|
+
for (let p = 0; p < 16; p++, s += 4)
|
|
1598
|
+
Mt[p] = e.getUint32(s, !0);
|
|
1599
|
+
let r = this.h0 | 0, c = r, n = this.h1 | 0, i = n, h = this.h2 | 0, f = h, u = this.h3 | 0, l = u, a = this.h4 | 0, y = a;
|
|
1600
|
+
for (let p = 0; p < 5; p++) {
|
|
1601
|
+
const S = 4 - p, L = as[p], C = fs[p], R = e0[p], T = s0[p], w = os[p], k = hs[p];
|
|
1602
|
+
for (let A = 0; A < 16; A++) {
|
|
1603
|
+
const I = Ot(r + Ie(p, n, h, u) + Mt[R[A]] + L, w[A]) + a | 0;
|
|
1604
|
+
r = a, a = u, u = Ot(h, 10) | 0, h = n, n = I;
|
|
1605
|
+
}
|
|
1606
|
+
for (let A = 0; A < 16; A++) {
|
|
1607
|
+
const I = Ot(c + Ie(S, i, f, l) + Mt[T[A]] + C, k[A]) + y | 0;
|
|
1608
|
+
c = y, y = l, l = Ot(f, 10) | 0, f = i, i = I;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
this.set(this.h1 + h + l | 0, this.h2 + u + y | 0, this.h3 + a + c | 0, this.h4 + r + i | 0, this.h0 + n + f | 0);
|
|
1612
|
+
}
|
|
1613
|
+
roundClean() {
|
|
1614
|
+
yt(Mt);
|
|
1615
|
+
}
|
|
1616
|
+
destroy() {
|
|
1617
|
+
this.destroyed = !0, yt(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
const us = /* @__PURE__ */ ae(() => new ds()), xn = us, Gt = /* @__PURE__ */ BigInt(2 ** 32 - 1), Be = /* @__PURE__ */ BigInt(32);
|
|
1621
|
+
function ls(t, e = !1) {
|
|
1622
|
+
return e ? { h: Number(t & Gt), l: Number(t >> Be & Gt) } : { h: Number(t >> Be & Gt) | 0, l: Number(t & Gt) | 0 };
|
|
1623
|
+
}
|
|
1624
|
+
function bs(t, e = !1) {
|
|
1625
|
+
const s = t.length;
|
|
1626
|
+
let r = new Uint32Array(s), c = new Uint32Array(s);
|
|
1627
|
+
for (let n = 0; n < s; n++) {
|
|
1628
|
+
const { h: i, l: h } = ls(t[n], e);
|
|
1629
|
+
[r[n], c[n]] = [i, h];
|
|
1630
|
+
}
|
|
1631
|
+
return [r, c];
|
|
1632
|
+
}
|
|
1633
|
+
const me = (t, e, s) => t >>> s, Ue = (t, e, s) => t << 32 - s | e >>> s, St = (t, e, s) => t >>> s | e << 32 - s, Lt = (t, e, s) => t << 32 - s | e >>> s, vt = (t, e, s) => t << 64 - s | e >>> s - 32, jt = (t, e, s) => t >>> s - 32 | e << 64 - s;
|
|
1634
|
+
function rt(t, e, s, r) {
|
|
1635
|
+
const c = (e >>> 0) + (r >>> 0);
|
|
1636
|
+
return { h: t + s + (c / 2 ** 32 | 0) | 0, l: c | 0 };
|
|
1637
|
+
}
|
|
1638
|
+
const xs = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), Hs = (t, e, s, r) => e + s + r + (t / 2 ** 32 | 0) | 0, ps = (t, e, s, r) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (r >>> 0), As = (t, e, s, r, c) => e + s + r + c + (t / 2 ** 32 | 0) | 0, ys = (t, e, s, r, c) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (r >>> 0) + (c >>> 0), gs = (t, e, s, r, c, n) => e + s + r + c + n + (t / 2 ** 32 | 0) | 0, _s = /* @__PURE__ */ Uint32Array.from([
|
|
1639
|
+
1116352408,
|
|
1640
|
+
1899447441,
|
|
1641
|
+
3049323471,
|
|
1642
|
+
3921009573,
|
|
1643
|
+
961987163,
|
|
1644
|
+
1508970993,
|
|
1645
|
+
2453635748,
|
|
1646
|
+
2870763221,
|
|
1647
|
+
3624381080,
|
|
1648
|
+
310598401,
|
|
1649
|
+
607225278,
|
|
1650
|
+
1426881987,
|
|
1651
|
+
1925078388,
|
|
1652
|
+
2162078206,
|
|
1653
|
+
2614888103,
|
|
1654
|
+
3248222580,
|
|
1655
|
+
3835390401,
|
|
1656
|
+
4022224774,
|
|
1657
|
+
264347078,
|
|
1658
|
+
604807628,
|
|
1659
|
+
770255983,
|
|
1660
|
+
1249150122,
|
|
1661
|
+
1555081692,
|
|
1662
|
+
1996064986,
|
|
1663
|
+
2554220882,
|
|
1664
|
+
2821834349,
|
|
1665
|
+
2952996808,
|
|
1666
|
+
3210313671,
|
|
1667
|
+
3336571891,
|
|
1668
|
+
3584528711,
|
|
1669
|
+
113926993,
|
|
1670
|
+
338241895,
|
|
1671
|
+
666307205,
|
|
1672
|
+
773529912,
|
|
1673
|
+
1294757372,
|
|
1674
|
+
1396182291,
|
|
1675
|
+
1695183700,
|
|
1676
|
+
1986661051,
|
|
1677
|
+
2177026350,
|
|
1678
|
+
2456956037,
|
|
1679
|
+
2730485921,
|
|
1680
|
+
2820302411,
|
|
1681
|
+
3259730800,
|
|
1682
|
+
3345764771,
|
|
1683
|
+
3516065817,
|
|
1684
|
+
3600352804,
|
|
1685
|
+
4094571909,
|
|
1686
|
+
275423344,
|
|
1687
|
+
430227734,
|
|
1688
|
+
506948616,
|
|
1689
|
+
659060556,
|
|
1690
|
+
883997877,
|
|
1691
|
+
958139571,
|
|
1692
|
+
1322822218,
|
|
1693
|
+
1537002063,
|
|
1694
|
+
1747873779,
|
|
1695
|
+
1955562222,
|
|
1696
|
+
2024104815,
|
|
1697
|
+
2227730452,
|
|
1698
|
+
2361852424,
|
|
1699
|
+
2428436474,
|
|
1700
|
+
2756734187,
|
|
1701
|
+
3204031479,
|
|
1702
|
+
3329325298
|
|
1703
|
+
]), bt = /* @__PURE__ */ new Uint32Array(64);
|
|
1704
|
+
let ws = class extends fe {
|
|
1705
|
+
constructor(e = 32) {
|
|
1706
|
+
super(64, e, 8, !1), this.A = lt[0] | 0, this.B = lt[1] | 0, this.C = lt[2] | 0, this.D = lt[3] | 0, this.E = lt[4] | 0, this.F = lt[5] | 0, this.G = lt[6] | 0, this.H = lt[7] | 0;
|
|
1707
|
+
}
|
|
1708
|
+
get() {
|
|
1709
|
+
const { A: e, B: s, C: r, D: c, E: n, F: i, G: h, H: f } = this;
|
|
1710
|
+
return [e, s, r, c, n, i, h, f];
|
|
1711
|
+
}
|
|
1712
|
+
// prettier-ignore
|
|
1713
|
+
set(e, s, r, c, n, i, h, f) {
|
|
1714
|
+
this.A = e | 0, this.B = s | 0, this.C = r | 0, this.D = c | 0, this.E = n | 0, this.F = i | 0, this.G = h | 0, this.H = f | 0;
|
|
1715
|
+
}
|
|
1716
|
+
process(e, s) {
|
|
1717
|
+
for (let a = 0; a < 16; a++, s += 4)
|
|
1718
|
+
bt[a] = e.getUint32(s, !1);
|
|
1719
|
+
for (let a = 16; a < 64; a++) {
|
|
1720
|
+
const y = bt[a - 15], p = bt[a - 2], S = et(y, 7) ^ et(y, 18) ^ y >>> 3, L = et(p, 17) ^ et(p, 19) ^ p >>> 10;
|
|
1721
|
+
bt[a] = L + bt[a - 7] + S + bt[a - 16] | 0;
|
|
1722
|
+
}
|
|
1723
|
+
let { A: r, B: c, C: n, D: i, E: h, F: f, G: u, H: l } = this;
|
|
1724
|
+
for (let a = 0; a < 64; a++) {
|
|
1725
|
+
const y = et(h, 6) ^ et(h, 11) ^ et(h, 25), p = l + y + ns(h, f, u) + _s[a] + bt[a] | 0, L = (et(r, 2) ^ et(r, 13) ^ et(r, 22)) + is(r, c, n) | 0;
|
|
1726
|
+
l = u, u = f, f = h, h = i + p | 0, i = n, n = c, c = r, r = p + L | 0;
|
|
1727
|
+
}
|
|
1728
|
+
r = r + this.A | 0, c = c + this.B | 0, n = n + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, f = f + this.F | 0, u = u + this.G | 0, l = l + this.H | 0, this.set(r, c, n, i, h, f, u, l);
|
|
1729
|
+
}
|
|
1730
|
+
roundClean() {
|
|
1731
|
+
yt(bt);
|
|
1732
|
+
}
|
|
1733
|
+
destroy() {
|
|
1734
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), yt(this.buffer);
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
const i0 = bs([
|
|
1738
|
+
"0x428a2f98d728ae22",
|
|
1739
|
+
"0x7137449123ef65cd",
|
|
1740
|
+
"0xb5c0fbcfec4d3b2f",
|
|
1741
|
+
"0xe9b5dba58189dbbc",
|
|
1742
|
+
"0x3956c25bf348b538",
|
|
1743
|
+
"0x59f111f1b605d019",
|
|
1744
|
+
"0x923f82a4af194f9b",
|
|
1745
|
+
"0xab1c5ed5da6d8118",
|
|
1746
|
+
"0xd807aa98a3030242",
|
|
1747
|
+
"0x12835b0145706fbe",
|
|
1748
|
+
"0x243185be4ee4b28c",
|
|
1749
|
+
"0x550c7dc3d5ffb4e2",
|
|
1750
|
+
"0x72be5d74f27b896f",
|
|
1751
|
+
"0x80deb1fe3b1696b1",
|
|
1752
|
+
"0x9bdc06a725c71235",
|
|
1753
|
+
"0xc19bf174cf692694",
|
|
1754
|
+
"0xe49b69c19ef14ad2",
|
|
1755
|
+
"0xefbe4786384f25e3",
|
|
1756
|
+
"0x0fc19dc68b8cd5b5",
|
|
1757
|
+
"0x240ca1cc77ac9c65",
|
|
1758
|
+
"0x2de92c6f592b0275",
|
|
1759
|
+
"0x4a7484aa6ea6e483",
|
|
1760
|
+
"0x5cb0a9dcbd41fbd4",
|
|
1761
|
+
"0x76f988da831153b5",
|
|
1762
|
+
"0x983e5152ee66dfab",
|
|
1763
|
+
"0xa831c66d2db43210",
|
|
1764
|
+
"0xb00327c898fb213f",
|
|
1765
|
+
"0xbf597fc7beef0ee4",
|
|
1766
|
+
"0xc6e00bf33da88fc2",
|
|
1767
|
+
"0xd5a79147930aa725",
|
|
1768
|
+
"0x06ca6351e003826f",
|
|
1769
|
+
"0x142929670a0e6e70",
|
|
1770
|
+
"0x27b70a8546d22ffc",
|
|
1771
|
+
"0x2e1b21385c26c926",
|
|
1772
|
+
"0x4d2c6dfc5ac42aed",
|
|
1773
|
+
"0x53380d139d95b3df",
|
|
1774
|
+
"0x650a73548baf63de",
|
|
1775
|
+
"0x766a0abb3c77b2a8",
|
|
1776
|
+
"0x81c2c92e47edaee6",
|
|
1777
|
+
"0x92722c851482353b",
|
|
1778
|
+
"0xa2bfe8a14cf10364",
|
|
1779
|
+
"0xa81a664bbc423001",
|
|
1780
|
+
"0xc24b8b70d0f89791",
|
|
1781
|
+
"0xc76c51a30654be30",
|
|
1782
|
+
"0xd192e819d6ef5218",
|
|
1783
|
+
"0xd69906245565a910",
|
|
1784
|
+
"0xf40e35855771202a",
|
|
1785
|
+
"0x106aa07032bbd1b8",
|
|
1786
|
+
"0x19a4c116b8d2d0c8",
|
|
1787
|
+
"0x1e376c085141ab53",
|
|
1788
|
+
"0x2748774cdf8eeb99",
|
|
1789
|
+
"0x34b0bcb5e19b48a8",
|
|
1790
|
+
"0x391c0cb3c5c95a63",
|
|
1791
|
+
"0x4ed8aa4ae3418acb",
|
|
1792
|
+
"0x5b9cca4f7763e373",
|
|
1793
|
+
"0x682e6ff3d6b2b8a3",
|
|
1794
|
+
"0x748f82ee5defb2fc",
|
|
1795
|
+
"0x78a5636f43172f60",
|
|
1796
|
+
"0x84c87814a1f0ab72",
|
|
1797
|
+
"0x8cc702081a6439ec",
|
|
1798
|
+
"0x90befffa23631e28",
|
|
1799
|
+
"0xa4506cebde82bde9",
|
|
1800
|
+
"0xbef9a3f7b2c67915",
|
|
1801
|
+
"0xc67178f2e372532b",
|
|
1802
|
+
"0xca273eceea26619c",
|
|
1803
|
+
"0xd186b8c721c0c207",
|
|
1804
|
+
"0xeada7dd6cde0eb1e",
|
|
1805
|
+
"0xf57d4f7fee6ed178",
|
|
1806
|
+
"0x06f067aa72176fba",
|
|
1807
|
+
"0x0a637dc5a2c898a6",
|
|
1808
|
+
"0x113f9804bef90dae",
|
|
1809
|
+
"0x1b710b35131c471b",
|
|
1810
|
+
"0x28db77f523047d84",
|
|
1811
|
+
"0x32caab7b40c72493",
|
|
1812
|
+
"0x3c9ebe0a15c9bebc",
|
|
1813
|
+
"0x431d67c49c100d4c",
|
|
1814
|
+
"0x4cc5d4becb3e42b6",
|
|
1815
|
+
"0x597f299cfc657e2a",
|
|
1816
|
+
"0x5fcb6fab3ad6faec",
|
|
1817
|
+
"0x6c44198c4a475817"
|
|
1818
|
+
].map((t) => BigInt(t))), Ss = i0[0], Ls = i0[1], xt = /* @__PURE__ */ new Uint32Array(80), Ht = /* @__PURE__ */ new Uint32Array(80);
|
|
1819
|
+
class Is extends fe {
|
|
1820
|
+
constructor(e = 64) {
|
|
1821
|
+
super(128, e, 16, !1), this.Ah = J[0] | 0, this.Al = J[1] | 0, this.Bh = J[2] | 0, this.Bl = J[3] | 0, this.Ch = J[4] | 0, this.Cl = J[5] | 0, this.Dh = J[6] | 0, this.Dl = J[7] | 0, this.Eh = J[8] | 0, this.El = J[9] | 0, this.Fh = J[10] | 0, this.Fl = J[11] | 0, this.Gh = J[12] | 0, this.Gl = J[13] | 0, this.Hh = J[14] | 0, this.Hl = J[15] | 0;
|
|
1822
|
+
}
|
|
1823
|
+
// prettier-ignore
|
|
1824
|
+
get() {
|
|
1825
|
+
const { Ah: e, Al: s, Bh: r, Bl: c, Ch: n, Cl: i, Dh: h, Dl: f, Eh: u, El: l, Fh: a, Fl: y, Gh: p, Gl: S, Hh: L, Hl: C } = this;
|
|
1826
|
+
return [e, s, r, c, n, i, h, f, u, l, a, y, p, S, L, C];
|
|
1827
|
+
}
|
|
1828
|
+
// prettier-ignore
|
|
1829
|
+
set(e, s, r, c, n, i, h, f, u, l, a, y, p, S, L, C) {
|
|
1830
|
+
this.Ah = e | 0, this.Al = s | 0, this.Bh = r | 0, this.Bl = c | 0, this.Ch = n | 0, this.Cl = i | 0, this.Dh = h | 0, this.Dl = f | 0, this.Eh = u | 0, this.El = l | 0, this.Fh = a | 0, this.Fl = y | 0, this.Gh = p | 0, this.Gl = S | 0, this.Hh = L | 0, this.Hl = C | 0;
|
|
1831
|
+
}
|
|
1832
|
+
process(e, s) {
|
|
1833
|
+
for (let w = 0; w < 16; w++, s += 4)
|
|
1834
|
+
xt[w] = e.getUint32(s), Ht[w] = e.getUint32(s += 4);
|
|
1835
|
+
for (let w = 16; w < 80; w++) {
|
|
1836
|
+
const k = xt[w - 15] | 0, A = Ht[w - 15] | 0, I = St(k, A, 1) ^ St(k, A, 8) ^ me(k, A, 7), m = Lt(k, A, 1) ^ Lt(k, A, 8) ^ Ue(k, A, 7), E = xt[w - 2] | 0, d = Ht[w - 2] | 0, b = St(E, d, 19) ^ vt(E, d, 61) ^ me(E, d, 6), x = Lt(E, d, 19) ^ jt(E, d, 61) ^ Ue(E, d, 6), B = ps(m, x, Ht[w - 7], Ht[w - 16]), g = As(B, I, b, xt[w - 7], xt[w - 16]);
|
|
1837
|
+
xt[w] = g | 0, Ht[w] = B | 0;
|
|
1838
|
+
}
|
|
1839
|
+
let { Ah: r, Al: c, Bh: n, Bl: i, Ch: h, Cl: f, Dh: u, Dl: l, Eh: a, El: y, Fh: p, Fl: S, Gh: L, Gl: C, Hh: R, Hl: T } = this;
|
|
1840
|
+
for (let w = 0; w < 80; w++) {
|
|
1841
|
+
const k = St(a, y, 14) ^ St(a, y, 18) ^ vt(a, y, 41), A = Lt(a, y, 14) ^ Lt(a, y, 18) ^ jt(a, y, 41), I = a & p ^ ~a & L, m = y & S ^ ~y & C, E = ys(T, A, m, Ls[w], Ht[w]), d = gs(E, R, k, I, Ss[w], xt[w]), b = E | 0, x = St(r, c, 28) ^ vt(r, c, 34) ^ vt(r, c, 39), B = Lt(r, c, 28) ^ jt(r, c, 34) ^ jt(r, c, 39), g = r & n ^ r & h ^ n & h, U = c & i ^ c & f ^ i & f;
|
|
1842
|
+
R = L | 0, T = C | 0, L = p | 0, C = S | 0, p = a | 0, S = y | 0, { h: a, l: y } = rt(u | 0, l | 0, d | 0, b | 0), u = h | 0, l = f | 0, h = n | 0, f = i | 0, n = r | 0, i = c | 0;
|
|
1843
|
+
const F = xs(b, B, U);
|
|
1844
|
+
r = Hs(F, d, x, g), c = F | 0;
|
|
1845
|
+
}
|
|
1846
|
+
({ h: r, l: c } = rt(this.Ah | 0, this.Al | 0, r | 0, c | 0)), { h: n, l: i } = rt(this.Bh | 0, this.Bl | 0, n | 0, i | 0), { h, l: f } = rt(this.Ch | 0, this.Cl | 0, h | 0, f | 0), { h: u, l } = rt(this.Dh | 0, this.Dl | 0, u | 0, l | 0), { h: a, l: y } = rt(this.Eh | 0, this.El | 0, a | 0, y | 0), { h: p, l: S } = rt(this.Fh | 0, this.Fl | 0, p | 0, S | 0), { h: L, l: C } = rt(this.Gh | 0, this.Gl | 0, L | 0, C | 0), { h: R, l: T } = rt(this.Hh | 0, this.Hl | 0, R | 0, T | 0), this.set(r, c, n, i, h, f, u, l, a, y, p, S, L, C, R, T);
|
|
1847
|
+
}
|
|
1848
|
+
roundClean() {
|
|
1849
|
+
yt(xt, Ht);
|
|
1850
|
+
}
|
|
1851
|
+
destroy() {
|
|
1852
|
+
yt(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
const Bs = /* @__PURE__ */ ae(() => new ws()), ms = /* @__PURE__ */ ae(() => new Is()), pn = Bs, An = ms, Us = BigInt(0), Vt = BigInt(1), Es = BigInt(2), Vs = BigInt(7), ks = BigInt(256), Cs = BigInt(113), r0 = [], c0 = [], o0 = [];
|
|
1856
|
+
for (let t = 0, e = Vt, s = 1, r = 0; t < 24; t++) {
|
|
1857
|
+
[s, r] = [r, (2 * s + 3 * r) % 5], r0.push(2 * (5 * r + s)), c0.push((t + 1) * (t + 2) / 2 % 64);
|
|
1858
|
+
let c = Us;
|
|
1859
|
+
for (let n = 0; n < 7; n++)
|
|
1860
|
+
e = (e << Vt ^ (e >> Vs) * Cs) % ks, e & Es && (c ^= Vt << (Vt << BigInt(n)) - Vt);
|
|
1861
|
+
o0.push(c);
|
|
1862
|
+
}
|
|
1863
|
+
const h0 = j0(o0, !0), Ds = h0[0], Fs = h0[1], Ee = (t, e, s) => s > 32 ? P0(t, e, s) : R0(t, e, s), Ve = (t, e, s) => s > 32 ? N0(t, e, s) : W0(t, e, s);
|
|
1864
|
+
function Ts(t, e = 24) {
|
|
1865
|
+
const s = new Uint32Array(10);
|
|
1866
|
+
for (let r = 24 - e; r < 24; r++) {
|
|
1867
|
+
for (let i = 0; i < 10; i++)
|
|
1868
|
+
s[i] = t[i] ^ t[i + 10] ^ t[i + 20] ^ t[i + 30] ^ t[i + 40];
|
|
1869
|
+
for (let i = 0; i < 10; i += 2) {
|
|
1870
|
+
const h = (i + 8) % 10, f = (i + 2) % 10, u = s[f], l = s[f + 1], a = Ee(u, l, 1) ^ s[h], y = Ve(u, l, 1) ^ s[h + 1];
|
|
1871
|
+
for (let p = 0; p < 50; p += 10)
|
|
1872
|
+
t[i + p] ^= a, t[i + p + 1] ^= y;
|
|
1873
|
+
}
|
|
1874
|
+
let c = t[2], n = t[3];
|
|
1875
|
+
for (let i = 0; i < 24; i++) {
|
|
1876
|
+
const h = c0[i], f = Ee(c, n, h), u = Ve(c, n, h), l = r0[i];
|
|
1877
|
+
c = t[l], n = t[l + 1], t[l] = f, t[l + 1] = u;
|
|
1878
|
+
}
|
|
1879
|
+
for (let i = 0; i < 50; i += 10) {
|
|
1880
|
+
for (let h = 0; h < 10; h++)
|
|
1881
|
+
s[h] = t[i + h];
|
|
1882
|
+
for (let h = 0; h < 10; h++)
|
|
1883
|
+
t[i + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
1884
|
+
}
|
|
1885
|
+
t[0] ^= Ds[r], t[1] ^= Fs[r];
|
|
1886
|
+
}
|
|
1887
|
+
ot(s);
|
|
1888
|
+
}
|
|
1889
|
+
class de {
|
|
1890
|
+
state;
|
|
1891
|
+
pos = 0;
|
|
1892
|
+
posOut = 0;
|
|
1893
|
+
finished = !1;
|
|
1894
|
+
state32;
|
|
1895
|
+
destroyed = !1;
|
|
1896
|
+
blockLen;
|
|
1897
|
+
suffix;
|
|
1898
|
+
outputLen;
|
|
1899
|
+
enableXOF = !1;
|
|
1900
|
+
rounds;
|
|
1901
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1902
|
+
constructor(e, s, r, c = !1, n = 24) {
|
|
1903
|
+
if (this.blockLen = e, this.suffix = s, this.outputLen = r, this.enableXOF = c, this.rounds = n, be(r, "outputLen"), !(0 < e && e < 200))
|
|
1904
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
1905
|
+
this.state = new Uint8Array(200), this.state32 = m0(this.state);
|
|
1906
|
+
}
|
|
1907
|
+
clone() {
|
|
1908
|
+
return this._cloneInto();
|
|
1909
|
+
}
|
|
1910
|
+
keccak() {
|
|
1911
|
+
xe(this.state32), Ts(this.state32, this.rounds), xe(this.state32), this.posOut = 0, this.pos = 0;
|
|
1912
|
+
}
|
|
1913
|
+
update(e) {
|
|
1914
|
+
Rt(this), Dt(e);
|
|
1915
|
+
const { blockLen: s, state: r } = this, c = e.length;
|
|
1916
|
+
for (let n = 0; n < c; ) {
|
|
1917
|
+
const i = Math.min(s - this.pos, c - n);
|
|
1918
|
+
for (let h = 0; h < i; h++)
|
|
1919
|
+
r[this.pos++] ^= e[n++];
|
|
1920
|
+
this.pos === s && this.keccak();
|
|
1921
|
+
}
|
|
1922
|
+
return this;
|
|
1923
|
+
}
|
|
1924
|
+
finish() {
|
|
1925
|
+
if (this.finished)
|
|
1926
|
+
return;
|
|
1927
|
+
this.finished = !0;
|
|
1928
|
+
const { state: e, suffix: s, pos: r, blockLen: c } = this;
|
|
1929
|
+
e[r] ^= s, (s & 128) !== 0 && r === c - 1 && this.keccak(), e[c - 1] ^= 128, this.keccak();
|
|
1930
|
+
}
|
|
1931
|
+
writeInto(e) {
|
|
1932
|
+
Rt(this, !1), Dt(e), this.finish();
|
|
1933
|
+
const s = this.state, { blockLen: r } = this;
|
|
1934
|
+
for (let c = 0, n = e.length; c < n; ) {
|
|
1935
|
+
this.posOut >= r && this.keccak();
|
|
1936
|
+
const i = Math.min(r - this.posOut, n - c);
|
|
1937
|
+
e.set(s.subarray(this.posOut, this.posOut + i), c), this.posOut += i, c += i;
|
|
1938
|
+
}
|
|
1939
|
+
return e;
|
|
1940
|
+
}
|
|
1941
|
+
xofInto(e) {
|
|
1942
|
+
if (!this.enableXOF)
|
|
1943
|
+
throw new Error("XOF is not possible for this instance");
|
|
1944
|
+
return this.writeInto(e);
|
|
1945
|
+
}
|
|
1946
|
+
xof(e) {
|
|
1947
|
+
return be(e), this.xofInto(new Uint8Array(e));
|
|
1948
|
+
}
|
|
1949
|
+
digestInto(e) {
|
|
1950
|
+
if (Pe(e, this), this.finished)
|
|
1951
|
+
throw new Error("digest() was already called");
|
|
1952
|
+
return this.writeInto(e), this.destroy(), e;
|
|
1953
|
+
}
|
|
1954
|
+
digest() {
|
|
1955
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1956
|
+
}
|
|
1957
|
+
destroy() {
|
|
1958
|
+
this.destroyed = !0, ot(this.state);
|
|
1959
|
+
}
|
|
1960
|
+
_cloneInto(e) {
|
|
1961
|
+
const { blockLen: s, suffix: r, outputLen: c, rounds: n, enableXOF: i } = this;
|
|
1962
|
+
return e ||= new de(s, r, c, i, n), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = n, e.suffix = r, e.outputLen = c, e.enableXOF = i, e.destroyed = this.destroyed, e;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
const a0 = (t, e, s, r = {}) => qt((c = {}) => new de(e, t, c.dkLen === void 0 ? s : c.dkLen, !0), r), yn = /* @__PURE__ */ a0(31, 168, 16, /* @__PURE__ */ re(11)), gn = /* @__PURE__ */ a0(31, 136, 32, /* @__PURE__ */ re(12)), It = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
1966
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1967
|
+
function Os(t) {
|
|
1968
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1969
|
+
}
|
|
1970
|
+
function ke(t) {
|
|
1971
|
+
if (!Number.isSafeInteger(t) || t < 0)
|
|
1972
|
+
throw new Error("positive integer expected, got " + t);
|
|
1973
|
+
}
|
|
1974
|
+
function Bt(t, ...e) {
|
|
1975
|
+
if (!Os(t))
|
|
1976
|
+
throw new Error("Uint8Array expected");
|
|
1977
|
+
if (e.length > 0 && !e.includes(t.length))
|
|
1978
|
+
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
1979
|
+
}
|
|
1980
|
+
function Ms(t) {
|
|
1981
|
+
if (typeof t != "function" || typeof t.create != "function")
|
|
1982
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
1983
|
+
ke(t.outputLen), ke(t.blockLen);
|
|
1984
|
+
}
|
|
1985
|
+
function Pt(t, e = !0) {
|
|
1986
|
+
if (t.destroyed)
|
|
1987
|
+
throw new Error("Hash instance has been destroyed");
|
|
1988
|
+
if (e && t.finished)
|
|
1989
|
+
throw new Error("Hash#digest() has already been called");
|
|
1990
|
+
}
|
|
1991
|
+
function Gs(t, e) {
|
|
1992
|
+
Bt(t);
|
|
1993
|
+
const s = e.outputLen;
|
|
1994
|
+
if (t.length < s)
|
|
1995
|
+
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
1996
|
+
}
|
|
1997
|
+
function Nt(...t) {
|
|
1998
|
+
for (let e = 0; e < t.length; e++)
|
|
1999
|
+
t[e].fill(0);
|
|
2000
|
+
}
|
|
2001
|
+
function te(t) {
|
|
2002
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
2003
|
+
}
|
|
2004
|
+
function st(t, e) {
|
|
2005
|
+
return t << 32 - e | t >>> e;
|
|
2006
|
+
}
|
|
2007
|
+
const f0 = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", vs = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
2008
|
+
function _n(t) {
|
|
2009
|
+
if (Bt(t), f0)
|
|
2010
|
+
return t.toHex();
|
|
2011
|
+
let e = "";
|
|
2012
|
+
for (let s = 0; s < t.length; s++)
|
|
2013
|
+
e += vs[t[s]];
|
|
2014
|
+
return e;
|
|
2015
|
+
}
|
|
2016
|
+
const ct = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
2017
|
+
function Ce(t) {
|
|
2018
|
+
if (t >= ct._0 && t <= ct._9)
|
|
2019
|
+
return t - ct._0;
|
|
2020
|
+
if (t >= ct.A && t <= ct.F)
|
|
2021
|
+
return t - (ct.A - 10);
|
|
2022
|
+
if (t >= ct.a && t <= ct.f)
|
|
2023
|
+
return t - (ct.a - 10);
|
|
2024
|
+
}
|
|
2025
|
+
function wn(t) {
|
|
2026
|
+
if (typeof t != "string")
|
|
2027
|
+
throw new Error("hex string expected, got " + typeof t);
|
|
2028
|
+
if (f0)
|
|
2029
|
+
return Uint8Array.fromHex(t);
|
|
2030
|
+
const e = t.length, s = e / 2;
|
|
2031
|
+
if (e % 2)
|
|
2032
|
+
throw new Error("hex string expected, got unpadded hex of length " + e);
|
|
2033
|
+
const r = new Uint8Array(s);
|
|
2034
|
+
for (let c = 0, n = 0; c < s; c++, n += 2) {
|
|
2035
|
+
const i = Ce(t.charCodeAt(n)), h = Ce(t.charCodeAt(n + 1));
|
|
2036
|
+
if (i === void 0 || h === void 0) {
|
|
2037
|
+
const f = t[n] + t[n + 1];
|
|
2038
|
+
throw new Error('hex string expected, got non-hex character "' + f + '" at index ' + n);
|
|
2039
|
+
}
|
|
2040
|
+
r[c] = i * 16 + h;
|
|
2041
|
+
}
|
|
2042
|
+
return r;
|
|
2043
|
+
}
|
|
2044
|
+
function js(t) {
|
|
2045
|
+
if (typeof t != "string")
|
|
2046
|
+
throw new Error("string expected");
|
|
2047
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
2048
|
+
}
|
|
2049
|
+
function ue(t) {
|
|
2050
|
+
return typeof t == "string" && (t = js(t)), Bt(t), t;
|
|
2051
|
+
}
|
|
2052
|
+
function Sn(...t) {
|
|
2053
|
+
let e = 0;
|
|
2054
|
+
for (let r = 0; r < t.length; r++) {
|
|
2055
|
+
const c = t[r];
|
|
2056
|
+
Bt(c), e += c.length;
|
|
2057
|
+
}
|
|
2058
|
+
const s = new Uint8Array(e);
|
|
2059
|
+
for (let r = 0, c = 0; r < t.length; r++) {
|
|
2060
|
+
const n = t[r];
|
|
2061
|
+
s.set(n, c), c += n.length;
|
|
2062
|
+
}
|
|
2063
|
+
return s;
|
|
2064
|
+
}
|
|
2065
|
+
class d0 {
|
|
2066
|
+
}
|
|
2067
|
+
function Rs(t) {
|
|
2068
|
+
const e = (r) => t().update(ue(r)).digest(), s = t();
|
|
2069
|
+
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
2070
|
+
}
|
|
2071
|
+
function Ln(t = 32) {
|
|
2072
|
+
if (It && typeof It.getRandomValues == "function")
|
|
2073
|
+
return It.getRandomValues(new Uint8Array(t));
|
|
2074
|
+
if (It && typeof It.randomBytes == "function")
|
|
2075
|
+
return Uint8Array.from(It.randomBytes(t));
|
|
2076
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
2077
|
+
}
|
|
2078
|
+
function Ws(t, e, s, r) {
|
|
2079
|
+
if (typeof t.setBigUint64 == "function")
|
|
2080
|
+
return t.setBigUint64(e, s, r);
|
|
2081
|
+
const c = BigInt(32), n = BigInt(4294967295), i = Number(s >> c & n), h = Number(s & n), f = r ? 4 : 0, u = r ? 0 : 4;
|
|
2082
|
+
t.setUint32(e + f, i, r), t.setUint32(e + u, h, r);
|
|
2083
|
+
}
|
|
2084
|
+
function Ps(t, e, s) {
|
|
2085
|
+
return t & e ^ ~t & s;
|
|
2086
|
+
}
|
|
2087
|
+
function Ns(t, e, s) {
|
|
2088
|
+
return t & e ^ t & s ^ e & s;
|
|
2089
|
+
}
|
|
2090
|
+
class qs extends d0 {
|
|
2091
|
+
constructor(e, s, r, c) {
|
|
2092
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = r, this.isLE = c, this.buffer = new Uint8Array(e), this.view = te(this.buffer);
|
|
2093
|
+
}
|
|
2094
|
+
update(e) {
|
|
2095
|
+
Pt(this), e = ue(e), Bt(e);
|
|
2096
|
+
const { view: s, buffer: r, blockLen: c } = this, n = e.length;
|
|
2097
|
+
for (let i = 0; i < n; ) {
|
|
2098
|
+
const h = Math.min(c - this.pos, n - i);
|
|
2099
|
+
if (h === c) {
|
|
2100
|
+
const f = te(e);
|
|
2101
|
+
for (; c <= n - i; i += c)
|
|
2102
|
+
this.process(f, i);
|
|
2103
|
+
continue;
|
|
2104
|
+
}
|
|
2105
|
+
r.set(e.subarray(i, i + h), this.pos), this.pos += h, i += h, this.pos === c && (this.process(s, 0), this.pos = 0);
|
|
2106
|
+
}
|
|
2107
|
+
return this.length += e.length, this.roundClean(), this;
|
|
2108
|
+
}
|
|
2109
|
+
digestInto(e) {
|
|
2110
|
+
Pt(this), Gs(e, this), this.finished = !0;
|
|
2111
|
+
const { buffer: s, view: r, blockLen: c, isLE: n } = this;
|
|
2112
|
+
let { pos: i } = this;
|
|
2113
|
+
s[i++] = 128, Nt(this.buffer.subarray(i)), this.padOffset > c - i && (this.process(r, 0), i = 0);
|
|
2114
|
+
for (let a = i; a < c; a++)
|
|
2115
|
+
s[a] = 0;
|
|
2116
|
+
Ws(r, c - 8, BigInt(this.length * 8), n), this.process(r, 0);
|
|
2117
|
+
const h = te(e), f = this.outputLen;
|
|
2118
|
+
if (f % 4)
|
|
2119
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
2120
|
+
const u = f / 4, l = this.get();
|
|
2121
|
+
if (u > l.length)
|
|
2122
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
2123
|
+
for (let a = 0; a < u; a++)
|
|
2124
|
+
h.setUint32(4 * a, l[a], n);
|
|
2125
|
+
}
|
|
2126
|
+
digest() {
|
|
2127
|
+
const { buffer: e, outputLen: s } = this;
|
|
2128
|
+
this.digestInto(e);
|
|
2129
|
+
const r = e.slice(0, s);
|
|
2130
|
+
return this.destroy(), r;
|
|
2131
|
+
}
|
|
2132
|
+
_cloneInto(e) {
|
|
2133
|
+
e || (e = new this.constructor()), e.set(...this.get());
|
|
2134
|
+
const { blockLen: s, buffer: r, length: c, finished: n, destroyed: i, pos: h } = this;
|
|
2135
|
+
return e.destroyed = i, e.finished = n, e.length = c, e.pos = h, c % s && e.buffer.set(r), e;
|
|
2136
|
+
}
|
|
2137
|
+
clone() {
|
|
2138
|
+
return this._cloneInto();
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
const pt = /* @__PURE__ */ Uint32Array.from([
|
|
2142
|
+
1779033703,
|
|
2143
|
+
3144134277,
|
|
2144
|
+
1013904242,
|
|
2145
|
+
2773480762,
|
|
2146
|
+
1359893119,
|
|
2147
|
+
2600822924,
|
|
2148
|
+
528734635,
|
|
2149
|
+
1541459225
|
|
2150
|
+
]), Ks = /* @__PURE__ */ Uint32Array.from([
|
|
2151
|
+
1116352408,
|
|
2152
|
+
1899447441,
|
|
2153
|
+
3049323471,
|
|
2154
|
+
3921009573,
|
|
2155
|
+
961987163,
|
|
2156
|
+
1508970993,
|
|
2157
|
+
2453635748,
|
|
2158
|
+
2870763221,
|
|
2159
|
+
3624381080,
|
|
2160
|
+
310598401,
|
|
2161
|
+
607225278,
|
|
2162
|
+
1426881987,
|
|
2163
|
+
1925078388,
|
|
2164
|
+
2162078206,
|
|
2165
|
+
2614888103,
|
|
2166
|
+
3248222580,
|
|
2167
|
+
3835390401,
|
|
2168
|
+
4022224774,
|
|
2169
|
+
264347078,
|
|
2170
|
+
604807628,
|
|
2171
|
+
770255983,
|
|
2172
|
+
1249150122,
|
|
2173
|
+
1555081692,
|
|
2174
|
+
1996064986,
|
|
2175
|
+
2554220882,
|
|
2176
|
+
2821834349,
|
|
2177
|
+
2952996808,
|
|
2178
|
+
3210313671,
|
|
2179
|
+
3336571891,
|
|
2180
|
+
3584528711,
|
|
2181
|
+
113926993,
|
|
2182
|
+
338241895,
|
|
2183
|
+
666307205,
|
|
2184
|
+
773529912,
|
|
2185
|
+
1294757372,
|
|
2186
|
+
1396182291,
|
|
2187
|
+
1695183700,
|
|
2188
|
+
1986661051,
|
|
2189
|
+
2177026350,
|
|
2190
|
+
2456956037,
|
|
2191
|
+
2730485921,
|
|
2192
|
+
2820302411,
|
|
2193
|
+
3259730800,
|
|
2194
|
+
3345764771,
|
|
2195
|
+
3516065817,
|
|
2196
|
+
3600352804,
|
|
2197
|
+
4094571909,
|
|
2198
|
+
275423344,
|
|
2199
|
+
430227734,
|
|
2200
|
+
506948616,
|
|
2201
|
+
659060556,
|
|
2202
|
+
883997877,
|
|
2203
|
+
958139571,
|
|
2204
|
+
1322822218,
|
|
2205
|
+
1537002063,
|
|
2206
|
+
1747873779,
|
|
2207
|
+
1955562222,
|
|
2208
|
+
2024104815,
|
|
2209
|
+
2227730452,
|
|
2210
|
+
2361852424,
|
|
2211
|
+
2428436474,
|
|
2212
|
+
2756734187,
|
|
2213
|
+
3204031479,
|
|
2214
|
+
3329325298
|
|
2215
|
+
]), At = /* @__PURE__ */ new Uint32Array(64);
|
|
2216
|
+
class Xs extends qs {
|
|
2217
|
+
constructor(e = 32) {
|
|
2218
|
+
super(64, e, 8, !1), this.A = pt[0] | 0, this.B = pt[1] | 0, this.C = pt[2] | 0, this.D = pt[3] | 0, this.E = pt[4] | 0, this.F = pt[5] | 0, this.G = pt[6] | 0, this.H = pt[7] | 0;
|
|
2219
|
+
}
|
|
2220
|
+
get() {
|
|
2221
|
+
const { A: e, B: s, C: r, D: c, E: n, F: i, G: h, H: f } = this;
|
|
2222
|
+
return [e, s, r, c, n, i, h, f];
|
|
2223
|
+
}
|
|
2224
|
+
// prettier-ignore
|
|
2225
|
+
set(e, s, r, c, n, i, h, f) {
|
|
2226
|
+
this.A = e | 0, this.B = s | 0, this.C = r | 0, this.D = c | 0, this.E = n | 0, this.F = i | 0, this.G = h | 0, this.H = f | 0;
|
|
2227
|
+
}
|
|
2228
|
+
process(e, s) {
|
|
2229
|
+
for (let a = 0; a < 16; a++, s += 4)
|
|
2230
|
+
At[a] = e.getUint32(s, !1);
|
|
2231
|
+
for (let a = 16; a < 64; a++) {
|
|
2232
|
+
const y = At[a - 15], p = At[a - 2], S = st(y, 7) ^ st(y, 18) ^ y >>> 3, L = st(p, 17) ^ st(p, 19) ^ p >>> 10;
|
|
2233
|
+
At[a] = L + At[a - 7] + S + At[a - 16] | 0;
|
|
2234
|
+
}
|
|
2235
|
+
let { A: r, B: c, C: n, D: i, E: h, F: f, G: u, H: l } = this;
|
|
2236
|
+
for (let a = 0; a < 64; a++) {
|
|
2237
|
+
const y = st(h, 6) ^ st(h, 11) ^ st(h, 25), p = l + y + Ps(h, f, u) + Ks[a] + At[a] | 0, L = (st(r, 2) ^ st(r, 13) ^ st(r, 22)) + Ns(r, c, n) | 0;
|
|
2238
|
+
l = u, u = f, f = h, h = i + p | 0, i = n, n = c, c = r, r = p + L | 0;
|
|
2239
|
+
}
|
|
2240
|
+
r = r + this.A | 0, c = c + this.B | 0, n = n + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, f = f + this.F | 0, u = u + this.G | 0, l = l + this.H | 0, this.set(r, c, n, i, h, f, u, l);
|
|
2241
|
+
}
|
|
2242
|
+
roundClean() {
|
|
2243
|
+
Nt(At);
|
|
2244
|
+
}
|
|
2245
|
+
destroy() {
|
|
2246
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), Nt(this.buffer);
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
const In = /* @__PURE__ */ Rs(() => new Xs());
|
|
2250
|
+
class u0 extends d0 {
|
|
2251
|
+
constructor(e, s) {
|
|
2252
|
+
super(), this.finished = !1, this.destroyed = !1, Ms(e);
|
|
2253
|
+
const r = ue(s);
|
|
2254
|
+
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
2255
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
2256
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
2257
|
+
const c = this.blockLen, n = new Uint8Array(c);
|
|
2258
|
+
n.set(r.length > c ? e.create().update(r).digest() : r);
|
|
2259
|
+
for (let i = 0; i < n.length; i++)
|
|
2260
|
+
n[i] ^= 54;
|
|
2261
|
+
this.iHash.update(n), this.oHash = e.create();
|
|
2262
|
+
for (let i = 0; i < n.length; i++)
|
|
2263
|
+
n[i] ^= 106;
|
|
2264
|
+
this.oHash.update(n), Nt(n);
|
|
2265
|
+
}
|
|
2266
|
+
update(e) {
|
|
2267
|
+
return Pt(this), this.iHash.update(e), this;
|
|
2268
|
+
}
|
|
2269
|
+
digestInto(e) {
|
|
2270
|
+
Pt(this), Bt(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
2271
|
+
}
|
|
2272
|
+
digest() {
|
|
2273
|
+
const e = new Uint8Array(this.oHash.outputLen);
|
|
2274
|
+
return this.digestInto(e), e;
|
|
2275
|
+
}
|
|
2276
|
+
_cloneInto(e) {
|
|
2277
|
+
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
2278
|
+
const { oHash: s, iHash: r, finished: c, destroyed: n, blockLen: i, outputLen: h } = this;
|
|
2279
|
+
return e = e, e.finished = c, e.destroyed = n, e.blockLen = i, e.outputLen = h, e.oHash = s._cloneInto(e.oHash), e.iHash = r._cloneInto(e.iHash), e;
|
|
2280
|
+
}
|
|
2281
|
+
clone() {
|
|
2282
|
+
return this._cloneInto();
|
|
2283
|
+
}
|
|
2284
|
+
destroy() {
|
|
2285
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
const $s = (t, e, s) => new u0(t, e).update(s).digest();
|
|
2289
|
+
$s.create = (t, e) => new u0(t, e);
|
|
2290
|
+
var Z = {}, P = {}, Q = {}, ee = {}, kt = {}, De;
|
|
2291
|
+
function Js() {
|
|
2292
|
+
return De || (De = 1, Object.defineProperty(kt, "__esModule", { value: !0 }), kt.crypto = void 0, kt.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), kt;
|
|
2293
|
+
}
|
|
2294
|
+
var Fe;
|
|
2295
|
+
function Xt() {
|
|
2296
|
+
return Fe || (Fe = 1, (function(t) {
|
|
2297
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2298
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.wrapXOFConstructorWithOpts = t.wrapConstructorWithOpts = t.wrapConstructor = t.Hash = t.nextTick = t.swap32IfBE = t.byteSwapIfBE = t.swap8IfBE = t.isLE = void 0, t.isBytes = s, t.anumber = r, t.abytes = c, t.ahash = n, t.aexists = i, t.aoutput = h, t.u8 = f, t.u32 = u, t.clean = l, t.createView = a, t.rotr = y, t.rotl = p, t.byteSwap = S, t.byteSwap32 = L, t.bytesToHex = T, t.hexToBytes = A, t.asyncLoop = m, t.utf8ToBytes = E, t.bytesToUtf8 = d, t.toBytes = b, t.kdfInputToBytes = x, t.concatBytes = B, t.checkOpts = g, t.createHasher = F, t.createOptHasher = G, t.createXOFer = v, t.randomBytes = N;
|
|
2299
|
+
const e = /* @__PURE__ */ Js();
|
|
2300
|
+
function s(o) {
|
|
2301
|
+
return o instanceof Uint8Array || ArrayBuffer.isView(o) && o.constructor.name === "Uint8Array";
|
|
2302
|
+
}
|
|
2303
|
+
function r(o) {
|
|
2304
|
+
if (!Number.isSafeInteger(o) || o < 0)
|
|
2305
|
+
throw new Error("positive integer expected, got " + o);
|
|
2306
|
+
}
|
|
2307
|
+
function c(o, ...H) {
|
|
2308
|
+
if (!s(o))
|
|
2309
|
+
throw new Error("Uint8Array expected");
|
|
2310
|
+
if (H.length > 0 && !H.includes(o.length))
|
|
2311
|
+
throw new Error("Uint8Array expected of length " + H + ", got length=" + o.length);
|
|
2312
|
+
}
|
|
2313
|
+
function n(o) {
|
|
2314
|
+
if (typeof o != "function" || typeof o.create != "function")
|
|
2315
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
2316
|
+
r(o.outputLen), r(o.blockLen);
|
|
2317
|
+
}
|
|
2318
|
+
function i(o, H = !0) {
|
|
2319
|
+
if (o.destroyed)
|
|
2320
|
+
throw new Error("Hash instance has been destroyed");
|
|
2321
|
+
if (H && o.finished)
|
|
2322
|
+
throw new Error("Hash#digest() has already been called");
|
|
2323
|
+
}
|
|
2324
|
+
function h(o, H) {
|
|
2325
|
+
c(o);
|
|
2326
|
+
const _ = H.outputLen;
|
|
2327
|
+
if (o.length < _)
|
|
2328
|
+
throw new Error("digestInto() expects output buffer of length at least " + _);
|
|
2329
|
+
}
|
|
2330
|
+
function f(o) {
|
|
2331
|
+
return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
|
|
2332
|
+
}
|
|
2333
|
+
function u(o) {
|
|
2334
|
+
return new Uint32Array(o.buffer, o.byteOffset, Math.floor(o.byteLength / 4));
|
|
2335
|
+
}
|
|
2336
|
+
function l(...o) {
|
|
2337
|
+
for (let H = 0; H < o.length; H++)
|
|
2338
|
+
o[H].fill(0);
|
|
2339
|
+
}
|
|
2340
|
+
function a(o) {
|
|
2341
|
+
return new DataView(o.buffer, o.byteOffset, o.byteLength);
|
|
2342
|
+
}
|
|
2343
|
+
function y(o, H) {
|
|
2344
|
+
return o << 32 - H | o >>> H;
|
|
2345
|
+
}
|
|
2346
|
+
function p(o, H) {
|
|
2347
|
+
return o << H | o >>> 32 - H >>> 0;
|
|
2348
|
+
}
|
|
2349
|
+
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
2350
|
+
function S(o) {
|
|
2351
|
+
return o << 24 & 4278190080 | o << 8 & 16711680 | o >>> 8 & 65280 | o >>> 24 & 255;
|
|
2352
|
+
}
|
|
2353
|
+
t.swap8IfBE = t.isLE ? (o) => o : (o) => S(o), t.byteSwapIfBE = t.swap8IfBE;
|
|
2354
|
+
function L(o) {
|
|
2355
|
+
for (let H = 0; H < o.length; H++)
|
|
2356
|
+
o[H] = S(o[H]);
|
|
2357
|
+
return o;
|
|
2358
|
+
}
|
|
2359
|
+
t.swap32IfBE = t.isLE ? (o) => o : L;
|
|
2360
|
+
const C = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", R = /* @__PURE__ */ Array.from({ length: 256 }, (o, H) => H.toString(16).padStart(2, "0"));
|
|
2361
|
+
function T(o) {
|
|
2362
|
+
if (c(o), C)
|
|
2363
|
+
return o.toHex();
|
|
2364
|
+
let H = "";
|
|
2365
|
+
for (let _ = 0; _ < o.length; _++)
|
|
2366
|
+
H += R[o[_]];
|
|
2367
|
+
return H;
|
|
2368
|
+
}
|
|
2369
|
+
const w = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
2370
|
+
function k(o) {
|
|
2371
|
+
if (o >= w._0 && o <= w._9)
|
|
2372
|
+
return o - w._0;
|
|
2373
|
+
if (o >= w.A && o <= w.F)
|
|
2374
|
+
return o - (w.A - 10);
|
|
2375
|
+
if (o >= w.a && o <= w.f)
|
|
2376
|
+
return o - (w.a - 10);
|
|
2377
|
+
}
|
|
2378
|
+
function A(o) {
|
|
2379
|
+
if (typeof o != "string")
|
|
2380
|
+
throw new Error("hex string expected, got " + typeof o);
|
|
2381
|
+
if (C)
|
|
2382
|
+
return Uint8Array.fromHex(o);
|
|
2383
|
+
const H = o.length, _ = H / 2;
|
|
2384
|
+
if (H % 2)
|
|
2385
|
+
throw new Error("hex string expected, got unpadded hex of length " + H);
|
|
2386
|
+
const V = new Uint8Array(_);
|
|
2387
|
+
for (let D = 0, j = 0; D < _; D++, j += 2) {
|
|
2388
|
+
const Y = k(o.charCodeAt(j)), q = k(o.charCodeAt(j + 1));
|
|
2389
|
+
if (Y === void 0 || q === void 0) {
|
|
2390
|
+
const K = o[j] + o[j + 1];
|
|
2391
|
+
throw new Error('hex string expected, got non-hex character "' + K + '" at index ' + j);
|
|
2392
|
+
}
|
|
2393
|
+
V[D] = Y * 16 + q;
|
|
2394
|
+
}
|
|
2395
|
+
return V;
|
|
2396
|
+
}
|
|
2397
|
+
const I = async () => {
|
|
2398
|
+
};
|
|
2399
|
+
t.nextTick = I;
|
|
2400
|
+
async function m(o, H, _) {
|
|
2401
|
+
let V = Date.now();
|
|
2402
|
+
for (let D = 0; D < o; D++) {
|
|
2403
|
+
_(D);
|
|
2404
|
+
const j = Date.now() - V;
|
|
2405
|
+
j >= 0 && j < H || (await (0, t.nextTick)(), V += j);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
function E(o) {
|
|
2409
|
+
if (typeof o != "string")
|
|
2410
|
+
throw new Error("string expected");
|
|
2411
|
+
return new Uint8Array(new TextEncoder().encode(o));
|
|
2412
|
+
}
|
|
2413
|
+
function d(o) {
|
|
2414
|
+
return new TextDecoder().decode(o);
|
|
2415
|
+
}
|
|
2416
|
+
function b(o) {
|
|
2417
|
+
return typeof o == "string" && (o = E(o)), c(o), o;
|
|
2418
|
+
}
|
|
2419
|
+
function x(o) {
|
|
2420
|
+
return typeof o == "string" && (o = E(o)), c(o), o;
|
|
2421
|
+
}
|
|
2422
|
+
function B(...o) {
|
|
2423
|
+
let H = 0;
|
|
2424
|
+
for (let V = 0; V < o.length; V++) {
|
|
2425
|
+
const D = o[V];
|
|
2426
|
+
c(D), H += D.length;
|
|
2427
|
+
}
|
|
2428
|
+
const _ = new Uint8Array(H);
|
|
2429
|
+
for (let V = 0, D = 0; V < o.length; V++) {
|
|
2430
|
+
const j = o[V];
|
|
2431
|
+
_.set(j, D), D += j.length;
|
|
2432
|
+
}
|
|
2433
|
+
return _;
|
|
2434
|
+
}
|
|
2435
|
+
function g(o, H) {
|
|
2436
|
+
if (H !== void 0 && {}.toString.call(H) !== "[object Object]")
|
|
2437
|
+
throw new Error("options should be object or undefined");
|
|
2438
|
+
return Object.assign(o, H);
|
|
2439
|
+
}
|
|
2440
|
+
class U {
|
|
2441
|
+
}
|
|
2442
|
+
t.Hash = U;
|
|
2443
|
+
function F(o) {
|
|
2444
|
+
const H = (V) => o().update(b(V)).digest(), _ = o();
|
|
2445
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = () => o(), H;
|
|
2446
|
+
}
|
|
2447
|
+
function G(o) {
|
|
2448
|
+
const H = (V, D) => o(D).update(b(V)).digest(), _ = o({});
|
|
2449
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = (V) => o(V), H;
|
|
2450
|
+
}
|
|
2451
|
+
function v(o) {
|
|
2452
|
+
const H = (V, D) => o(D).update(b(V)).digest(), _ = o({});
|
|
2453
|
+
return H.outputLen = _.outputLen, H.blockLen = _.blockLen, H.create = (V) => o(V), H;
|
|
2454
|
+
}
|
|
2455
|
+
t.wrapConstructor = F, t.wrapConstructorWithOpts = G, t.wrapXOFConstructorWithOpts = v;
|
|
2456
|
+
function N(o = 32) {
|
|
2457
|
+
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
2458
|
+
return e.crypto.getRandomValues(new Uint8Array(o));
|
|
2459
|
+
if (e.crypto && typeof e.crypto.randomBytes == "function")
|
|
2460
|
+
return Uint8Array.from(e.crypto.randomBytes(o));
|
|
2461
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
2462
|
+
}
|
|
2463
|
+
})(ee)), ee;
|
|
2464
|
+
}
|
|
2465
|
+
var Te;
|
|
2466
|
+
function Qs() {
|
|
2467
|
+
if (Te) return Q;
|
|
2468
|
+
Te = 1, Object.defineProperty(Q, "__esModule", { value: !0 }), Q.SHA512_IV = Q.SHA384_IV = Q.SHA224_IV = Q.SHA256_IV = Q.HashMD = void 0, Q.setBigUint64 = e, Q.Chi = s, Q.Maj = r;
|
|
2469
|
+
const t = /* @__PURE__ */ Xt();
|
|
2470
|
+
function e(n, i, h, f) {
|
|
2471
|
+
if (typeof n.setBigUint64 == "function")
|
|
2472
|
+
return n.setBigUint64(i, h, f);
|
|
2473
|
+
const u = BigInt(32), l = BigInt(4294967295), a = Number(h >> u & l), y = Number(h & l), p = f ? 4 : 0, S = f ? 0 : 4;
|
|
2474
|
+
n.setUint32(i + p, a, f), n.setUint32(i + S, y, f);
|
|
2475
|
+
}
|
|
2476
|
+
function s(n, i, h) {
|
|
2477
|
+
return n & i ^ ~n & h;
|
|
2478
|
+
}
|
|
2479
|
+
function r(n, i, h) {
|
|
2480
|
+
return n & i ^ n & h ^ i & h;
|
|
2481
|
+
}
|
|
2482
|
+
class c extends t.Hash {
|
|
2483
|
+
constructor(i, h, f, u) {
|
|
2484
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = i, this.outputLen = h, this.padOffset = f, this.isLE = u, this.buffer = new Uint8Array(i), this.view = (0, t.createView)(this.buffer);
|
|
2485
|
+
}
|
|
2486
|
+
update(i) {
|
|
2487
|
+
(0, t.aexists)(this), i = (0, t.toBytes)(i), (0, t.abytes)(i);
|
|
2488
|
+
const { view: h, buffer: f, blockLen: u } = this, l = i.length;
|
|
2489
|
+
for (let a = 0; a < l; ) {
|
|
2490
|
+
const y = Math.min(u - this.pos, l - a);
|
|
2491
|
+
if (y === u) {
|
|
2492
|
+
const p = (0, t.createView)(i);
|
|
2493
|
+
for (; u <= l - a; a += u)
|
|
2494
|
+
this.process(p, a);
|
|
2495
|
+
continue;
|
|
2496
|
+
}
|
|
2497
|
+
f.set(i.subarray(a, a + y), this.pos), this.pos += y, a += y, this.pos === u && (this.process(h, 0), this.pos = 0);
|
|
2498
|
+
}
|
|
2499
|
+
return this.length += i.length, this.roundClean(), this;
|
|
2500
|
+
}
|
|
2501
|
+
digestInto(i) {
|
|
2502
|
+
(0, t.aexists)(this), (0, t.aoutput)(i, this), this.finished = !0;
|
|
2503
|
+
const { buffer: h, view: f, blockLen: u, isLE: l } = this;
|
|
2504
|
+
let { pos: a } = this;
|
|
2505
|
+
h[a++] = 128, (0, t.clean)(this.buffer.subarray(a)), this.padOffset > u - a && (this.process(f, 0), a = 0);
|
|
2506
|
+
for (let C = a; C < u; C++)
|
|
2507
|
+
h[C] = 0;
|
|
2508
|
+
e(f, u - 8, BigInt(this.length * 8), l), this.process(f, 0);
|
|
2509
|
+
const y = (0, t.createView)(i), p = this.outputLen;
|
|
2510
|
+
if (p % 4)
|
|
2511
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
2512
|
+
const S = p / 4, L = this.get();
|
|
2513
|
+
if (S > L.length)
|
|
2514
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
2515
|
+
for (let C = 0; C < S; C++)
|
|
2516
|
+
y.setUint32(4 * C, L[C], l);
|
|
2517
|
+
}
|
|
2518
|
+
digest() {
|
|
2519
|
+
const { buffer: i, outputLen: h } = this;
|
|
2520
|
+
this.digestInto(i);
|
|
2521
|
+
const f = i.slice(0, h);
|
|
2522
|
+
return this.destroy(), f;
|
|
2523
|
+
}
|
|
2524
|
+
_cloneInto(i) {
|
|
2525
|
+
i || (i = new this.constructor()), i.set(...this.get());
|
|
2526
|
+
const { blockLen: h, buffer: f, length: u, finished: l, destroyed: a, pos: y } = this;
|
|
2527
|
+
return i.destroyed = a, i.finished = l, i.length = u, i.pos = y, u % h && i.buffer.set(f), i;
|
|
2528
|
+
}
|
|
2529
|
+
clone() {
|
|
2530
|
+
return this._cloneInto();
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
return Q.HashMD = c, Q.SHA256_IV = Uint32Array.from([
|
|
2534
|
+
1779033703,
|
|
2535
|
+
3144134277,
|
|
2536
|
+
1013904242,
|
|
2537
|
+
2773480762,
|
|
2538
|
+
1359893119,
|
|
2539
|
+
2600822924,
|
|
2540
|
+
528734635,
|
|
2541
|
+
1541459225
|
|
2542
|
+
]), Q.SHA224_IV = Uint32Array.from([
|
|
2543
|
+
3238371032,
|
|
2544
|
+
914150663,
|
|
2545
|
+
812702999,
|
|
2546
|
+
4144912697,
|
|
2547
|
+
4290775857,
|
|
2548
|
+
1750603025,
|
|
2549
|
+
1694076839,
|
|
2550
|
+
3204075428
|
|
2551
|
+
]), Q.SHA384_IV = Uint32Array.from([
|
|
2552
|
+
3418070365,
|
|
2553
|
+
3238371032,
|
|
2554
|
+
1654270250,
|
|
2555
|
+
914150663,
|
|
2556
|
+
2438529370,
|
|
2557
|
+
812702999,
|
|
2558
|
+
355462360,
|
|
2559
|
+
4144912697,
|
|
2560
|
+
1731405415,
|
|
2561
|
+
4290775857,
|
|
2562
|
+
2394180231,
|
|
2563
|
+
1750603025,
|
|
2564
|
+
3675008525,
|
|
2565
|
+
1694076839,
|
|
2566
|
+
1203062813,
|
|
2567
|
+
3204075428
|
|
2568
|
+
]), Q.SHA512_IV = Uint32Array.from([
|
|
2569
|
+
1779033703,
|
|
2570
|
+
4089235720,
|
|
2571
|
+
3144134277,
|
|
2572
|
+
2227873595,
|
|
2573
|
+
1013904242,
|
|
2574
|
+
4271175723,
|
|
2575
|
+
2773480762,
|
|
2576
|
+
1595750129,
|
|
2577
|
+
1359893119,
|
|
2578
|
+
2917565137,
|
|
2579
|
+
2600822924,
|
|
2580
|
+
725511199,
|
|
2581
|
+
528734635,
|
|
2582
|
+
4215389547,
|
|
2583
|
+
1541459225,
|
|
2584
|
+
327033209
|
|
2585
|
+
]), Q;
|
|
2586
|
+
}
|
|
2587
|
+
var M = {}, Oe;
|
|
2588
|
+
function Ys() {
|
|
2589
|
+
if (Oe) return M;
|
|
2590
|
+
Oe = 1, Object.defineProperty(M, "__esModule", { value: !0 }), M.toBig = M.shrSL = M.shrSH = M.rotrSL = M.rotrSH = M.rotrBL = M.rotrBH = M.rotr32L = M.rotr32H = M.rotlSL = M.rotlSH = M.rotlBL = M.rotlBH = M.add5L = M.add5H = M.add4L = M.add4H = M.add3L = M.add3H = void 0, M.add = R, M.fromBig = s, M.split = r;
|
|
2591
|
+
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
2592
|
+
function s(d, b = !1) {
|
|
2593
|
+
return b ? { h: Number(d & t), l: Number(d >> e & t) } : { h: Number(d >> e & t) | 0, l: Number(d & t) | 0 };
|
|
2594
|
+
}
|
|
2595
|
+
function r(d, b = !1) {
|
|
2596
|
+
const x = d.length;
|
|
2597
|
+
let B = new Uint32Array(x), g = new Uint32Array(x);
|
|
2598
|
+
for (let U = 0; U < x; U++) {
|
|
2599
|
+
const { h: F, l: G } = s(d[U], b);
|
|
2600
|
+
[B[U], g[U]] = [F, G];
|
|
2601
|
+
}
|
|
2602
|
+
return [B, g];
|
|
2603
|
+
}
|
|
2604
|
+
const c = (d, b) => BigInt(d >>> 0) << e | BigInt(b >>> 0);
|
|
2605
|
+
M.toBig = c;
|
|
2606
|
+
const n = (d, b, x) => d >>> x;
|
|
2607
|
+
M.shrSH = n;
|
|
2608
|
+
const i = (d, b, x) => d << 32 - x | b >>> x;
|
|
2609
|
+
M.shrSL = i;
|
|
2610
|
+
const h = (d, b, x) => d >>> x | b << 32 - x;
|
|
2611
|
+
M.rotrSH = h;
|
|
2612
|
+
const f = (d, b, x) => d << 32 - x | b >>> x;
|
|
2613
|
+
M.rotrSL = f;
|
|
2614
|
+
const u = (d, b, x) => d << 64 - x | b >>> x - 32;
|
|
2615
|
+
M.rotrBH = u;
|
|
2616
|
+
const l = (d, b, x) => d >>> x - 32 | b << 64 - x;
|
|
2617
|
+
M.rotrBL = l;
|
|
2618
|
+
const a = (d, b) => b;
|
|
2619
|
+
M.rotr32H = a;
|
|
2620
|
+
const y = (d, b) => d;
|
|
2621
|
+
M.rotr32L = y;
|
|
2622
|
+
const p = (d, b, x) => d << x | b >>> 32 - x;
|
|
2623
|
+
M.rotlSH = p;
|
|
2624
|
+
const S = (d, b, x) => b << x | d >>> 32 - x;
|
|
2625
|
+
M.rotlSL = S;
|
|
2626
|
+
const L = (d, b, x) => b << x - 32 | d >>> 64 - x;
|
|
2627
|
+
M.rotlBH = L;
|
|
2628
|
+
const C = (d, b, x) => d << x - 32 | b >>> 64 - x;
|
|
2629
|
+
M.rotlBL = C;
|
|
2630
|
+
function R(d, b, x, B) {
|
|
2631
|
+
const g = (b >>> 0) + (B >>> 0);
|
|
2632
|
+
return { h: d + x + (g / 2 ** 32 | 0) | 0, l: g | 0 };
|
|
2633
|
+
}
|
|
2634
|
+
const T = (d, b, x) => (d >>> 0) + (b >>> 0) + (x >>> 0);
|
|
2635
|
+
M.add3L = T;
|
|
2636
|
+
const w = (d, b, x, B) => b + x + B + (d / 2 ** 32 | 0) | 0;
|
|
2637
|
+
M.add3H = w;
|
|
2638
|
+
const k = (d, b, x, B) => (d >>> 0) + (b >>> 0) + (x >>> 0) + (B >>> 0);
|
|
2639
|
+
M.add4L = k;
|
|
2640
|
+
const A = (d, b, x, B, g) => b + x + B + g + (d / 2 ** 32 | 0) | 0;
|
|
2641
|
+
M.add4H = A;
|
|
2642
|
+
const I = (d, b, x, B, g) => (d >>> 0) + (b >>> 0) + (x >>> 0) + (B >>> 0) + (g >>> 0);
|
|
2643
|
+
M.add5L = I;
|
|
2644
|
+
const m = (d, b, x, B, g, U) => b + x + B + g + U + (d / 2 ** 32 | 0) | 0;
|
|
2645
|
+
M.add5H = m;
|
|
2646
|
+
const E = {
|
|
2647
|
+
fromBig: s,
|
|
2648
|
+
split: r,
|
|
2649
|
+
toBig: c,
|
|
2650
|
+
shrSH: n,
|
|
2651
|
+
shrSL: i,
|
|
2652
|
+
rotrSH: h,
|
|
2653
|
+
rotrSL: f,
|
|
2654
|
+
rotrBH: u,
|
|
2655
|
+
rotrBL: l,
|
|
2656
|
+
rotr32H: a,
|
|
2657
|
+
rotr32L: y,
|
|
2658
|
+
rotlSH: p,
|
|
2659
|
+
rotlSL: S,
|
|
2660
|
+
rotlBH: L,
|
|
2661
|
+
rotlBL: C,
|
|
2662
|
+
add: R,
|
|
2663
|
+
add3L: T,
|
|
2664
|
+
add3H: w,
|
|
2665
|
+
add4L: k,
|
|
2666
|
+
add4H: A,
|
|
2667
|
+
add5H: m,
|
|
2668
|
+
add5L: I
|
|
2669
|
+
};
|
|
2670
|
+
return M.default = E, M;
|
|
2671
|
+
}
|
|
2672
|
+
var Me;
|
|
2673
|
+
function l0() {
|
|
2674
|
+
if (Me) return P;
|
|
2675
|
+
Me = 1, Object.defineProperty(P, "__esModule", { value: !0 }), P.sha512_224 = P.sha512_256 = P.sha384 = P.sha512 = P.sha224 = P.sha256 = P.SHA512_256 = P.SHA512_224 = P.SHA384 = P.SHA512 = P.SHA224 = P.SHA256 = void 0;
|
|
2676
|
+
const t = /* @__PURE__ */ Qs(), e = /* @__PURE__ */ Ys(), s = /* @__PURE__ */ Xt(), r = /* @__PURE__ */ Uint32Array.from([
|
|
2677
|
+
1116352408,
|
|
2678
|
+
1899447441,
|
|
2679
|
+
3049323471,
|
|
2680
|
+
3921009573,
|
|
2681
|
+
961987163,
|
|
2682
|
+
1508970993,
|
|
2683
|
+
2453635748,
|
|
2684
|
+
2870763221,
|
|
2685
|
+
3624381080,
|
|
2686
|
+
310598401,
|
|
2687
|
+
607225278,
|
|
2688
|
+
1426881987,
|
|
2689
|
+
1925078388,
|
|
2690
|
+
2162078206,
|
|
2691
|
+
2614888103,
|
|
2692
|
+
3248222580,
|
|
2693
|
+
3835390401,
|
|
2694
|
+
4022224774,
|
|
2695
|
+
264347078,
|
|
2696
|
+
604807628,
|
|
2697
|
+
770255983,
|
|
2698
|
+
1249150122,
|
|
2699
|
+
1555081692,
|
|
2700
|
+
1996064986,
|
|
2701
|
+
2554220882,
|
|
2702
|
+
2821834349,
|
|
2703
|
+
2952996808,
|
|
2704
|
+
3210313671,
|
|
2705
|
+
3336571891,
|
|
2706
|
+
3584528711,
|
|
2707
|
+
113926993,
|
|
2708
|
+
338241895,
|
|
2709
|
+
666307205,
|
|
2710
|
+
773529912,
|
|
2711
|
+
1294757372,
|
|
2712
|
+
1396182291,
|
|
2713
|
+
1695183700,
|
|
2714
|
+
1986661051,
|
|
2715
|
+
2177026350,
|
|
2716
|
+
2456956037,
|
|
2717
|
+
2730485921,
|
|
2718
|
+
2820302411,
|
|
2719
|
+
3259730800,
|
|
2720
|
+
3345764771,
|
|
2721
|
+
3516065817,
|
|
2722
|
+
3600352804,
|
|
2723
|
+
4094571909,
|
|
2724
|
+
275423344,
|
|
2725
|
+
430227734,
|
|
2726
|
+
506948616,
|
|
2727
|
+
659060556,
|
|
2728
|
+
883997877,
|
|
2729
|
+
958139571,
|
|
2730
|
+
1322822218,
|
|
2731
|
+
1537002063,
|
|
2732
|
+
1747873779,
|
|
2733
|
+
1955562222,
|
|
2734
|
+
2024104815,
|
|
2735
|
+
2227730452,
|
|
2736
|
+
2361852424,
|
|
2737
|
+
2428436474,
|
|
2738
|
+
2756734187,
|
|
2739
|
+
3204031479,
|
|
2740
|
+
3329325298
|
|
2741
|
+
]), c = /* @__PURE__ */ new Uint32Array(64);
|
|
2742
|
+
class n extends t.HashMD {
|
|
2743
|
+
constructor(w = 32) {
|
|
2744
|
+
super(64, w, 8, !1), this.A = t.SHA256_IV[0] | 0, this.B = t.SHA256_IV[1] | 0, this.C = t.SHA256_IV[2] | 0, this.D = t.SHA256_IV[3] | 0, this.E = t.SHA256_IV[4] | 0, this.F = t.SHA256_IV[5] | 0, this.G = t.SHA256_IV[6] | 0, this.H = t.SHA256_IV[7] | 0;
|
|
2745
|
+
}
|
|
2746
|
+
get() {
|
|
2747
|
+
const { A: w, B: k, C: A, D: I, E: m, F: E, G: d, H: b } = this;
|
|
2748
|
+
return [w, k, A, I, m, E, d, b];
|
|
2749
|
+
}
|
|
2750
|
+
// prettier-ignore
|
|
2751
|
+
set(w, k, A, I, m, E, d, b) {
|
|
2752
|
+
this.A = w | 0, this.B = k | 0, this.C = A | 0, this.D = I | 0, this.E = m | 0, this.F = E | 0, this.G = d | 0, this.H = b | 0;
|
|
2753
|
+
}
|
|
2754
|
+
process(w, k) {
|
|
2755
|
+
for (let g = 0; g < 16; g++, k += 4)
|
|
2756
|
+
c[g] = w.getUint32(k, !1);
|
|
2757
|
+
for (let g = 16; g < 64; g++) {
|
|
2758
|
+
const U = c[g - 15], F = c[g - 2], G = (0, s.rotr)(U, 7) ^ (0, s.rotr)(U, 18) ^ U >>> 3, v = (0, s.rotr)(F, 17) ^ (0, s.rotr)(F, 19) ^ F >>> 10;
|
|
2759
|
+
c[g] = v + c[g - 7] + G + c[g - 16] | 0;
|
|
2760
|
+
}
|
|
2761
|
+
let { A, B: I, C: m, D: E, E: d, F: b, G: x, H: B } = this;
|
|
2762
|
+
for (let g = 0; g < 64; g++) {
|
|
2763
|
+
const U = (0, s.rotr)(d, 6) ^ (0, s.rotr)(d, 11) ^ (0, s.rotr)(d, 25), F = B + U + (0, t.Chi)(d, b, x) + r[g] + c[g] | 0, v = ((0, s.rotr)(A, 2) ^ (0, s.rotr)(A, 13) ^ (0, s.rotr)(A, 22)) + (0, t.Maj)(A, I, m) | 0;
|
|
2764
|
+
B = x, x = b, b = d, d = E + F | 0, E = m, m = I, I = A, A = F + v | 0;
|
|
2765
|
+
}
|
|
2766
|
+
A = A + this.A | 0, I = I + this.B | 0, m = m + this.C | 0, E = E + this.D | 0, d = d + this.E | 0, b = b + this.F | 0, x = x + this.G | 0, B = B + this.H | 0, this.set(A, I, m, E, d, b, x, B);
|
|
2767
|
+
}
|
|
2768
|
+
roundClean() {
|
|
2769
|
+
(0, s.clean)(c);
|
|
2770
|
+
}
|
|
2771
|
+
destroy() {
|
|
2772
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
P.SHA256 = n;
|
|
2776
|
+
class i extends n {
|
|
2777
|
+
constructor() {
|
|
2778
|
+
super(28), this.A = t.SHA224_IV[0] | 0, this.B = t.SHA224_IV[1] | 0, this.C = t.SHA224_IV[2] | 0, this.D = t.SHA224_IV[3] | 0, this.E = t.SHA224_IV[4] | 0, this.F = t.SHA224_IV[5] | 0, this.G = t.SHA224_IV[6] | 0, this.H = t.SHA224_IV[7] | 0;
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
P.SHA224 = i;
|
|
2782
|
+
const h = e.split([
|
|
2783
|
+
"0x428a2f98d728ae22",
|
|
2784
|
+
"0x7137449123ef65cd",
|
|
2785
|
+
"0xb5c0fbcfec4d3b2f",
|
|
2786
|
+
"0xe9b5dba58189dbbc",
|
|
2787
|
+
"0x3956c25bf348b538",
|
|
2788
|
+
"0x59f111f1b605d019",
|
|
2789
|
+
"0x923f82a4af194f9b",
|
|
2790
|
+
"0xab1c5ed5da6d8118",
|
|
2791
|
+
"0xd807aa98a3030242",
|
|
2792
|
+
"0x12835b0145706fbe",
|
|
2793
|
+
"0x243185be4ee4b28c",
|
|
2794
|
+
"0x550c7dc3d5ffb4e2",
|
|
2795
|
+
"0x72be5d74f27b896f",
|
|
2796
|
+
"0x80deb1fe3b1696b1",
|
|
2797
|
+
"0x9bdc06a725c71235",
|
|
2798
|
+
"0xc19bf174cf692694",
|
|
2799
|
+
"0xe49b69c19ef14ad2",
|
|
2800
|
+
"0xefbe4786384f25e3",
|
|
2801
|
+
"0x0fc19dc68b8cd5b5",
|
|
2802
|
+
"0x240ca1cc77ac9c65",
|
|
2803
|
+
"0x2de92c6f592b0275",
|
|
2804
|
+
"0x4a7484aa6ea6e483",
|
|
2805
|
+
"0x5cb0a9dcbd41fbd4",
|
|
2806
|
+
"0x76f988da831153b5",
|
|
2807
|
+
"0x983e5152ee66dfab",
|
|
2808
|
+
"0xa831c66d2db43210",
|
|
2809
|
+
"0xb00327c898fb213f",
|
|
2810
|
+
"0xbf597fc7beef0ee4",
|
|
2811
|
+
"0xc6e00bf33da88fc2",
|
|
2812
|
+
"0xd5a79147930aa725",
|
|
2813
|
+
"0x06ca6351e003826f",
|
|
2814
|
+
"0x142929670a0e6e70",
|
|
2815
|
+
"0x27b70a8546d22ffc",
|
|
2816
|
+
"0x2e1b21385c26c926",
|
|
2817
|
+
"0x4d2c6dfc5ac42aed",
|
|
2818
|
+
"0x53380d139d95b3df",
|
|
2819
|
+
"0x650a73548baf63de",
|
|
2820
|
+
"0x766a0abb3c77b2a8",
|
|
2821
|
+
"0x81c2c92e47edaee6",
|
|
2822
|
+
"0x92722c851482353b",
|
|
2823
|
+
"0xa2bfe8a14cf10364",
|
|
2824
|
+
"0xa81a664bbc423001",
|
|
2825
|
+
"0xc24b8b70d0f89791",
|
|
2826
|
+
"0xc76c51a30654be30",
|
|
2827
|
+
"0xd192e819d6ef5218",
|
|
2828
|
+
"0xd69906245565a910",
|
|
2829
|
+
"0xf40e35855771202a",
|
|
2830
|
+
"0x106aa07032bbd1b8",
|
|
2831
|
+
"0x19a4c116b8d2d0c8",
|
|
2832
|
+
"0x1e376c085141ab53",
|
|
2833
|
+
"0x2748774cdf8eeb99",
|
|
2834
|
+
"0x34b0bcb5e19b48a8",
|
|
2835
|
+
"0x391c0cb3c5c95a63",
|
|
2836
|
+
"0x4ed8aa4ae3418acb",
|
|
2837
|
+
"0x5b9cca4f7763e373",
|
|
2838
|
+
"0x682e6ff3d6b2b8a3",
|
|
2839
|
+
"0x748f82ee5defb2fc",
|
|
2840
|
+
"0x78a5636f43172f60",
|
|
2841
|
+
"0x84c87814a1f0ab72",
|
|
2842
|
+
"0x8cc702081a6439ec",
|
|
2843
|
+
"0x90befffa23631e28",
|
|
2844
|
+
"0xa4506cebde82bde9",
|
|
2845
|
+
"0xbef9a3f7b2c67915",
|
|
2846
|
+
"0xc67178f2e372532b",
|
|
2847
|
+
"0xca273eceea26619c",
|
|
2848
|
+
"0xd186b8c721c0c207",
|
|
2849
|
+
"0xeada7dd6cde0eb1e",
|
|
2850
|
+
"0xf57d4f7fee6ed178",
|
|
2851
|
+
"0x06f067aa72176fba",
|
|
2852
|
+
"0x0a637dc5a2c898a6",
|
|
2853
|
+
"0x113f9804bef90dae",
|
|
2854
|
+
"0x1b710b35131c471b",
|
|
2855
|
+
"0x28db77f523047d84",
|
|
2856
|
+
"0x32caab7b40c72493",
|
|
2857
|
+
"0x3c9ebe0a15c9bebc",
|
|
2858
|
+
"0x431d67c49c100d4c",
|
|
2859
|
+
"0x4cc5d4becb3e42b6",
|
|
2860
|
+
"0x597f299cfc657e2a",
|
|
2861
|
+
"0x5fcb6fab3ad6faec",
|
|
2862
|
+
"0x6c44198c4a475817"
|
|
2863
|
+
].map((T) => BigInt(T))), f = h[0], u = h[1], l = /* @__PURE__ */ new Uint32Array(80), a = /* @__PURE__ */ new Uint32Array(80);
|
|
2864
|
+
class y extends t.HashMD {
|
|
2865
|
+
constructor(w = 64) {
|
|
2866
|
+
super(128, w, 16, !1), this.Ah = t.SHA512_IV[0] | 0, this.Al = t.SHA512_IV[1] | 0, this.Bh = t.SHA512_IV[2] | 0, this.Bl = t.SHA512_IV[3] | 0, this.Ch = t.SHA512_IV[4] | 0, this.Cl = t.SHA512_IV[5] | 0, this.Dh = t.SHA512_IV[6] | 0, this.Dl = t.SHA512_IV[7] | 0, this.Eh = t.SHA512_IV[8] | 0, this.El = t.SHA512_IV[9] | 0, this.Fh = t.SHA512_IV[10] | 0, this.Fl = t.SHA512_IV[11] | 0, this.Gh = t.SHA512_IV[12] | 0, this.Gl = t.SHA512_IV[13] | 0, this.Hh = t.SHA512_IV[14] | 0, this.Hl = t.SHA512_IV[15] | 0;
|
|
2867
|
+
}
|
|
2868
|
+
// prettier-ignore
|
|
2869
|
+
get() {
|
|
2870
|
+
const { Ah: w, Al: k, Bh: A, Bl: I, Ch: m, Cl: E, Dh: d, Dl: b, Eh: x, El: B, Fh: g, Fl: U, Gh: F, Gl: G, Hh: v, Hl: N } = this;
|
|
2871
|
+
return [w, k, A, I, m, E, d, b, x, B, g, U, F, G, v, N];
|
|
2872
|
+
}
|
|
2873
|
+
// prettier-ignore
|
|
2874
|
+
set(w, k, A, I, m, E, d, b, x, B, g, U, F, G, v, N) {
|
|
2875
|
+
this.Ah = w | 0, this.Al = k | 0, this.Bh = A | 0, this.Bl = I | 0, this.Ch = m | 0, this.Cl = E | 0, this.Dh = d | 0, this.Dl = b | 0, this.Eh = x | 0, this.El = B | 0, this.Fh = g | 0, this.Fl = U | 0, this.Gh = F | 0, this.Gl = G | 0, this.Hh = v | 0, this.Hl = N | 0;
|
|
2876
|
+
}
|
|
2877
|
+
process(w, k) {
|
|
2878
|
+
for (let _ = 0; _ < 16; _++, k += 4)
|
|
2879
|
+
l[_] = w.getUint32(k), a[_] = w.getUint32(k += 4);
|
|
2880
|
+
for (let _ = 16; _ < 80; _++) {
|
|
2881
|
+
const V = l[_ - 15] | 0, D = a[_ - 15] | 0, j = e.rotrSH(V, D, 1) ^ e.rotrSH(V, D, 8) ^ e.shrSH(V, D, 7), Y = e.rotrSL(V, D, 1) ^ e.rotrSL(V, D, 8) ^ e.shrSL(V, D, 7), q = l[_ - 2] | 0, K = a[_ - 2] | 0, nt = e.rotrSH(q, K, 19) ^ e.rotrBH(q, K, 61) ^ e.shrSH(q, K, 6), gt = e.rotrSL(q, K, 19) ^ e.rotrBL(q, K, 61) ^ e.shrSL(q, K, 6), it = e.add4L(Y, gt, a[_ - 7], a[_ - 16]), _t = e.add4H(it, j, nt, l[_ - 7], l[_ - 16]);
|
|
2882
|
+
l[_] = _t | 0, a[_] = it | 0;
|
|
2883
|
+
}
|
|
2884
|
+
let { Ah: A, Al: I, Bh: m, Bl: E, Ch: d, Cl: b, Dh: x, Dl: B, Eh: g, El: U, Fh: F, Fl: G, Gh: v, Gl: N, Hh: o, Hl: H } = this;
|
|
2885
|
+
for (let _ = 0; _ < 80; _++) {
|
|
2886
|
+
const V = e.rotrSH(g, U, 14) ^ e.rotrSH(g, U, 18) ^ e.rotrBH(g, U, 41), D = e.rotrSL(g, U, 14) ^ e.rotrSL(g, U, 18) ^ e.rotrBL(g, U, 41), j = g & F ^ ~g & v, Y = U & G ^ ~U & N, q = e.add5L(H, D, Y, u[_], a[_]), K = e.add5H(q, o, V, j, f[_], l[_]), nt = q | 0, gt = e.rotrSH(A, I, 28) ^ e.rotrBH(A, I, 34) ^ e.rotrBH(A, I, 39), it = e.rotrSL(A, I, 28) ^ e.rotrBL(A, I, 34) ^ e.rotrBL(A, I, 39), _t = A & m ^ A & d ^ m & d, $t = I & E ^ I & b ^ E & b;
|
|
2887
|
+
o = v | 0, H = N | 0, v = F | 0, N = G | 0, F = g | 0, G = U | 0, { h: g, l: U } = e.add(x | 0, B | 0, K | 0, nt | 0), x = d | 0, B = b | 0, d = m | 0, b = E | 0, m = A | 0, E = I | 0;
|
|
2888
|
+
const mt = e.add3L(nt, it, $t);
|
|
2889
|
+
A = e.add3H(mt, K, gt, _t), I = mt | 0;
|
|
2890
|
+
}
|
|
2891
|
+
({ h: A, l: I } = e.add(this.Ah | 0, this.Al | 0, A | 0, I | 0)), { h: m, l: E } = e.add(this.Bh | 0, this.Bl | 0, m | 0, E | 0), { h: d, l: b } = e.add(this.Ch | 0, this.Cl | 0, d | 0, b | 0), { h: x, l: B } = e.add(this.Dh | 0, this.Dl | 0, x | 0, B | 0), { h: g, l: U } = e.add(this.Eh | 0, this.El | 0, g | 0, U | 0), { h: F, l: G } = e.add(this.Fh | 0, this.Fl | 0, F | 0, G | 0), { h: v, l: N } = e.add(this.Gh | 0, this.Gl | 0, v | 0, N | 0), { h: o, l: H } = e.add(this.Hh | 0, this.Hl | 0, o | 0, H | 0), this.set(A, I, m, E, d, b, x, B, g, U, F, G, v, N, o, H);
|
|
2892
|
+
}
|
|
2893
|
+
roundClean() {
|
|
2894
|
+
(0, s.clean)(l, a);
|
|
2895
|
+
}
|
|
2896
|
+
destroy() {
|
|
2897
|
+
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
P.SHA512 = y;
|
|
2901
|
+
class p extends y {
|
|
2902
|
+
constructor() {
|
|
2903
|
+
super(48), this.Ah = t.SHA384_IV[0] | 0, this.Al = t.SHA384_IV[1] | 0, this.Bh = t.SHA384_IV[2] | 0, this.Bl = t.SHA384_IV[3] | 0, this.Ch = t.SHA384_IV[4] | 0, this.Cl = t.SHA384_IV[5] | 0, this.Dh = t.SHA384_IV[6] | 0, this.Dl = t.SHA384_IV[7] | 0, this.Eh = t.SHA384_IV[8] | 0, this.El = t.SHA384_IV[9] | 0, this.Fh = t.SHA384_IV[10] | 0, this.Fl = t.SHA384_IV[11] | 0, this.Gh = t.SHA384_IV[12] | 0, this.Gl = t.SHA384_IV[13] | 0, this.Hh = t.SHA384_IV[14] | 0, this.Hl = t.SHA384_IV[15] | 0;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
P.SHA384 = p;
|
|
2907
|
+
const S = /* @__PURE__ */ Uint32Array.from([
|
|
2908
|
+
2352822216,
|
|
2909
|
+
424955298,
|
|
2910
|
+
1944164710,
|
|
2911
|
+
2312950998,
|
|
2912
|
+
502970286,
|
|
2913
|
+
855612546,
|
|
2914
|
+
1738396948,
|
|
2915
|
+
1479516111,
|
|
2916
|
+
258812777,
|
|
2917
|
+
2077511080,
|
|
2918
|
+
2011393907,
|
|
2919
|
+
79989058,
|
|
2920
|
+
1067287976,
|
|
2921
|
+
1780299464,
|
|
2922
|
+
286451373,
|
|
2923
|
+
2446758561
|
|
2924
|
+
]), L = /* @__PURE__ */ Uint32Array.from([
|
|
2925
|
+
573645204,
|
|
2926
|
+
4230739756,
|
|
2927
|
+
2673172387,
|
|
2928
|
+
3360449730,
|
|
2929
|
+
596883563,
|
|
2930
|
+
1867755857,
|
|
2931
|
+
2520282905,
|
|
2932
|
+
1497426621,
|
|
2933
|
+
2519219938,
|
|
2934
|
+
2827943907,
|
|
2935
|
+
3193839141,
|
|
2936
|
+
1401305490,
|
|
2937
|
+
721525244,
|
|
2938
|
+
746961066,
|
|
2939
|
+
246885852,
|
|
2940
|
+
2177182882
|
|
2941
|
+
]);
|
|
2942
|
+
class C extends y {
|
|
2943
|
+
constructor() {
|
|
2944
|
+
super(28), this.Ah = S[0] | 0, this.Al = S[1] | 0, this.Bh = S[2] | 0, this.Bl = S[3] | 0, this.Ch = S[4] | 0, this.Cl = S[5] | 0, this.Dh = S[6] | 0, this.Dl = S[7] | 0, this.Eh = S[8] | 0, this.El = S[9] | 0, this.Fh = S[10] | 0, this.Fl = S[11] | 0, this.Gh = S[12] | 0, this.Gl = S[13] | 0, this.Hh = S[14] | 0, this.Hl = S[15] | 0;
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
P.SHA512_224 = C;
|
|
2948
|
+
class R extends y {
|
|
2949
|
+
constructor() {
|
|
2950
|
+
super(32), this.Ah = L[0] | 0, this.Al = L[1] | 0, this.Bh = L[2] | 0, this.Bl = L[3] | 0, this.Ch = L[4] | 0, this.Cl = L[5] | 0, this.Dh = L[6] | 0, this.Dl = L[7] | 0, this.Eh = L[8] | 0, this.El = L[9] | 0, this.Fh = L[10] | 0, this.Fl = L[11] | 0, this.Gh = L[12] | 0, this.Gl = L[13] | 0, this.Hh = L[14] | 0, this.Hl = L[15] | 0;
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
return P.SHA512_256 = R, P.sha256 = (0, s.createHasher)(() => new n()), P.sha224 = (0, s.createHasher)(() => new i()), P.sha512 = (0, s.createHasher)(() => new y()), P.sha384 = (0, s.createHasher)(() => new p()), P.sha512_256 = (0, s.createHasher)(() => new R()), P.sha512_224 = (0, s.createHasher)(() => new C()), P;
|
|
2954
|
+
}
|
|
2955
|
+
var Ge;
|
|
2956
|
+
function Bn() {
|
|
2957
|
+
if (Ge) return Z;
|
|
2958
|
+
Ge = 1, Object.defineProperty(Z, "__esModule", { value: !0 }), Z.sha224 = Z.SHA224 = Z.sha256 = Z.SHA256 = void 0;
|
|
2959
|
+
const t = /* @__PURE__ */ l0();
|
|
2960
|
+
return Z.SHA256 = t.SHA256, Z.sha256 = t.sha256, Z.SHA224 = t.SHA224, Z.sha224 = t.sha224, Z;
|
|
2961
|
+
}
|
|
2962
|
+
var X = {}, ve;
|
|
2963
|
+
function mn() {
|
|
2964
|
+
if (ve) return X;
|
|
2965
|
+
ve = 1, Object.defineProperty(X, "__esModule", { value: !0 }), X.sha512_256 = X.SHA512_256 = X.sha512_224 = X.SHA512_224 = X.sha384 = X.SHA384 = X.sha512 = X.SHA512 = void 0;
|
|
2966
|
+
const t = /* @__PURE__ */ l0();
|
|
2967
|
+
return X.SHA512 = t.SHA512, X.sha512 = t.sha512, X.SHA384 = t.SHA384, X.sha384 = t.sha384, X.SHA512_224 = t.SHA512_224, X.sha512_224 = t.sha512_224, X.SHA512_256 = t.SHA512_256, X.sha512_256 = t.sha512_256, X;
|
|
2968
|
+
}
|
|
2969
|
+
var Ct = {}, se = {}, je;
|
|
2970
|
+
function Zs() {
|
|
2971
|
+
return je || (je = 1, (function(t) {
|
|
2972
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
|
|
2973
|
+
const e = /* @__PURE__ */ Xt();
|
|
2974
|
+
class s extends e.Hash {
|
|
2975
|
+
constructor(n, i) {
|
|
2976
|
+
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(n);
|
|
2977
|
+
const h = (0, e.toBytes)(i);
|
|
2978
|
+
if (this.iHash = n.create(), typeof this.iHash.update != "function")
|
|
2979
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
2980
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
2981
|
+
const f = this.blockLen, u = new Uint8Array(f);
|
|
2982
|
+
u.set(h.length > f ? n.create().update(h).digest() : h);
|
|
2983
|
+
for (let l = 0; l < u.length; l++)
|
|
2984
|
+
u[l] ^= 54;
|
|
2985
|
+
this.iHash.update(u), this.oHash = n.create();
|
|
2986
|
+
for (let l = 0; l < u.length; l++)
|
|
2987
|
+
u[l] ^= 106;
|
|
2988
|
+
this.oHash.update(u), (0, e.clean)(u);
|
|
2989
|
+
}
|
|
2990
|
+
update(n) {
|
|
2991
|
+
return (0, e.aexists)(this), this.iHash.update(n), this;
|
|
2992
|
+
}
|
|
2993
|
+
digestInto(n) {
|
|
2994
|
+
(0, e.aexists)(this), (0, e.abytes)(n, this.outputLen), this.finished = !0, this.iHash.digestInto(n), this.oHash.update(n), this.oHash.digestInto(n), this.destroy();
|
|
2995
|
+
}
|
|
2996
|
+
digest() {
|
|
2997
|
+
const n = new Uint8Array(this.oHash.outputLen);
|
|
2998
|
+
return this.digestInto(n), n;
|
|
2999
|
+
}
|
|
3000
|
+
_cloneInto(n) {
|
|
3001
|
+
n || (n = Object.create(Object.getPrototypeOf(this), {}));
|
|
3002
|
+
const { oHash: i, iHash: h, finished: f, destroyed: u, blockLen: l, outputLen: a } = this;
|
|
3003
|
+
return n = n, n.finished = f, n.destroyed = u, n.blockLen = l, n.outputLen = a, n.oHash = i._cloneInto(n.oHash), n.iHash = h._cloneInto(n.iHash), n;
|
|
3004
|
+
}
|
|
3005
|
+
clone() {
|
|
3006
|
+
return this._cloneInto();
|
|
3007
|
+
}
|
|
3008
|
+
destroy() {
|
|
3009
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
t.HMAC = s;
|
|
3013
|
+
const r = (c, n, i) => new s(c, n).update(i).digest();
|
|
3014
|
+
t.hmac = r, t.hmac.create = (c, n) => new s(c, n);
|
|
3015
|
+
})(se)), se;
|
|
3016
|
+
}
|
|
3017
|
+
var Re;
|
|
3018
|
+
function Un() {
|
|
3019
|
+
if (Re) return Ct;
|
|
3020
|
+
Re = 1, Object.defineProperty(Ct, "__esModule", { value: !0 }), Ct.pbkdf2 = c, Ct.pbkdf2Async = n;
|
|
3021
|
+
const t = /* @__PURE__ */ Zs(), e = /* @__PURE__ */ Xt();
|
|
3022
|
+
function s(i, h, f, u) {
|
|
3023
|
+
(0, e.ahash)(i);
|
|
3024
|
+
const l = (0, e.checkOpts)({ dkLen: 32, asyncTick: 10 }, u), { c: a, dkLen: y, asyncTick: p } = l;
|
|
3025
|
+
if ((0, e.anumber)(a), (0, e.anumber)(y), (0, e.anumber)(p), a < 1)
|
|
3026
|
+
throw new Error("iterations (c) should be >= 1");
|
|
3027
|
+
const S = (0, e.kdfInputToBytes)(h), L = (0, e.kdfInputToBytes)(f), C = new Uint8Array(y), R = t.hmac.create(i, S), T = R._cloneInto().update(L);
|
|
3028
|
+
return { c: a, dkLen: y, asyncTick: p, DK: C, PRF: R, PRFSalt: T };
|
|
3029
|
+
}
|
|
3030
|
+
function r(i, h, f, u, l) {
|
|
3031
|
+
return i.destroy(), h.destroy(), u && u.destroy(), (0, e.clean)(l), f;
|
|
3032
|
+
}
|
|
3033
|
+
function c(i, h, f, u) {
|
|
3034
|
+
const { c: l, dkLen: a, DK: y, PRF: p, PRFSalt: S } = s(i, h, f, u);
|
|
3035
|
+
let L;
|
|
3036
|
+
const C = new Uint8Array(4), R = (0, e.createView)(C), T = new Uint8Array(p.outputLen);
|
|
3037
|
+
for (let w = 1, k = 0; k < a; w++, k += p.outputLen) {
|
|
3038
|
+
const A = y.subarray(k, k + p.outputLen);
|
|
3039
|
+
R.setInt32(0, w, !1), (L = S._cloneInto(L)).update(C).digestInto(T), A.set(T.subarray(0, A.length));
|
|
3040
|
+
for (let I = 1; I < l; I++) {
|
|
3041
|
+
p._cloneInto(L).update(T).digestInto(T);
|
|
3042
|
+
for (let m = 0; m < A.length; m++)
|
|
3043
|
+
A[m] ^= T[m];
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
return r(p, S, y, L, T);
|
|
3047
|
+
}
|
|
3048
|
+
async function n(i, h, f, u) {
|
|
3049
|
+
const { c: l, dkLen: a, asyncTick: y, DK: p, PRF: S, PRFSalt: L } = s(i, h, f, u);
|
|
3050
|
+
let C;
|
|
3051
|
+
const R = new Uint8Array(4), T = (0, e.createView)(R), w = new Uint8Array(S.outputLen);
|
|
3052
|
+
for (let k = 1, A = 0; A < a; k++, A += S.outputLen) {
|
|
3053
|
+
const I = p.subarray(A, A + S.outputLen);
|
|
3054
|
+
T.setInt32(0, k, !1), (C = L._cloneInto(C)).update(R).digestInto(w), I.set(w.subarray(0, I.length)), await (0, e.asyncLoop)(l - 1, y, () => {
|
|
3055
|
+
S._cloneInto(C).update(w).digestInto(w);
|
|
3056
|
+
for (let m = 0; m < I.length; m++)
|
|
3057
|
+
I[m] ^= w[m];
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
return r(S, L, p, C, w);
|
|
3061
|
+
}
|
|
3062
|
+
return Ct;
|
|
3063
|
+
}
|
|
3064
|
+
export {
|
|
3065
|
+
gn as A,
|
|
3066
|
+
js as B,
|
|
3067
|
+
Un as C,
|
|
3068
|
+
mn as D,
|
|
3069
|
+
Bn as E,
|
|
3070
|
+
Xt as F,
|
|
3071
|
+
dn as a,
|
|
3072
|
+
fn as b,
|
|
3073
|
+
_n as c,
|
|
3074
|
+
Bt as d,
|
|
3075
|
+
Sn as e,
|
|
3076
|
+
ke as f,
|
|
3077
|
+
Ms as g,
|
|
3078
|
+
wn as h,
|
|
3079
|
+
Os as i,
|
|
3080
|
+
Ln as j,
|
|
3081
|
+
$s as k,
|
|
3082
|
+
sn as l,
|
|
3083
|
+
an as m,
|
|
3084
|
+
hn as n,
|
|
3085
|
+
on as o,
|
|
3086
|
+
es as p,
|
|
3087
|
+
xn as q,
|
|
3088
|
+
oe as r,
|
|
3089
|
+
In as s,
|
|
3090
|
+
pn as t,
|
|
3091
|
+
An as u,
|
|
3092
|
+
rn as v,
|
|
3093
|
+
Dt as w,
|
|
3094
|
+
nn as x,
|
|
3095
|
+
B0 as y,
|
|
3096
|
+
yn as z
|
|
3097
|
+
};
|