@btc-vision/transaction 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/browser/_version.d.ts +1 -1
  2. package/browser/btc-vision-bitcoin.js +5000 -8302
  3. package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +1 -1
  4. package/browser/index.js +4760 -8702
  5. package/browser/noble-curves.js +1842 -1010
  6. package/browser/noble-hashes.js +854 -1512
  7. package/browser/rolldown-runtime.js +27 -0
  8. package/browser/transaction/builders/DeploymentTransaction.d.ts.map +1 -1
  9. package/browser/transaction/builders/FundingTransaction.d.ts.map +1 -1
  10. package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -1
  11. package/browser/vendors.js +7359 -9101
  12. package/build/_version.d.ts +1 -1
  13. package/build/_version.js +1 -1
  14. package/build/generators/builders/HashCommitmentGenerator.d.ts.map +1 -1
  15. package/build/generators/builders/HashCommitmentGenerator.js.map +1 -1
  16. package/build/transaction/TransactionFactory.js +1 -1
  17. package/build/transaction/TransactionFactory.js.map +1 -1
  18. package/build/transaction/builders/DeploymentTransaction.d.ts.map +1 -1
  19. package/build/transaction/builders/DeploymentTransaction.js +1 -1
  20. package/build/transaction/builders/DeploymentTransaction.js.map +1 -1
  21. package/build/transaction/builders/FundingTransaction.d.ts.map +1 -1
  22. package/build/transaction/builders/FundingTransaction.js +30 -18
  23. package/build/transaction/builders/FundingTransaction.js.map +1 -1
  24. package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -1
  25. package/build/transaction/builders/SharedInteractionTransaction.js +1 -1
  26. package/build/transaction/builders/SharedInteractionTransaction.js.map +1 -1
  27. package/build/tsconfig.build.tsbuildinfo +1 -1
  28. package/package.json +15 -9
  29. package/src/_version.ts +1 -1
  30. package/src/generators/builders/HashCommitmentGenerator.ts +8 -0
  31. package/src/transaction/TransactionFactory.ts +1 -1
  32. package/src/transaction/builders/DeploymentTransaction.ts +1 -1
  33. package/src/transaction/builders/FundingTransaction.ts +32 -18
  34. package/src/transaction/builders/SharedInteractionTransaction.ts +1 -1
  35. package/test/split-fee-bug.test.ts +827 -0
@@ -1,1260 +1,604 @@
1
- function k0(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- function Mt(t) {
5
- if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
6
- var e = t.default;
7
- if (typeof e == "function") {
8
- var s = function i() {
9
- var n = !1;
10
- try {
11
- n = this instanceof i;
12
- } catch {
13
- }
14
- return n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
15
- };
16
- s.prototype = e.prototype;
17
- } else s = {};
18
- return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(t).forEach(function(i) {
19
- var n = Object.getOwnPropertyDescriptor(t, i);
20
- Object.defineProperty(s, i, n.get ? n : {
21
- enumerable: !0,
22
- get: function() {
23
- return t[i];
24
- }
25
- });
26
- }), s;
27
- }
28
- function Oe(t) {
29
- return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
30
- }
31
- function Ut(t, e = "") {
32
- if (!Number.isSafeInteger(t) || t < 0) {
33
- const s = e && `"${e}" `;
34
- throw new Error(`${s}expected integer >= 0, got ${t}`);
35
- }
36
- }
37
- function ft(t, e, s = "") {
38
- const i = Oe(t), n = t?.length, r = e !== void 0;
39
- if (!i || r && n !== e) {
40
- const c = s && `"${s}" `, o = r ? ` of length ${e}` : "", h = i ? `length=${n}` : `type=${typeof t}`;
41
- throw new Error(c + "expected Uint8Array" + o + ", got " + h);
42
- }
43
- return t;
44
- }
45
- function De(t) {
46
- if (typeof t != "function" || typeof t.create != "function")
47
- throw new Error("Hash must wrapped by utils.createHasher");
48
- Ut(t.outputLen), Ut(t.blockLen);
49
- }
50
- function Ht(t, e = !0) {
51
- if (t.destroyed)
52
- throw new Error("Hash instance has been destroyed");
53
- if (e && t.finished)
54
- throw new Error("Hash#digest() has already been called");
55
- }
56
- function ie(t, e) {
57
- ft(t, void 0, "digestInto() output");
58
- const s = e.outputLen;
59
- if (t.length < s)
60
- throw new Error('"digestInto() output" expected to be of length >=' + s);
61
- }
62
- function Fe(t) {
63
- return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
64
- }
65
- function J(...t) {
66
- for (let e = 0; e < t.length; e++)
67
- t[e].fill(0);
68
- }
69
- function Dt(t) {
70
- return new DataView(t.buffer, t.byteOffset, t.byteLength);
71
- }
72
- function $(t, e) {
73
- return t << 32 - e | t >>> e;
74
- }
75
- function ht(t, e) {
76
- return t << e | t >>> 32 - e >>> 0;
77
- }
78
- const Te = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
79
- function ve(t) {
80
- return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
81
- }
82
- function Me(t) {
83
- for (let e = 0; e < t.length; e++)
84
- t[e] = ve(t[e]);
85
- return t;
86
- }
87
- const Rt = Te ? (t) => t : Me, ce = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Ge = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
88
- function O0(t) {
89
- if (ft(t), ce)
90
- return t.toHex();
91
- let e = "";
92
- for (let s = 0; s < t.length; s++)
93
- e += Ge[t[s]];
94
- return e;
95
- }
96
- const et = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
97
- function Wt(t) {
98
- if (t >= et._0 && t <= et._9)
99
- return t - et._0;
100
- if (t >= et.A && t <= et.F)
101
- return t - (et.A - 10);
102
- if (t >= et.a && t <= et.f)
103
- return t - (et.a - 10);
104
- }
105
- function D0(t) {
106
- if (typeof t != "string")
107
- throw new Error("hex string expected, got " + typeof t);
108
- if (ce)
109
- return Uint8Array.fromHex(t);
110
- const e = t.length, s = e / 2;
111
- if (e % 2)
112
- throw new Error("hex string expected, got unpadded hex of length " + e);
113
- const i = new Uint8Array(s);
114
- for (let n = 0, r = 0; n < s; n++, r += 2) {
115
- const c = Wt(t.charCodeAt(r)), o = Wt(t.charCodeAt(r + 1));
116
- if (c === void 0 || o === void 0) {
117
- const h = t[r] + t[r + 1];
118
- throw new Error('hex string expected, got non-hex character "' + h + '" at index ' + r);
119
- }
120
- i[n] = c * 16 + o;
121
- }
122
- return i;
123
- }
124
- function F0(...t) {
125
- let e = 0;
126
- for (let i = 0; i < t.length; i++) {
127
- const n = t[i];
128
- ft(n), e += n.length;
129
- }
130
- const s = new Uint8Array(e);
131
- for (let i = 0, n = 0; i < t.length; i++) {
132
- const r = t[i];
133
- s.set(r, n), n += r.length;
134
- }
135
- return s;
136
- }
137
- function tt(t, e = {}) {
138
- const s = (n, r) => t(r).update(n).digest(), i = t(void 0);
139
- return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (n) => t(n), Object.assign(s, e), Object.freeze(s);
140
- }
141
- function T0(t = 32) {
142
- const e = typeof globalThis == "object" ? globalThis.crypto : null;
143
- if (typeof e?.getRandomValues != "function")
144
- throw new Error("crypto.getRandomValues must be defined");
145
- return e.getRandomValues(new Uint8Array(t));
146
- }
147
- const dt = (t) => ({
148
- oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
1
+ import { n as Wt, r as xt, t as X } from "./rolldown-runtime.js";
2
+ import { D as wt, E as Lt, I as q, L as Bt, M as Kt, O as te, P as vt, R as ee, S as se, T as mt, _ as ie, b as nt, g as ne, h as re, j as et, k as N, m as he, p as ae, v as oe, x as ce, y as rt } from "./noble-curves.js";
3
+ var Se = /* @__PURE__ */ xt({
4
+ _MD5: () => bt,
5
+ _RIPEMD160: () => At,
6
+ _SHA1: () => Ht,
7
+ md5: () => qt,
8
+ ripemd160: () => Nt,
9
+ sha1: () => Xt
149
10
  });
150
- class Gt {
151
- oHash;
152
- iHash;
153
- blockLen;
154
- outputLen;
155
- finished = !1;
156
- destroyed = !1;
157
- constructor(e, s) {
158
- if (De(e), ft(s, void 0, "key"), this.iHash = e.create(), typeof this.iHash.update != "function")
159
- throw new Error("Expected instance of class which extends utils.Hash");
160
- this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
161
- const i = this.blockLen, n = new Uint8Array(i);
162
- n.set(s.length > i ? e.create().update(s).digest() : s);
163
- for (let r = 0; r < n.length; r++)
164
- n[r] ^= 54;
165
- this.iHash.update(n), this.oHash = e.create();
166
- for (let r = 0; r < n.length; r++)
167
- n[r] ^= 106;
168
- this.oHash.update(n), J(n);
169
- }
170
- update(e) {
171
- return Ht(this), this.iHash.update(e), this;
172
- }
173
- digestInto(e) {
174
- Ht(this), ft(e, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
175
- }
176
- digest() {
177
- const e = new Uint8Array(this.oHash.outputLen);
178
- return this.digestInto(e), e;
179
- }
180
- _cloneInto(e) {
181
- e ||= Object.create(Object.getPrototypeOf(this), {});
182
- const { oHash: s, iHash: i, finished: n, destroyed: r, blockLen: c, outputLen: o } = this;
183
- return e = e, e.finished = n, e.destroyed = r, e.blockLen = c, e.outputLen = o, e.oHash = s._cloneInto(e.oHash), e.iHash = i._cloneInto(e.iHash), e;
184
- }
185
- clone() {
186
- return this._cloneInto();
187
- }
188
- destroy() {
189
- this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
190
- }
191
- }
192
- const oe = (t, e, s) => new Gt(t, e).update(s).digest();
193
- oe.create = (t, e) => new Gt(t, e);
194
- const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
195
- __proto__: null,
196
- _HMAC: Gt,
197
- hmac: oe
198
- }, Symbol.toStringTag, { value: "Module" })), v0 = /* @__PURE__ */ Mt(je);
199
- function Et(t, e, s) {
200
- return t & e ^ ~t & s;
201
- }
202
- function ae(t, e, s) {
203
- return t & e ^ t & s ^ e & s;
11
+ function pt(t, e, s, h) {
12
+ return t === 0 ? e ^ s ^ h : t === 1 ? e & s | ~e & h : t === 2 ? (e | ~s) ^ h : t === 3 ? e & h | s & ~h : e ^ (s | ~h);
204
13
  }
205
- class _t {
206
- blockLen;
207
- outputLen;
208
- padOffset;
209
- isLE;
210
- // For partial updates less than block size
211
- buffer;
212
- view;
213
- finished = !1;
214
- length = 0;
215
- pos = 0;
216
- destroyed = !1;
217
- constructor(e, s, i, n) {
218
- this.blockLen = e, this.outputLen = s, this.padOffset = i, this.isLE = n, this.buffer = new Uint8Array(e), this.view = Dt(this.buffer);
219
- }
220
- update(e) {
221
- Ht(this), ft(e);
222
- const { view: s, buffer: i, blockLen: n } = this, r = e.length;
223
- for (let c = 0; c < r; ) {
224
- const o = Math.min(n - this.pos, r - c);
225
- if (o === n) {
226
- const h = Dt(e);
227
- for (; n <= r - c; c += n)
228
- this.process(h, c);
229
- continue;
230
- }
231
- i.set(e.subarray(c, c + o), this.pos), this.pos += o, c += o, this.pos === n && (this.process(s, 0), this.pos = 0);
14
+ var J, K, Ht, Xt, Vt, kt, Z, tt, bt, qt, Ut, ht, Et, at, ot, ct, lt, Ot, Ct, Dt, Tt, $, At, Nt, Ie = Wt((() => {
15
+ se(), Kt(), J = /* @__PURE__ */ Uint32Array.from([
16
+ 1732584193,
17
+ 4023233417,
18
+ 2562383102,
19
+ 271733878,
20
+ 3285377520
21
+ ]), K = /* @__PURE__ */ new Uint32Array(80), Ht = class extends nt {
22
+ A = J[0] | 0;
23
+ B = J[1] | 0;
24
+ C = J[2] | 0;
25
+ D = J[3] | 0;
26
+ E = J[4] | 0;
27
+ constructor() {
28
+ super(64, 20, 8, !1);
232
29
  }
233
- return this.length += e.length, this.roundClean(), this;
234
- }
235
- digestInto(e) {
236
- Ht(this), ie(e, this), this.finished = !0;
237
- const { buffer: s, view: i, blockLen: n, isLE: r } = this;
238
- let { pos: c } = this;
239
- s[c++] = 128, J(this.buffer.subarray(c)), this.padOffset > n - c && (this.process(i, 0), c = 0);
240
- for (let f = c; f < n; f++)
241
- s[f] = 0;
242
- i.setBigUint64(n - 8, BigInt(this.length * 8), r), this.process(i, 0);
243
- const o = Dt(e), h = this.outputLen;
244
- if (h % 4)
245
- throw new Error("_sha2: outputLen must be aligned to 32bit");
246
- const u = h / 4, d = this.get();
247
- if (u > d.length)
248
- throw new Error("_sha2: outputLen bigger than state");
249
- for (let f = 0; f < u; f++)
250
- o.setUint32(4 * f, d[f], r);
251
- }
252
- digest() {
253
- const { buffer: e, outputLen: s } = this;
254
- this.digestInto(e);
255
- const i = e.slice(0, s);
256
- return this.destroy(), i;
257
- }
258
- _cloneInto(e) {
259
- e ||= new this.constructor(), e.set(...this.get());
260
- const { blockLen: s, buffer: i, length: n, finished: r, destroyed: c, pos: o } = this;
261
- return e.destroyed = c, e.finished = r, e.length = n, e.pos = o, n % s && e.buffer.set(i), e;
262
- }
263
- clone() {
264
- return this._cloneInto();
265
- }
266
- }
267
- const nt = /* @__PURE__ */ Uint32Array.from([
268
- 1779033703,
269
- 3144134277,
270
- 1013904242,
271
- 2773480762,
272
- 1359893119,
273
- 2600822924,
274
- 528734635,
275
- 1541459225
276
- ]), rt = /* @__PURE__ */ Uint32Array.from([
277
- 3238371032,
278
- 914150663,
279
- 812702999,
280
- 4144912697,
281
- 4290775857,
282
- 1750603025,
283
- 1694076839,
284
- 3204075428
285
- ]), W = /* @__PURE__ */ Uint32Array.from([
286
- 3418070365,
287
- 3238371032,
288
- 1654270250,
289
- 914150663,
290
- 2438529370,
291
- 812702999,
292
- 355462360,
293
- 4144912697,
294
- 1731405415,
295
- 4290775857,
296
- 2394180231,
297
- 1750603025,
298
- 3675008525,
299
- 1694076839,
300
- 1203062813,
301
- 3204075428
302
- ]), q = /* @__PURE__ */ Uint32Array.from([
303
- 1779033703,
304
- 4089235720,
305
- 3144134277,
306
- 2227873595,
307
- 1013904242,
308
- 4271175723,
309
- 2773480762,
310
- 1595750129,
311
- 1359893119,
312
- 2917565137,
313
- 2600822924,
314
- 725511199,
315
- 528734635,
316
- 4215389547,
317
- 1541459225,
318
- 327033209
319
- ]), xt = /* @__PURE__ */ Uint32Array.from([
320
- 1732584193,
321
- 4023233417,
322
- 2562383102,
323
- 271733878,
324
- 3285377520
325
- ]), it = /* @__PURE__ */ new Uint32Array(80);
326
- class he extends _t {
327
- A = xt[0] | 0;
328
- B = xt[1] | 0;
329
- C = xt[2] | 0;
330
- D = xt[3] | 0;
331
- E = xt[4] | 0;
332
- constructor() {
333
- super(64, 20, 8, !1);
334
- }
335
- get() {
336
- const { A: e, B: s, C: i, D: n, E: r } = this;
337
- return [e, s, i, n, r];
338
- }
339
- set(e, s, i, n, r) {
340
- this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = n | 0, this.E = r | 0;
341
- }
342
- process(e, s) {
343
- for (let h = 0; h < 16; h++, s += 4)
344
- it[h] = e.getUint32(s, !1);
345
- for (let h = 16; h < 80; h++)
346
- it[h] = ht(it[h - 3] ^ it[h - 8] ^ it[h - 14] ^ it[h - 16], 1);
347
- let { A: i, B: n, C: r, D: c, E: o } = this;
348
- for (let h = 0; h < 80; h++) {
349
- let u, d;
350
- h < 20 ? (u = Et(n, r, c), d = 1518500249) : h < 40 ? (u = n ^ r ^ c, d = 1859775393) : h < 60 ? (u = ae(n, r, c), d = 2400959708) : (u = n ^ r ^ c, d = 3395469782);
351
- const f = ht(i, 5) + u + o + d + it[h] | 0;
352
- o = c, c = r, r = ht(n, 30), n = i, i = f;
353
- }
354
- i = i + this.A | 0, n = n + this.B | 0, r = r + this.C | 0, c = c + this.D | 0, o = o + this.E | 0, this.set(i, n, r, c, o);
355
- }
356
- roundClean() {
357
- J(it);
358
- }
359
- destroy() {
360
- this.set(0, 0, 0, 0, 0), J(this.buffer);
361
- }
362
- }
363
- const Pe = /* @__PURE__ */ tt(() => new he()), Re = /* @__PURE__ */ Math.pow(2, 32), We = /* @__PURE__ */ Array.from({ length: 64 }, (t, e) => Math.floor(Re * Math.abs(Math.sin(e + 1)))), wt = /* @__PURE__ */ xt.slice(0, 4), Ft = /* @__PURE__ */ new Uint32Array(16);
364
- class fe extends _t {
365
- A = wt[0] | 0;
366
- B = wt[1] | 0;
367
- C = wt[2] | 0;
368
- D = wt[3] | 0;
369
- constructor() {
370
- super(64, 16, 8, !0);
371
- }
372
- get() {
373
- const { A: e, B: s, C: i, D: n } = this;
374
- return [e, s, i, n];
375
- }
376
- set(e, s, i, n) {
377
- this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = n | 0;
378
- }
379
- process(e, s) {
380
- for (let o = 0; o < 16; o++, s += 4)
381
- Ft[o] = e.getUint32(s, !0);
382
- let { A: i, B: n, C: r, D: c } = this;
383
- for (let o = 0; o < 64; o++) {
384
- let h, u, d;
385
- o < 16 ? (h = Et(n, r, c), u = o, d = [7, 12, 17, 22]) : o < 32 ? (h = Et(c, n, r), u = (5 * o + 1) % 16, d = [5, 9, 14, 20]) : o < 48 ? (h = n ^ r ^ c, u = (3 * o + 5) % 16, d = [4, 11, 16, 23]) : (h = r ^ (n | ~c), u = 7 * o % 16, d = [6, 10, 15, 21]), h = h + i + We[o] + Ft[u], i = c, c = r, r = n, n = n + ht(h, d[o % 4]);
386
- }
387
- i = i + this.A | 0, n = n + this.B | 0, r = r + this.C | 0, c = c + this.D | 0, this.set(i, n, r, c);
388
- }
389
- roundClean() {
390
- J(Ft);
391
- }
392
- destroy() {
393
- this.set(0, 0, 0, 0), J(this.buffer);
394
- }
395
- }
396
- const qe = /* @__PURE__ */ tt(() => new fe()), Ke = /* @__PURE__ */ Uint8Array.from([
397
- 7,
398
- 4,
399
- 13,
400
- 1,
401
- 10,
402
- 6,
403
- 15,
404
- 3,
405
- 12,
406
- 0,
407
- 9,
408
- 5,
409
- 2,
410
- 14,
411
- 11,
412
- 8
413
- ]), de = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), Ne = de.map((t) => (9 * t + 5) % 16), ue = /* @__PURE__ */ (() => {
414
- const s = [[de], [Ne]];
415
- for (let i = 0; i < 4; i++)
416
- for (let n of s)
417
- n.push(n[i].map((r) => Ke[r]));
418
- return s;
419
- })(), le = ue[0], be = ue[1], xe = /* @__PURE__ */ [
420
- [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
421
- [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
422
- [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
423
- [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
424
- [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
425
- ].map((t) => Uint8Array.from(t)), Xe = /* @__PURE__ */ le.map((t, e) => t.map((s) => xe[e][s])), Je = /* @__PURE__ */ be.map((t, e) => t.map((s) => xe[e][s])), Qe = /* @__PURE__ */ Uint32Array.from([
426
- 0,
427
- 1518500249,
428
- 1859775393,
429
- 2400959708,
430
- 2840853838
431
- ]), Ye = /* @__PURE__ */ Uint32Array.from([
432
- 1352829926,
433
- 1548603684,
434
- 1836072691,
435
- 2053994217,
436
- 0
437
- ]);
438
- function qt(t, e, s, i) {
439
- return t === 0 ? e ^ s ^ i : t === 1 ? e & s | ~e & i : t === 2 ? (e | ~s) ^ i : t === 3 ? e & i | s & ~i : e ^ (s | ~i);
440
- }
441
- const Lt = /* @__PURE__ */ new Uint32Array(16);
442
- class He extends _t {
443
- h0 = 1732584193;
444
- h1 = -271733879;
445
- h2 = -1732584194;
446
- h3 = 271733878;
447
- h4 = -1009589776;
448
- constructor() {
449
- super(64, 20, 8, !0);
450
- }
451
- get() {
452
- const { h0: e, h1: s, h2: i, h3: n, h4: r } = this;
453
- return [e, s, i, n, r];
454
- }
455
- set(e, s, i, n, r) {
456
- this.h0 = e | 0, this.h1 = s | 0, this.h2 = i | 0, this.h3 = n | 0, this.h4 = r | 0;
457
- }
458
- process(e, s) {
459
- for (let p = 0; p < 16; p++, s += 4)
460
- Lt[p] = e.getUint32(s, !0);
461
- let i = this.h0 | 0, n = i, r = this.h1 | 0, c = r, o = this.h2 | 0, h = o, u = this.h3 | 0, d = u, f = this.h4 | 0, y = f;
462
- for (let p = 0; p < 5; p++) {
463
- const g = 4 - p, S = Qe[p], U = Ye[p], M = le[p], D = be[p], H = Xe[p], E = Je[p];
464
- for (let A = 0; A < 16; A++) {
465
- const L = ht(i + qt(p, r, o, u) + Lt[M[A]] + S, H[A]) + f | 0;
466
- i = f, f = u, u = ht(o, 10) | 0, o = r, r = L;
30
+ get() {
31
+ const { A: t, B: e, C: s, D: h, E: r } = this;
32
+ return [
33
+ t,
34
+ e,
35
+ s,
36
+ h,
37
+ r
38
+ ];
39
+ }
40
+ set(t, e, s, h, r) {
41
+ this.A = t | 0, this.B = e | 0, this.C = s | 0, this.D = h | 0, this.E = r | 0;
42
+ }
43
+ process(t, e) {
44
+ for (let a = 0; a < 16; a++, e += 4) K[a] = t.getUint32(e, !1);
45
+ for (let a = 16; a < 80; a++) K[a] = q(K[a - 3] ^ K[a - 8] ^ K[a - 14] ^ K[a - 16], 1);
46
+ let { A: s, B: h, C: r, D: c, E: n } = this;
47
+ for (let a = 0; a < 80; a++) {
48
+ let l, f;
49
+ a < 20 ? (l = rt(h, r, c), f = 1518500249) : a < 40 ? (l = h ^ r ^ c, f = 1859775393) : a < 60 ? (l = ce(h, r, c), f = 2400959708) : (l = h ^ r ^ c, f = 3395469782);
50
+ const I = q(s, 5) + l + n + f + K[a] | 0;
51
+ n = c, c = r, r = q(h, 30), h = s, s = I;
467
52
  }
468
- for (let A = 0; A < 16; A++) {
469
- const L = ht(n + qt(g, c, h, d) + Lt[D[A]] + U, E[A]) + y | 0;
470
- n = y, y = d, d = ht(h, 10) | 0, h = c, c = L;
53
+ s = s + this.A | 0, h = h + this.B | 0, r = r + this.C | 0, c = c + this.D | 0, n = n + this.E | 0, this.set(s, h, r, c, n);
54
+ }
55
+ roundClean() {
56
+ N(K);
57
+ }
58
+ destroy() {
59
+ this.set(0, 0, 0, 0, 0), N(this.buffer);
60
+ }
61
+ }, Xt = /* @__PURE__ */ et(() => new Ht()), Vt = /* @__PURE__ */ Math.pow(2, 32), kt = /* @__PURE__ */ Array.from({ length: 64 }, (t, e) => Math.floor(Vt * Math.abs(Math.sin(e + 1)))), Z = /* @__PURE__ */ J.slice(0, 4), tt = /* @__PURE__ */ new Uint32Array(16), bt = class extends nt {
62
+ A = Z[0] | 0;
63
+ B = Z[1] | 0;
64
+ C = Z[2] | 0;
65
+ D = Z[3] | 0;
66
+ constructor() {
67
+ super(64, 16, 8, !0);
68
+ }
69
+ get() {
70
+ const { A: t, B: e, C: s, D: h } = this;
71
+ return [
72
+ t,
73
+ e,
74
+ s,
75
+ h
76
+ ];
77
+ }
78
+ set(t, e, s, h) {
79
+ this.A = t | 0, this.B = e | 0, this.C = s | 0, this.D = h | 0;
80
+ }
81
+ process(t, e) {
82
+ for (let n = 0; n < 16; n++, e += 4) tt[n] = t.getUint32(e, !0);
83
+ let { A: s, B: h, C: r, D: c } = this;
84
+ for (let n = 0; n < 64; n++) {
85
+ let a, l, f;
86
+ n < 16 ? (a = rt(h, r, c), l = n, f = [
87
+ 7,
88
+ 12,
89
+ 17,
90
+ 22
91
+ ]) : n < 32 ? (a = rt(c, h, r), l = (5 * n + 1) % 16, f = [
92
+ 5,
93
+ 9,
94
+ 14,
95
+ 20
96
+ ]) : n < 48 ? (a = h ^ r ^ c, l = (3 * n + 5) % 16, f = [
97
+ 4,
98
+ 11,
99
+ 16,
100
+ 23
101
+ ]) : (a = r ^ (h | ~c), l = 7 * n % 16, f = [
102
+ 6,
103
+ 10,
104
+ 15,
105
+ 21
106
+ ]), a = a + s + kt[n] + tt[l], s = c, c = r, r = h, h = h + q(a, f[n % 4]);
471
107
  }
108
+ s = s + this.A | 0, h = h + this.B | 0, r = r + this.C | 0, c = c + this.D | 0, this.set(s, h, r, c);
472
109
  }
473
- this.set(this.h1 + o + d | 0, this.h2 + u + y | 0, this.h3 + f + n | 0, this.h4 + i + c | 0, this.h0 + r + h | 0);
474
- }
475
- roundClean() {
476
- J(Lt);
477
- }
478
- destroy() {
479
- this.destroyed = !0, J(this.buffer), this.set(0, 0, 0, 0, 0);
480
- }
481
- }
482
- const Ze = /* @__PURE__ */ tt(() => new He()), ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
483
- __proto__: null,
484
- _MD5: fe,
485
- _RIPEMD160: He,
486
- _SHA1: he,
487
- md5: qe,
488
- ripemd160: Ze,
489
- sha1: Pe
490
- }, Symbol.toStringTag, { value: "Module" })), M0 = /* @__PURE__ */ Mt(ze), It = /* @__PURE__ */ BigInt(2 ** 32 - 1), Kt = /* @__PURE__ */ BigInt(32);
491
- function $e(t, e = !1) {
492
- return e ? { h: Number(t & It), l: Number(t >> Kt & It) } : { h: Number(t >> Kt & It) | 0, l: Number(t & It) | 0 };
493
- }
494
- function Ae(t, e = !1) {
495
- const s = t.length;
496
- let i = new Uint32Array(s), n = new Uint32Array(s);
497
- for (let r = 0; r < s; r++) {
498
- const { h: c, l: o } = $e(t[r], e);
499
- [i[r], n[r]] = [c, o];
500
- }
501
- return [i, n];
502
- }
503
- const Nt = (t, e, s) => t >>> s, Xt = (t, e, s) => t << 32 - s | e >>> s, lt = (t, e, s) => t >>> s | e << 32 - s, bt = (t, e, s) => t << 32 - s | e >>> s, Bt = (t, e, s) => t << 64 - s | e >>> s - 32, mt = (t, e, s) => t >>> s - 32 | e << 64 - s, t0 = (t, e, s) => t << s | e >>> 32 - s, e0 = (t, e, s) => e << s | t >>> 32 - s, s0 = (t, e, s) => e << s - 32 | t >>> 64 - s, n0 = (t, e, s) => t << s - 32 | e >>> 64 - s;
504
- function st(t, e, s, i) {
505
- const n = (e >>> 0) + (i >>> 0);
506
- return { h: t + s + (n / 2 ** 32 | 0) | 0, l: n | 0 };
507
- }
508
- const r0 = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), i0 = (t, e, s, i) => e + s + i + (t / 2 ** 32 | 0) | 0, c0 = (t, e, s, i) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (i >>> 0), o0 = (t, e, s, i, n) => e + s + i + n + (t / 2 ** 32 | 0) | 0, a0 = (t, e, s, i, n) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (i >>> 0) + (n >>> 0), h0 = (t, e, s, i, n, r) => e + s + i + n + r + (t / 2 ** 32 | 0) | 0, f0 = /* @__PURE__ */ Uint32Array.from([
509
- 1116352408,
510
- 1899447441,
511
- 3049323471,
512
- 3921009573,
513
- 961987163,
514
- 1508970993,
515
- 2453635748,
516
- 2870763221,
517
- 3624381080,
518
- 310598401,
519
- 607225278,
520
- 1426881987,
521
- 1925078388,
522
- 2162078206,
523
- 2614888103,
524
- 3248222580,
525
- 3835390401,
526
- 4022224774,
527
- 264347078,
528
- 604807628,
529
- 770255983,
530
- 1249150122,
531
- 1555081692,
532
- 1996064986,
533
- 2554220882,
534
- 2821834349,
535
- 2952996808,
536
- 3210313671,
537
- 3336571891,
538
- 3584528711,
539
- 113926993,
540
- 338241895,
541
- 666307205,
542
- 773529912,
543
- 1294757372,
544
- 1396182291,
545
- 1695183700,
546
- 1986661051,
547
- 2177026350,
548
- 2456956037,
549
- 2730485921,
550
- 2820302411,
551
- 3259730800,
552
- 3345764771,
553
- 3516065817,
554
- 3600352804,
555
- 4094571909,
556
- 275423344,
557
- 430227734,
558
- 506948616,
559
- 659060556,
560
- 883997877,
561
- 958139571,
562
- 1322822218,
563
- 1537002063,
564
- 1747873779,
565
- 1955562222,
566
- 2024104815,
567
- 2227730452,
568
- 2361852424,
569
- 2428436474,
570
- 2756734187,
571
- 3204031479,
572
- 3329325298
573
- ]), ct = /* @__PURE__ */ new Uint32Array(64);
574
- class pe extends _t {
575
- constructor(e) {
576
- super(64, e, 8, !1);
577
- }
578
- get() {
579
- const { A: e, B: s, C: i, D: n, E: r, F: c, G: o, H: h } = this;
580
- return [e, s, i, n, r, c, o, h];
581
- }
582
- // prettier-ignore
583
- set(e, s, i, n, r, c, o, h) {
584
- this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = n | 0, this.E = r | 0, this.F = c | 0, this.G = o | 0, this.H = h | 0;
585
- }
586
- process(e, s) {
587
- for (let f = 0; f < 16; f++, s += 4)
588
- ct[f] = e.getUint32(s, !1);
589
- for (let f = 16; f < 64; f++) {
590
- const y = ct[f - 15], p = ct[f - 2], g = $(y, 7) ^ $(y, 18) ^ y >>> 3, S = $(p, 17) ^ $(p, 19) ^ p >>> 10;
591
- ct[f] = S + ct[f - 7] + g + ct[f - 16] | 0;
592
- }
593
- let { A: i, B: n, C: r, D: c, E: o, F: h, G: u, H: d } = this;
594
- for (let f = 0; f < 64; f++) {
595
- const y = $(o, 6) ^ $(o, 11) ^ $(o, 25), p = d + y + Et(o, h, u) + f0[f] + ct[f] | 0, S = ($(i, 2) ^ $(i, 13) ^ $(i, 22)) + ae(i, n, r) | 0;
596
- d = u, u = h, h = o, o = c + p | 0, c = r, r = n, n = i, i = p + S | 0;
597
- }
598
- i = i + this.A | 0, n = n + this.B | 0, r = r + this.C | 0, c = c + this.D | 0, o = o + this.E | 0, h = h + this.F | 0, u = u + this.G | 0, d = d + this.H | 0, this.set(i, n, r, c, o, h, u, d);
599
- }
600
- roundClean() {
601
- J(ct);
602
- }
603
- destroy() {
604
- this.set(0, 0, 0, 0, 0, 0, 0, 0), J(this.buffer);
605
- }
606
- }
607
- class ye extends pe {
608
- // We cannot use array here since array allows indexing by variable
609
- // which means optimizer/compiler cannot use registers.
610
- A = nt[0] | 0;
611
- B = nt[1] | 0;
612
- C = nt[2] | 0;
613
- D = nt[3] | 0;
614
- E = nt[4] | 0;
615
- F = nt[5] | 0;
616
- G = nt[6] | 0;
617
- H = nt[7] | 0;
618
- constructor() {
619
- super(32);
620
- }
621
- }
622
- class _e extends pe {
623
- A = rt[0] | 0;
624
- B = rt[1] | 0;
625
- C = rt[2] | 0;
626
- D = rt[3] | 0;
627
- E = rt[4] | 0;
628
- F = rt[5] | 0;
629
- G = rt[6] | 0;
630
- H = rt[7] | 0;
631
- constructor() {
632
- super(28);
633
- }
634
- }
635
- const ge = Ae([
636
- "0x428a2f98d728ae22",
637
- "0x7137449123ef65cd",
638
- "0xb5c0fbcfec4d3b2f",
639
- "0xe9b5dba58189dbbc",
640
- "0x3956c25bf348b538",
641
- "0x59f111f1b605d019",
642
- "0x923f82a4af194f9b",
643
- "0xab1c5ed5da6d8118",
644
- "0xd807aa98a3030242",
645
- "0x12835b0145706fbe",
646
- "0x243185be4ee4b28c",
647
- "0x550c7dc3d5ffb4e2",
648
- "0x72be5d74f27b896f",
649
- "0x80deb1fe3b1696b1",
650
- "0x9bdc06a725c71235",
651
- "0xc19bf174cf692694",
652
- "0xe49b69c19ef14ad2",
653
- "0xefbe4786384f25e3",
654
- "0x0fc19dc68b8cd5b5",
655
- "0x240ca1cc77ac9c65",
656
- "0x2de92c6f592b0275",
657
- "0x4a7484aa6ea6e483",
658
- "0x5cb0a9dcbd41fbd4",
659
- "0x76f988da831153b5",
660
- "0x983e5152ee66dfab",
661
- "0xa831c66d2db43210",
662
- "0xb00327c898fb213f",
663
- "0xbf597fc7beef0ee4",
664
- "0xc6e00bf33da88fc2",
665
- "0xd5a79147930aa725",
666
- "0x06ca6351e003826f",
667
- "0x142929670a0e6e70",
668
- "0x27b70a8546d22ffc",
669
- "0x2e1b21385c26c926",
670
- "0x4d2c6dfc5ac42aed",
671
- "0x53380d139d95b3df",
672
- "0x650a73548baf63de",
673
- "0x766a0abb3c77b2a8",
674
- "0x81c2c92e47edaee6",
675
- "0x92722c851482353b",
676
- "0xa2bfe8a14cf10364",
677
- "0xa81a664bbc423001",
678
- "0xc24b8b70d0f89791",
679
- "0xc76c51a30654be30",
680
- "0xd192e819d6ef5218",
681
- "0xd69906245565a910",
682
- "0xf40e35855771202a",
683
- "0x106aa07032bbd1b8",
684
- "0x19a4c116b8d2d0c8",
685
- "0x1e376c085141ab53",
686
- "0x2748774cdf8eeb99",
687
- "0x34b0bcb5e19b48a8",
688
- "0x391c0cb3c5c95a63",
689
- "0x4ed8aa4ae3418acb",
690
- "0x5b9cca4f7763e373",
691
- "0x682e6ff3d6b2b8a3",
692
- "0x748f82ee5defb2fc",
693
- "0x78a5636f43172f60",
694
- "0x84c87814a1f0ab72",
695
- "0x8cc702081a6439ec",
696
- "0x90befffa23631e28",
697
- "0xa4506cebde82bde9",
698
- "0xbef9a3f7b2c67915",
699
- "0xc67178f2e372532b",
700
- "0xca273eceea26619c",
701
- "0xd186b8c721c0c207",
702
- "0xeada7dd6cde0eb1e",
703
- "0xf57d4f7fee6ed178",
704
- "0x06f067aa72176fba",
705
- "0x0a637dc5a2c898a6",
706
- "0x113f9804bef90dae",
707
- "0x1b710b35131c471b",
708
- "0x28db77f523047d84",
709
- "0x32caab7b40c72493",
710
- "0x3c9ebe0a15c9bebc",
711
- "0x431d67c49c100d4c",
712
- "0x4cc5d4becb3e42b6",
713
- "0x597f299cfc657e2a",
714
- "0x5fcb6fab3ad6faec",
715
- "0x6c44198c4a475817"
716
- ].map((t) => BigInt(t))), d0 = ge[0], u0 = ge[1], ot = /* @__PURE__ */ new Uint32Array(80), at = /* @__PURE__ */ new Uint32Array(80);
717
- class Vt extends _t {
718
- constructor(e) {
719
- super(128, e, 16, !1);
720
- }
721
- // prettier-ignore
722
- get() {
723
- const { Ah: e, Al: s, Bh: i, Bl: n, Ch: r, Cl: c, Dh: o, Dl: h, Eh: u, El: d, Fh: f, Fl: y, Gh: p, Gl: g, Hh: S, Hl: U } = this;
724
- return [e, s, i, n, r, c, o, h, u, d, f, y, p, g, S, U];
725
- }
726
- // prettier-ignore
727
- set(e, s, i, n, r, c, o, h, u, d, f, y, p, g, S, U) {
728
- this.Ah = e | 0, this.Al = s | 0, this.Bh = i | 0, this.Bl = n | 0, this.Ch = r | 0, this.Cl = c | 0, this.Dh = o | 0, this.Dl = h | 0, this.Eh = u | 0, this.El = d | 0, this.Fh = f | 0, this.Fl = y | 0, this.Gh = p | 0, this.Gl = g | 0, this.Hh = S | 0, this.Hl = U | 0;
729
- }
730
- process(e, s) {
731
- for (let H = 0; H < 16; H++, s += 4)
732
- ot[H] = e.getUint32(s), at[H] = e.getUint32(s += 4);
733
- for (let H = 16; H < 80; H++) {
734
- const E = ot[H - 15] | 0, A = at[H - 15] | 0, L = lt(E, A, 1) ^ lt(E, A, 8) ^ Nt(E, A, 7), m = bt(E, A, 1) ^ bt(E, A, 8) ^ Xt(E, A, 7), V = ot[H - 2] | 0, l = at[H - 2] | 0, b = lt(V, l, 19) ^ Bt(V, l, 61) ^ Nt(V, l, 6), x = bt(V, l, 19) ^ mt(V, l, 61) ^ Xt(V, l, 6), C = c0(m, x, at[H - 7], at[H - 16]), w = o0(C, L, b, ot[H - 7], ot[H - 16]);
735
- ot[H] = w | 0, at[H] = C | 0;
736
- }
737
- let { Ah: i, Al: n, Bh: r, Bl: c, Ch: o, Cl: h, Dh: u, Dl: d, Eh: f, El: y, Fh: p, Fl: g, Gh: S, Gl: U, Hh: M, Hl: D } = this;
738
- for (let H = 0; H < 80; H++) {
739
- const E = lt(f, y, 14) ^ lt(f, y, 18) ^ Bt(f, y, 41), A = bt(f, y, 14) ^ bt(f, y, 18) ^ mt(f, y, 41), L = f & p ^ ~f & S, m = y & g ^ ~y & U, V = a0(D, A, m, u0[H], at[H]), l = h0(V, M, E, L, d0[H], ot[H]), b = V | 0, x = lt(i, n, 28) ^ Bt(i, n, 34) ^ Bt(i, n, 39), C = bt(i, n, 28) ^ mt(i, n, 34) ^ mt(i, n, 39), w = i & r ^ i & o ^ r & o, k = n & c ^ n & h ^ c & h;
740
- M = S | 0, D = U | 0, S = p | 0, U = g | 0, p = f | 0, g = y | 0, { h: f, l: y } = st(u | 0, d | 0, l | 0, b | 0), u = o | 0, d = h | 0, o = r | 0, h = c | 0, r = i | 0, c = n | 0;
741
- const v = r0(b, C, k);
742
- i = i0(v, l, x, w), n = v | 0;
743
- }
744
- ({ h: i, l: n } = st(this.Ah | 0, this.Al | 0, i | 0, n | 0)), { h: r, l: c } = st(this.Bh | 0, this.Bl | 0, r | 0, c | 0), { h: o, l: h } = st(this.Ch | 0, this.Cl | 0, o | 0, h | 0), { h: u, l: d } = st(this.Dh | 0, this.Dl | 0, u | 0, d | 0), { h: f, l: y } = st(this.Eh | 0, this.El | 0, f | 0, y | 0), { h: p, l: g } = st(this.Fh | 0, this.Fl | 0, p | 0, g | 0), { h: S, l: U } = st(this.Gh | 0, this.Gl | 0, S | 0, U | 0), { h: M, l: D } = st(this.Hh | 0, this.Hl | 0, M | 0, D | 0), this.set(i, n, r, c, o, h, u, d, f, y, p, g, S, U, M, D);
745
- }
746
- roundClean() {
747
- J(ot, at);
748
- }
749
- destroy() {
750
- J(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
751
- }
752
- }
753
- class Se extends Vt {
754
- Ah = q[0] | 0;
755
- Al = q[1] | 0;
756
- Bh = q[2] | 0;
757
- Bl = q[3] | 0;
758
- Ch = q[4] | 0;
759
- Cl = q[5] | 0;
760
- Dh = q[6] | 0;
761
- Dl = q[7] | 0;
762
- Eh = q[8] | 0;
763
- El = q[9] | 0;
764
- Fh = q[10] | 0;
765
- Fl = q[11] | 0;
766
- Gh = q[12] | 0;
767
- Gl = q[13] | 0;
768
- Hh = q[14] | 0;
769
- Hl = q[15] | 0;
770
- constructor() {
771
- super(64);
772
- }
773
- }
774
- class we extends Vt {
775
- Ah = W[0] | 0;
776
- Al = W[1] | 0;
777
- Bh = W[2] | 0;
778
- Bl = W[3] | 0;
779
- Ch = W[4] | 0;
780
- Cl = W[5] | 0;
781
- Dh = W[6] | 0;
782
- Dl = W[7] | 0;
783
- Eh = W[8] | 0;
784
- El = W[9] | 0;
785
- Fh = W[10] | 0;
786
- Fl = W[11] | 0;
787
- Gh = W[12] | 0;
788
- Gl = W[13] | 0;
789
- Hh = W[14] | 0;
790
- Hl = W[15] | 0;
791
- constructor() {
792
- super(48);
793
- }
794
- }
795
- const K = /* @__PURE__ */ Uint32Array.from([
796
- 2352822216,
797
- 424955298,
798
- 1944164710,
799
- 2312950998,
800
- 502970286,
801
- 855612546,
802
- 1738396948,
803
- 1479516111,
804
- 258812777,
805
- 2077511080,
806
- 2011393907,
807
- 79989058,
808
- 1067287976,
809
- 1780299464,
810
- 286451373,
811
- 2446758561
812
- ]), N = /* @__PURE__ */ Uint32Array.from([
813
- 573645204,
814
- 4230739756,
815
- 2673172387,
816
- 3360449730,
817
- 596883563,
818
- 1867755857,
819
- 2520282905,
820
- 1497426621,
821
- 2519219938,
822
- 2827943907,
823
- 3193839141,
824
- 1401305490,
825
- 721525244,
826
- 746961066,
827
- 246885852,
828
- 2177182882
829
- ]);
830
- class Le extends Vt {
831
- Ah = K[0] | 0;
832
- Al = K[1] | 0;
833
- Bh = K[2] | 0;
834
- Bl = K[3] | 0;
835
- Ch = K[4] | 0;
836
- Cl = K[5] | 0;
837
- Dh = K[6] | 0;
838
- Dl = K[7] | 0;
839
- Eh = K[8] | 0;
840
- El = K[9] | 0;
841
- Fh = K[10] | 0;
842
- Fl = K[11] | 0;
843
- Gh = K[12] | 0;
844
- Gl = K[13] | 0;
845
- Hh = K[14] | 0;
846
- Hl = K[15] | 0;
847
- constructor() {
848
- super(28);
849
- }
850
- }
851
- class Ie extends Vt {
852
- Ah = N[0] | 0;
853
- Al = N[1] | 0;
854
- Bh = N[2] | 0;
855
- Bl = N[3] | 0;
856
- Ch = N[4] | 0;
857
- Cl = N[5] | 0;
858
- Dh = N[6] | 0;
859
- Dl = N[7] | 0;
860
- Eh = N[8] | 0;
861
- El = N[9] | 0;
862
- Fh = N[10] | 0;
863
- Fl = N[11] | 0;
864
- Gh = N[12] | 0;
865
- Gl = N[13] | 0;
866
- Hh = N[14] | 0;
867
- Hl = N[15] | 0;
868
- constructor() {
869
- super(32);
870
- }
871
- }
872
- const l0 = /* @__PURE__ */ tt(
873
- () => new ye(),
874
- /* @__PURE__ */ dt(1)
875
- ), b0 = /* @__PURE__ */ tt(
876
- () => new _e(),
877
- /* @__PURE__ */ dt(4)
878
- ), x0 = /* @__PURE__ */ tt(
879
- () => new Se(),
880
- /* @__PURE__ */ dt(3)
881
- ), H0 = /* @__PURE__ */ tt(
882
- () => new we(),
883
- /* @__PURE__ */ dt(2)
884
- ), A0 = /* @__PURE__ */ tt(
885
- () => new Ie(),
886
- /* @__PURE__ */ dt(6)
887
- ), p0 = /* @__PURE__ */ tt(
888
- () => new Le(),
889
- /* @__PURE__ */ dt(5)
890
- ), y0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
891
- __proto__: null,
892
- _SHA224: _e,
893
- _SHA256: ye,
894
- _SHA384: we,
895
- _SHA512: Se,
896
- _SHA512_224: Le,
897
- _SHA512_256: Ie,
898
- sha224: b0,
899
- sha256: l0,
900
- sha384: H0,
901
- sha512: x0,
902
- sha512_224: p0,
903
- sha512_256: A0
904
- }, Symbol.toStringTag, { value: "Module" })), G0 = /* @__PURE__ */ Mt(y0), _0 = BigInt(0), At = BigInt(1), g0 = BigInt(2), S0 = BigInt(7), w0 = BigInt(256), L0 = BigInt(113), Be = [], me = [], Ue = [];
905
- for (let t = 0, e = At, s = 1, i = 0; t < 24; t++) {
906
- [s, i] = [i, (2 * s + 3 * i) % 5], Be.push(2 * (5 * i + s)), me.push((t + 1) * (t + 2) / 2 % 64);
907
- let n = _0;
908
- for (let r = 0; r < 7; r++)
909
- e = (e << At ^ (e >> S0) * L0) % w0, e & g0 && (n ^= At << (At << BigInt(r)) - At);
910
- Ue.push(n);
911
- }
912
- const Ee = Ae(Ue, !0), I0 = Ee[0], B0 = Ee[1], Jt = (t, e, s) => s > 32 ? s0(t, e, s) : t0(t, e, s), Qt = (t, e, s) => s > 32 ? n0(t, e, s) : e0(t, e, s);
913
- function m0(t, e = 24) {
914
- const s = new Uint32Array(10);
915
- for (let i = 24 - e; i < 24; i++) {
916
- for (let c = 0; c < 10; c++)
917
- s[c] = t[c] ^ t[c + 10] ^ t[c + 20] ^ t[c + 30] ^ t[c + 40];
918
- for (let c = 0; c < 10; c += 2) {
919
- const o = (c + 8) % 10, h = (c + 2) % 10, u = s[h], d = s[h + 1], f = Jt(u, d, 1) ^ s[o], y = Qt(u, d, 1) ^ s[o + 1];
920
- for (let p = 0; p < 50; p += 10)
921
- t[c + p] ^= f, t[c + p + 1] ^= y;
922
- }
923
- let n = t[2], r = t[3];
924
- for (let c = 0; c < 24; c++) {
925
- const o = me[c], h = Jt(n, r, o), u = Qt(n, r, o), d = Be[c];
926
- n = t[d], r = t[d + 1], t[d] = h, t[d + 1] = u;
927
- }
928
- for (let c = 0; c < 50; c += 10) {
929
- for (let o = 0; o < 10; o++)
930
- s[o] = t[c + o];
931
- for (let o = 0; o < 10; o++)
932
- t[c + o] ^= ~s[(o + 2) % 10] & s[(o + 4) % 10];
933
- }
934
- t[0] ^= I0[i], t[1] ^= B0[i];
935
- }
936
- J(s);
937
- }
938
- class jt {
939
- state;
940
- pos = 0;
941
- posOut = 0;
942
- finished = !1;
943
- state32;
944
- destroyed = !1;
945
- blockLen;
946
- suffix;
947
- outputLen;
948
- enableXOF = !1;
949
- rounds;
950
- // NOTE: we accept arguments in bytes instead of bits here.
951
- constructor(e, s, i, n = !1, r = 24) {
952
- if (this.blockLen = e, this.suffix = s, this.outputLen = i, this.enableXOF = n, this.rounds = r, Ut(i, "outputLen"), !(0 < e && e < 200))
953
- throw new Error("only keccak-f1600 function is supported");
954
- this.state = new Uint8Array(200), this.state32 = Fe(this.state);
955
- }
956
- clone() {
957
- return this._cloneInto();
958
- }
959
- keccak() {
960
- Rt(this.state32), m0(this.state32, this.rounds), Rt(this.state32), this.posOut = 0, this.pos = 0;
961
- }
962
- update(e) {
963
- Ht(this), ft(e);
964
- const { blockLen: s, state: i } = this, n = e.length;
965
- for (let r = 0; r < n; ) {
966
- const c = Math.min(s - this.pos, n - r);
967
- for (let o = 0; o < c; o++)
968
- i[this.pos++] ^= e[r++];
969
- this.pos === s && this.keccak();
970
- }
971
- return this;
972
- }
973
- finish() {
974
- if (this.finished)
975
- return;
976
- this.finished = !0;
977
- const { state: e, suffix: s, pos: i, blockLen: n } = this;
978
- e[i] ^= s, (s & 128) !== 0 && i === n - 1 && this.keccak(), e[n - 1] ^= 128, this.keccak();
979
- }
980
- writeInto(e) {
981
- Ht(this, !1), ft(e), this.finish();
982
- const s = this.state, { blockLen: i } = this;
983
- for (let n = 0, r = e.length; n < r; ) {
984
- this.posOut >= i && this.keccak();
985
- const c = Math.min(i - this.posOut, r - n);
986
- e.set(s.subarray(this.posOut, this.posOut + c), n), this.posOut += c, n += c;
987
- }
988
- return e;
989
- }
990
- xofInto(e) {
991
- if (!this.enableXOF)
992
- throw new Error("XOF is not possible for this instance");
993
- return this.writeInto(e);
994
- }
995
- xof(e) {
996
- return Ut(e), this.xofInto(new Uint8Array(e));
997
- }
998
- digestInto(e) {
999
- if (ie(e, this), this.finished)
1000
- throw new Error("digest() was already called");
1001
- return this.writeInto(e), this.destroy(), e;
1002
- }
1003
- digest() {
1004
- return this.digestInto(new Uint8Array(this.outputLen));
1005
- }
1006
- destroy() {
1007
- this.destroyed = !0, J(this.state);
1008
- }
1009
- _cloneInto(e) {
1010
- const { blockLen: s, suffix: i, outputLen: n, rounds: r, enableXOF: c } = this;
1011
- return e ||= new jt(s, i, n, c, r), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = i, e.outputLen = n, e.enableXOF = c, e.destroyed = this.destroyed, e;
1012
- }
1013
- }
1014
- const Ve = (t, e, s, i = {}) => tt((n = {}) => new jt(e, t, n.dkLen === void 0 ? s : n.dkLen, !0), i), j0 = /* @__PURE__ */ Ve(31, 168, 16, /* @__PURE__ */ dt(11)), P0 = /* @__PURE__ */ Ve(31, 136, 32, /* @__PURE__ */ dt(12));
1015
- var z = {}, F = {}, X = {}, Tt = {}, pt = {}, Yt;
1016
- function U0() {
1017
- return Yt || (Yt = 1, Object.defineProperty(pt, "__esModule", { value: !0 }), pt.crypto = void 0, pt.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), pt;
1018
- }
1019
- var Zt;
1020
- function Ct() {
1021
- return Zt || (Zt = 1, (function(t) {
1022
- 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 = i, t.abytes = n, t.ahash = r, t.aexists = c, t.aoutput = o, t.u8 = h, t.u32 = u, t.clean = d, t.createView = f, t.rotr = y, t.rotl = p, t.byteSwap = g, t.byteSwap32 = S, t.bytesToHex = D, t.hexToBytes = A, t.asyncLoop = m, t.utf8ToBytes = V, t.bytesToUtf8 = l, t.toBytes = b, t.kdfInputToBytes = x, t.concatBytes = C, t.checkOpts = w, t.createHasher = v, t.createOptHasher = j, t.createXOFer = P, t.randomBytes = Q;
1023
- const e = /* @__PURE__ */ U0();
1024
- function s(a) {
1025
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
1026
- }
1027
- function i(a) {
1028
- if (!Number.isSafeInteger(a) || a < 0)
1029
- throw new Error("positive integer expected, got " + a);
1030
- }
1031
- function n(a, ..._) {
1032
- if (!s(a))
1033
- throw new Error("Uint8Array expected");
1034
- if (_.length > 0 && !_.includes(a.length))
1035
- throw new Error("Uint8Array expected of length " + _ + ", got length=" + a.length);
1036
- }
1037
- function r(a) {
1038
- if (typeof a != "function" || typeof a.create != "function")
1039
- throw new Error("Hash should be wrapped by utils.createHasher");
1040
- i(a.outputLen), i(a.blockLen);
1041
- }
1042
- function c(a, _ = !0) {
1043
- if (a.destroyed)
1044
- throw new Error("Hash instance has been destroyed");
1045
- if (_ && a.finished)
1046
- throw new Error("Hash#digest() has already been called");
1047
- }
1048
- function o(a, _) {
1049
- n(a);
1050
- const I = _.outputLen;
1051
- if (a.length < I)
1052
- throw new Error("digestInto() expects output buffer of length at least " + I);
1053
- }
1054
- function h(a) {
1055
- return new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
1056
- }
1057
- function u(a) {
1058
- return new Uint32Array(a.buffer, a.byteOffset, Math.floor(a.byteLength / 4));
1059
- }
1060
- function d(...a) {
1061
- for (let _ = 0; _ < a.length; _++)
1062
- a[_].fill(0);
1063
- }
1064
- function f(a) {
1065
- return new DataView(a.buffer, a.byteOffset, a.byteLength);
1066
- }
1067
- function y(a, _) {
1068
- return a << 32 - _ | a >>> _;
1069
- }
1070
- function p(a, _) {
1071
- return a << _ | a >>> 32 - _ >>> 0;
1072
- }
1073
- t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
1074
- function g(a) {
1075
- return a << 24 & 4278190080 | a << 8 & 16711680 | a >>> 8 & 65280 | a >>> 24 & 255;
1076
- }
1077
- t.swap8IfBE = t.isLE ? (a) => a : (a) => g(a), t.byteSwapIfBE = t.swap8IfBE;
1078
- function S(a) {
1079
- for (let _ = 0; _ < a.length; _++)
1080
- a[_] = g(a[_]);
1081
- return a;
1082
- }
1083
- t.swap32IfBE = t.isLE ? (a) => a : S;
1084
- const U = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", M = /* @__PURE__ */ Array.from({ length: 256 }, (a, _) => _.toString(16).padStart(2, "0"));
1085
- function D(a) {
1086
- if (n(a), U)
1087
- return a.toHex();
1088
- let _ = "";
1089
- for (let I = 0; I < a.length; I++)
1090
- _ += M[a[I]];
1091
- return _;
1092
- }
1093
- const H = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
1094
- function E(a) {
1095
- if (a >= H._0 && a <= H._9)
1096
- return a - H._0;
1097
- if (a >= H.A && a <= H.F)
1098
- return a - (H.A - 10);
1099
- if (a >= H.a && a <= H.f)
1100
- return a - (H.a - 10);
1101
- }
1102
- function A(a) {
1103
- if (typeof a != "string")
1104
- throw new Error("hex string expected, got " + typeof a);
1105
- if (U)
1106
- return Uint8Array.fromHex(a);
1107
- const _ = a.length, I = _ / 2;
1108
- if (_ % 2)
1109
- throw new Error("hex string expected, got unpadded hex of length " + _);
1110
- const O = new Uint8Array(I);
1111
- for (let T = 0, R = 0; T < I; T++, R += 2) {
1112
- const ut = E(a.charCodeAt(R)), Y = E(a.charCodeAt(R + 1));
1113
- if (ut === void 0 || Y === void 0) {
1114
- const Z = a[R] + a[R + 1];
1115
- throw new Error('hex string expected, got non-hex character "' + Z + '" at index ' + R);
110
+ roundClean() {
111
+ N(tt);
112
+ }
113
+ destroy() {
114
+ this.set(0, 0, 0, 0), N(this.buffer);
115
+ }
116
+ }, qt = /* @__PURE__ */ et(() => new bt()), Ut = /* @__PURE__ */ Uint8Array.from([
117
+ 7,
118
+ 4,
119
+ 13,
120
+ 1,
121
+ 10,
122
+ 6,
123
+ 15,
124
+ 3,
125
+ 12,
126
+ 0,
127
+ 9,
128
+ 5,
129
+ 2,
130
+ 14,
131
+ 11,
132
+ 8
133
+ ]), ht = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), Et = ht.map((t) => (9 * t + 5) % 16), at = /* @__PURE__ */ (() => {
134
+ const t = [[ht], [Et]];
135
+ for (let e = 0; e < 4; e++) for (let s of t) s.push(s[e].map((h) => Ut[h]));
136
+ return t;
137
+ })(), ot = at[0], ct = at[1], lt = /* @__PURE__ */ [
138
+ [
139
+ 11,
140
+ 14,
141
+ 15,
142
+ 12,
143
+ 5,
144
+ 8,
145
+ 7,
146
+ 9,
147
+ 11,
148
+ 13,
149
+ 14,
150
+ 15,
151
+ 6,
152
+ 7,
153
+ 9,
154
+ 8
155
+ ],
156
+ [
157
+ 12,
158
+ 13,
159
+ 11,
160
+ 15,
161
+ 6,
162
+ 9,
163
+ 9,
164
+ 7,
165
+ 12,
166
+ 15,
167
+ 11,
168
+ 13,
169
+ 7,
170
+ 8,
171
+ 7,
172
+ 7
173
+ ],
174
+ [
175
+ 13,
176
+ 15,
177
+ 14,
178
+ 11,
179
+ 7,
180
+ 7,
181
+ 6,
182
+ 8,
183
+ 13,
184
+ 14,
185
+ 13,
186
+ 12,
187
+ 5,
188
+ 5,
189
+ 6,
190
+ 9
191
+ ],
192
+ [
193
+ 14,
194
+ 11,
195
+ 12,
196
+ 14,
197
+ 8,
198
+ 6,
199
+ 5,
200
+ 5,
201
+ 15,
202
+ 12,
203
+ 15,
204
+ 14,
205
+ 9,
206
+ 9,
207
+ 8,
208
+ 6
209
+ ],
210
+ [
211
+ 15,
212
+ 12,
213
+ 13,
214
+ 13,
215
+ 9,
216
+ 5,
217
+ 8,
218
+ 6,
219
+ 14,
220
+ 11,
221
+ 12,
222
+ 11,
223
+ 8,
224
+ 6,
225
+ 5,
226
+ 5
227
+ ]
228
+ ].map((t) => Uint8Array.from(t)), Ot = /* @__PURE__ */ ot.map((t, e) => t.map((s) => lt[e][s])), Ct = /* @__PURE__ */ ct.map((t, e) => t.map((s) => lt[e][s])), Dt = /* @__PURE__ */ Uint32Array.from([
229
+ 0,
230
+ 1518500249,
231
+ 1859775393,
232
+ 2400959708,
233
+ 2840853838
234
+ ]), Tt = /* @__PURE__ */ Uint32Array.from([
235
+ 1352829926,
236
+ 1548603684,
237
+ 1836072691,
238
+ 2053994217,
239
+ 0
240
+ ]), $ = /* @__PURE__ */ new Uint32Array(16), At = class extends nt {
241
+ h0 = 1732584193;
242
+ h1 = -271733879;
243
+ h2 = -1732584194;
244
+ h3 = 271733878;
245
+ h4 = -1009589776;
246
+ constructor() {
247
+ super(64, 20, 8, !0);
248
+ }
249
+ get() {
250
+ const { h0: t, h1: e, h2: s, h3: h, h4: r } = this;
251
+ return [
252
+ t,
253
+ e,
254
+ s,
255
+ h,
256
+ r
257
+ ];
258
+ }
259
+ set(t, e, s, h, r) {
260
+ this.h0 = t | 0, this.h1 = e | 0, this.h2 = s | 0, this.h3 = h | 0, this.h4 = r | 0;
261
+ }
262
+ process(t, e) {
263
+ for (let _ = 0; _ < 16; _++, e += 4) $[_] = t.getUint32(e, !0);
264
+ let s = this.h0 | 0, h = s, r = this.h1 | 0, c = r, n = this.h2 | 0, a = n, l = this.h3 | 0, f = l, I = this.h4 | 0, A = I;
265
+ for (let _ = 0; _ < 5; _++) {
266
+ const k = 4 - _, C = Dt[_], B = Tt[_], g = ot[_], T = ct[_], G = Ot[_], L = Ct[_];
267
+ for (let v = 0; v < 16; v++) {
268
+ const y = q(s + pt(_, r, n, l) + $[g[v]] + C, G[v]) + I | 0;
269
+ s = I, I = l, l = q(n, 10) | 0, n = r, r = y;
270
+ }
271
+ for (let v = 0; v < 16; v++) {
272
+ const y = q(h + pt(k, c, a, f) + $[T[v]] + B, L[v]) + A | 0;
273
+ h = A, A = f, f = q(a, 10) | 0, a = c, c = y;
1116
274
  }
1117
- O[T] = ut * 16 + Y;
1118
275
  }
1119
- return O;
276
+ this.set(this.h1 + n + f | 0, this.h2 + l + A | 0, this.h3 + I + h | 0, this.h4 + s + c | 0, this.h0 + r + a | 0);
1120
277
  }
1121
- const L = async () => {
1122
- };
1123
- t.nextTick = L;
1124
- async function m(a, _, I) {
1125
- let O = Date.now();
1126
- for (let T = 0; T < a; T++) {
1127
- I(T);
1128
- const R = Date.now() - O;
1129
- R >= 0 && R < _ || (await (0, t.nextTick)(), O += R);
1130
- }
278
+ roundClean() {
279
+ N($);
1131
280
  }
1132
- function V(a) {
1133
- if (typeof a != "string")
1134
- throw new Error("string expected");
1135
- return new Uint8Array(new TextEncoder().encode(a));
281
+ destroy() {
282
+ this.destroyed = !0, N(this.buffer), this.set(0, 0, 0, 0, 0);
283
+ }
284
+ }, Nt = /* @__PURE__ */ et(() => new At());
285
+ }));
286
+ function le(t, e = 24) {
287
+ const s = new Uint32Array(10);
288
+ for (let h = 24 - e; h < 24; h++) {
289
+ for (let n = 0; n < 10; n++) s[n] = t[n] ^ t[n + 10] ^ t[n + 20] ^ t[n + 30] ^ t[n + 40];
290
+ for (let n = 0; n < 10; n += 2) {
291
+ const a = (n + 8) % 10, l = (n + 2) % 10, f = s[l], I = s[l + 1], A = St(f, I, 1) ^ s[a], _ = It(f, I, 1) ^ s[a + 1];
292
+ for (let k = 0; k < 50; k += 10)
293
+ t[n + k] ^= A, t[n + k + 1] ^= _;
1136
294
  }
1137
- function l(a) {
1138
- return new TextDecoder().decode(a);
295
+ let r = t[2], c = t[3];
296
+ for (let n = 0; n < 24; n++) {
297
+ const a = yt[n], l = St(r, c, a), f = It(r, c, a), I = _t[n];
298
+ r = t[I], c = t[I + 1], t[I] = l, t[I + 1] = f;
299
+ }
300
+ for (let n = 0; n < 50; n += 10) {
301
+ for (let a = 0; a < 10; a++) s[a] = t[n + a];
302
+ for (let a = 0; a < 10; a++) t[n + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
303
+ }
304
+ t[0] ^= Jt[h], t[1] ^= Qt[h];
305
+ }
306
+ N(s);
307
+ }
308
+ var Ft, Y, Mt, jt, Gt, Pt, _t, yt, ft, ut, Jt, Qt, St, It, Rt, dt, fe, ue, ge = Wt((() => {
309
+ ae(), Kt(), Ft = BigInt(0), Y = BigInt(1), Mt = BigInt(2), jt = BigInt(7), Gt = BigInt(256), Pt = BigInt(113), _t = [], yt = [], ft = [];
310
+ for (let t = 0, e = Y, s = 1, h = 0; t < 24; t++) {
311
+ [s, h] = [h, (2 * s + 3 * h) % 5], _t.push(2 * (5 * h + s)), yt.push((t + 1) * (t + 2) / 2 % 64);
312
+ let r = Ft;
313
+ for (let c = 0; c < 7; c++)
314
+ e = (e << Y ^ (e >> jt) * Pt) % Gt, e & Mt && (r ^= Y << (Y << BigInt(c)) - Y);
315
+ ft.push(r);
316
+ }
317
+ ut = oe(ft, !0), Jt = ut[0], Qt = ut[1], St = (t, e, s) => s > 32 ? he(t, e, s) : ne(t, e, s), It = (t, e, s) => s > 32 ? re(t, e, s) : ie(t, e, s), Rt = class Yt {
318
+ state;
319
+ pos = 0;
320
+ posOut = 0;
321
+ finished = !1;
322
+ state32;
323
+ destroyed = !1;
324
+ blockLen;
325
+ suffix;
326
+ outputLen;
327
+ enableXOF = !1;
328
+ rounds;
329
+ constructor(e, s, h, r = !1, c = 24) {
330
+ if (this.blockLen = e, this.suffix = s, this.outputLen = h, this.enableXOF = r, this.rounds = c, wt(h, "outputLen"), !(0 < e && e < 200)) throw new Error("only keccak-f1600 function is supported");
331
+ this.state = new Uint8Array(200), this.state32 = ee(this.state);
1139
332
  }
1140
- function b(a) {
1141
- return typeof a == "string" && (a = V(a)), n(a), a;
333
+ clone() {
334
+ return this._cloneInto();
1142
335
  }
1143
- function x(a) {
1144
- return typeof a == "string" && (a = V(a)), n(a), a;
336
+ keccak() {
337
+ Bt(this.state32), le(this.state32, this.rounds), Bt(this.state32), this.posOut = 0, this.pos = 0;
1145
338
  }
1146
- function C(...a) {
1147
- let _ = 0;
1148
- for (let O = 0; O < a.length; O++) {
1149
- const T = a[O];
1150
- n(T), _ += T.length;
339
+ update(e) {
340
+ Lt(this), mt(e);
341
+ const { blockLen: s, state: h } = this, r = e.length;
342
+ for (let c = 0; c < r; ) {
343
+ const n = Math.min(s - this.pos, r - c);
344
+ for (let a = 0; a < n; a++) h[this.pos++] ^= e[c++];
345
+ this.pos === s && this.keccak();
1151
346
  }
1152
- const I = new Uint8Array(_);
1153
- for (let O = 0, T = 0; O < a.length; O++) {
1154
- const R = a[O];
1155
- I.set(R, T), T += R.length;
347
+ return this;
348
+ }
349
+ finish() {
350
+ if (this.finished) return;
351
+ this.finished = !0;
352
+ const { state: e, suffix: s, pos: h, blockLen: r } = this;
353
+ e[h] ^= s, (s & 128) !== 0 && h === r - 1 && this.keccak(), e[r - 1] ^= 128, this.keccak();
354
+ }
355
+ writeInto(e) {
356
+ Lt(this, !1), mt(e), this.finish();
357
+ const s = this.state, { blockLen: h } = this;
358
+ for (let r = 0, c = e.length; r < c; ) {
359
+ this.posOut >= h && this.keccak();
360
+ const n = Math.min(h - this.posOut, c - r);
361
+ e.set(s.subarray(this.posOut, this.posOut + n), r), this.posOut += n, r += n;
1156
362
  }
1157
- return I;
363
+ return e;
1158
364
  }
1159
- function w(a, _) {
1160
- if (_ !== void 0 && {}.toString.call(_) !== "[object Object]")
1161
- throw new Error("options should be object or undefined");
1162
- return Object.assign(a, _);
365
+ xofInto(e) {
366
+ if (!this.enableXOF) throw new Error("XOF is not possible for this instance");
367
+ return this.writeInto(e);
1163
368
  }
1164
- class k {
369
+ xof(e) {
370
+ return wt(e), this.xofInto(new Uint8Array(e));
1165
371
  }
1166
- t.Hash = k;
1167
- function v(a) {
1168
- const _ = (O) => a().update(b(O)).digest(), I = a();
1169
- return _.outputLen = I.outputLen, _.blockLen = I.blockLen, _.create = () => a(), _;
372
+ digestInto(e) {
373
+ if (te(e, this), this.finished) throw new Error("digest() was already called");
374
+ return this.writeInto(e), this.destroy(), e;
1170
375
  }
1171
- function j(a) {
1172
- const _ = (O, T) => a(T).update(b(O)).digest(), I = a({});
1173
- return _.outputLen = I.outputLen, _.blockLen = I.blockLen, _.create = (O) => a(O), _;
376
+ digest() {
377
+ return this.digestInto(new Uint8Array(this.outputLen));
1174
378
  }
1175
- function P(a) {
1176
- const _ = (O, T) => a(T).update(b(O)).digest(), I = a({});
1177
- return _.outputLen = I.outputLen, _.blockLen = I.blockLen, _.create = (O) => a(O), _;
379
+ destroy() {
380
+ this.destroyed = !0, N(this.state);
381
+ }
382
+ _cloneInto(e) {
383
+ const { blockLen: s, suffix: h, outputLen: r, rounds: c, enableXOF: n } = this;
384
+ return e ||= new Yt(s, h, r, n, c), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = c, e.suffix = h, e.outputLen = r, e.enableXOF = n, e.destroyed = this.destroyed, e;
385
+ }
386
+ }, dt = (t, e, s, h = {}) => et((r = {}) => new Rt(e, t, r.dkLen === void 0 ? s : r.dkLen, !0), h), fe = /* @__PURE__ */ dt(31, 168, 16, /* @__PURE__ */ vt(11)), ue = /* @__PURE__ */ dt(31, 136, 32, /* @__PURE__ */ vt(12));
387
+ })), de = /* @__PURE__ */ X(((t) => {
388
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.crypto = void 0, t.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
389
+ })), st = /* @__PURE__ */ X(((t) => {
390
+ 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 = h, t.abytes = r, t.ahash = c, t.aexists = n, t.aoutput = a, t.u8 = l, t.u32 = f, t.clean = I, t.createView = A, t.rotr = _, t.rotl = k, t.byteSwap = C, t.byteSwap32 = B, t.bytesToHex = G, t.hexToBytes = y, t.asyncLoop = V, t.utf8ToBytes = m, t.bytesToUtf8 = E, t.toBytes = o, t.kdfInputToBytes = H, t.concatBytes = u, t.checkOpts = b, t.createHasher = O, t.createOptHasher = F, t.createXOFer = j, t.randomBytes = P;
391
+ var e = de();
392
+ function s(i) {
393
+ return i instanceof Uint8Array || ArrayBuffer.isView(i) && i.constructor.name === "Uint8Array";
394
+ }
395
+ function h(i) {
396
+ if (!Number.isSafeInteger(i) || i < 0) throw new Error("positive integer expected, got " + i);
397
+ }
398
+ function r(i, ...d) {
399
+ if (!s(i)) throw new Error("Uint8Array expected");
400
+ if (d.length > 0 && !d.includes(i.length)) throw new Error("Uint8Array expected of length " + d + ", got length=" + i.length);
401
+ }
402
+ function c(i) {
403
+ if (typeof i != "function" || typeof i.create != "function") throw new Error("Hash should be wrapped by utils.createHasher");
404
+ h(i.outputLen), h(i.blockLen);
405
+ }
406
+ function n(i, d = !0) {
407
+ if (i.destroyed) throw new Error("Hash instance has been destroyed");
408
+ if (d && i.finished) throw new Error("Hash#digest() has already been called");
409
+ }
410
+ function a(i, d) {
411
+ r(i);
412
+ const S = d.outputLen;
413
+ if (i.length < S) throw new Error("digestInto() expects output buffer of length at least " + S);
414
+ }
415
+ function l(i) {
416
+ return new Uint8Array(i.buffer, i.byteOffset, i.byteLength);
417
+ }
418
+ function f(i) {
419
+ return new Uint32Array(i.buffer, i.byteOffset, Math.floor(i.byteLength / 4));
420
+ }
421
+ function I(...i) {
422
+ for (let d = 0; d < i.length; d++) i[d].fill(0);
423
+ }
424
+ function A(i) {
425
+ return new DataView(i.buffer, i.byteOffset, i.byteLength);
426
+ }
427
+ function _(i, d) {
428
+ return i << 32 - d | i >>> d;
429
+ }
430
+ function k(i, d) {
431
+ return i << d | i >>> 32 - d >>> 0;
432
+ }
433
+ t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
434
+ function C(i) {
435
+ return i << 24 & 4278190080 | i << 8 & 16711680 | i >>> 8 & 65280 | i >>> 24 & 255;
436
+ }
437
+ t.swap8IfBE = t.isLE ? (i) => i : (i) => C(i), t.byteSwapIfBE = t.swap8IfBE;
438
+ function B(i) {
439
+ for (let d = 0; d < i.length; d++) i[d] = C(i[d]);
440
+ return i;
441
+ }
442
+ t.swap32IfBE = t.isLE ? (i) => i : B;
443
+ var g = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", T = /* @__PURE__ */ Array.from({ length: 256 }, (i, d) => d.toString(16).padStart(2, "0"));
444
+ function G(i) {
445
+ if (r(i), g) return i.toHex();
446
+ let d = "";
447
+ for (let S = 0; S < i.length; S++) d += T[i[S]];
448
+ return d;
449
+ }
450
+ var L = {
451
+ _0: 48,
452
+ _9: 57,
453
+ A: 65,
454
+ F: 70,
455
+ a: 97,
456
+ f: 102
457
+ };
458
+ function v(i) {
459
+ if (i >= L._0 && i <= L._9) return i - L._0;
460
+ if (i >= L.A && i <= L.F) return i - (L.A - 10);
461
+ if (i >= L.a && i <= L.f) return i - (L.a - 10);
462
+ }
463
+ function y(i) {
464
+ if (typeof i != "string") throw new Error("hex string expected, got " + typeof i);
465
+ if (g) return Uint8Array.fromHex(i);
466
+ const d = i.length, S = d / 2;
467
+ if (d % 2) throw new Error("hex string expected, got unpadded hex of length " + d);
468
+ const U = new Uint8Array(S);
469
+ for (let D = 0, M = 0; D < S; D++, M += 2) {
470
+ const Q = v(i.charCodeAt(M)), R = v(i.charCodeAt(M + 1));
471
+ if (Q === void 0 || R === void 0) {
472
+ const W = i[M] + i[M + 1];
473
+ throw new Error('hex string expected, got non-hex character "' + W + '" at index ' + M);
474
+ }
475
+ U[D] = Q * 16 + R;
1178
476
  }
1179
- t.wrapConstructor = v, t.wrapConstructorWithOpts = j, t.wrapXOFConstructorWithOpts = P;
1180
- function Q(a = 32) {
1181
- if (e.crypto && typeof e.crypto.getRandomValues == "function")
1182
- return e.crypto.getRandomValues(new Uint8Array(a));
1183
- if (e.crypto && typeof e.crypto.randomBytes == "function")
1184
- return Uint8Array.from(e.crypto.randomBytes(a));
1185
- throw new Error("crypto.getRandomValues must be defined");
477
+ return U;
478
+ }
479
+ var w = async () => {
480
+ };
481
+ t.nextTick = w;
482
+ async function V(i, d, S) {
483
+ let U = Date.now();
484
+ for (let D = 0; D < i; D++) {
485
+ S(D);
486
+ const M = Date.now() - U;
487
+ M >= 0 && M < d || (await (0, t.nextTick)(), U += M);
1186
488
  }
1187
- })(Tt)), Tt;
1188
- }
1189
- var zt;
1190
- function E0() {
1191
- if (zt) return X;
1192
- zt = 1, Object.defineProperty(X, "__esModule", { value: !0 }), X.SHA512_IV = X.SHA384_IV = X.SHA224_IV = X.SHA256_IV = X.HashMD = void 0, X.setBigUint64 = e, X.Chi = s, X.Maj = i;
1193
- const t = /* @__PURE__ */ Ct();
1194
- function e(r, c, o, h) {
1195
- if (typeof r.setBigUint64 == "function")
1196
- return r.setBigUint64(c, o, h);
1197
- const u = BigInt(32), d = BigInt(4294967295), f = Number(o >> u & d), y = Number(o & d), p = h ? 4 : 0, g = h ? 0 : 4;
1198
- r.setUint32(c + p, f, h), r.setUint32(c + g, y, h);
1199
489
  }
1200
- function s(r, c, o) {
1201
- return r & c ^ ~r & o;
490
+ function m(i) {
491
+ if (typeof i != "string") throw new Error("string expected");
492
+ return new Uint8Array(new TextEncoder().encode(i));
1202
493
  }
1203
- function i(r, c, o) {
1204
- return r & c ^ r & o ^ c & o;
494
+ function E(i) {
495
+ return new TextDecoder().decode(i);
1205
496
  }
1206
- class n extends t.Hash {
1207
- constructor(c, o, h, u) {
1208
- super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = c, this.outputLen = o, this.padOffset = h, this.isLE = u, this.buffer = new Uint8Array(c), this.view = (0, t.createView)(this.buffer);
1209
- }
1210
- update(c) {
1211
- (0, t.aexists)(this), c = (0, t.toBytes)(c), (0, t.abytes)(c);
1212
- const { view: o, buffer: h, blockLen: u } = this, d = c.length;
1213
- for (let f = 0; f < d; ) {
1214
- const y = Math.min(u - this.pos, d - f);
1215
- if (y === u) {
1216
- const p = (0, t.createView)(c);
1217
- for (; u <= d - f; f += u)
1218
- this.process(p, f);
497
+ function o(i) {
498
+ return typeof i == "string" && (i = m(i)), r(i), i;
499
+ }
500
+ function H(i) {
501
+ return typeof i == "string" && (i = m(i)), r(i), i;
502
+ }
503
+ function u(...i) {
504
+ let d = 0;
505
+ for (let U = 0; U < i.length; U++) {
506
+ const D = i[U];
507
+ r(D), d += D.length;
508
+ }
509
+ const S = new Uint8Array(d);
510
+ for (let U = 0, D = 0; U < i.length; U++) {
511
+ const M = i[U];
512
+ S.set(M, D), D += M.length;
513
+ }
514
+ return S;
515
+ }
516
+ function b(i, d) {
517
+ if (d !== void 0 && {}.toString.call(d) !== "[object Object]") throw new Error("options should be object or undefined");
518
+ return Object.assign(i, d);
519
+ }
520
+ var p = class {
521
+ };
522
+ t.Hash = p;
523
+ function O(i) {
524
+ const d = (U) => i().update(o(U)).digest(), S = i();
525
+ return d.outputLen = S.outputLen, d.blockLen = S.blockLen, d.create = () => i(), d;
526
+ }
527
+ function F(i) {
528
+ const d = (U, D) => i(D).update(o(U)).digest(), S = i({});
529
+ return d.outputLen = S.outputLen, d.blockLen = S.blockLen, d.create = (U) => i(U), d;
530
+ }
531
+ function j(i) {
532
+ const d = (U, D) => i(D).update(o(U)).digest(), S = i({});
533
+ return d.outputLen = S.outputLen, d.blockLen = S.blockLen, d.create = (U) => i(U), d;
534
+ }
535
+ t.wrapConstructor = O, t.wrapConstructorWithOpts = F, t.wrapXOFConstructorWithOpts = j;
536
+ function P(i = 32) {
537
+ if (e.crypto && typeof e.crypto.getRandomValues == "function") return e.crypto.getRandomValues(new Uint8Array(i));
538
+ if (e.crypto && typeof e.crypto.randomBytes == "function") return Uint8Array.from(e.crypto.randomBytes(i));
539
+ throw new Error("crypto.getRandomValues must be defined");
540
+ }
541
+ })), He = /* @__PURE__ */ X(((t) => {
542
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.SHA512_IV = t.SHA384_IV = t.SHA224_IV = t.SHA256_IV = t.HashMD = void 0, t.setBigUint64 = s, t.Chi = h, t.Maj = r;
543
+ var e = st();
544
+ function s(n, a, l, f) {
545
+ if (typeof n.setBigUint64 == "function") return n.setBigUint64(a, l, f);
546
+ const I = BigInt(32), A = BigInt(4294967295), _ = Number(l >> I & A), k = Number(l & A), C = f ? 4 : 0, B = f ? 0 : 4;
547
+ n.setUint32(a + C, _, f), n.setUint32(a + B, k, f);
548
+ }
549
+ function h(n, a, l) {
550
+ return n & a ^ ~n & l;
551
+ }
552
+ function r(n, a, l) {
553
+ return n & a ^ n & l ^ a & l;
554
+ }
555
+ var c = class extends e.Hash {
556
+ constructor(n, a, l, f) {
557
+ super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = n, this.outputLen = a, this.padOffset = l, this.isLE = f, this.buffer = new Uint8Array(n), this.view = (0, e.createView)(this.buffer);
558
+ }
559
+ update(n) {
560
+ (0, e.aexists)(this), n = (0, e.toBytes)(n), (0, e.abytes)(n);
561
+ const { view: a, buffer: l, blockLen: f } = this, I = n.length;
562
+ for (let A = 0; A < I; ) {
563
+ const _ = Math.min(f - this.pos, I - A);
564
+ if (_ === f) {
565
+ const k = (0, e.createView)(n);
566
+ for (; f <= I - A; A += f) this.process(k, A);
1219
567
  continue;
1220
568
  }
1221
- h.set(c.subarray(f, f + y), this.pos), this.pos += y, f += y, this.pos === u && (this.process(o, 0), this.pos = 0);
569
+ l.set(n.subarray(A, A + _), this.pos), this.pos += _, A += _, this.pos === f && (this.process(a, 0), this.pos = 0);
1222
570
  }
1223
- return this.length += c.length, this.roundClean(), this;
1224
- }
1225
- digestInto(c) {
1226
- (0, t.aexists)(this), (0, t.aoutput)(c, this), this.finished = !0;
1227
- const { buffer: o, view: h, blockLen: u, isLE: d } = this;
1228
- let { pos: f } = this;
1229
- o[f++] = 128, (0, t.clean)(this.buffer.subarray(f)), this.padOffset > u - f && (this.process(h, 0), f = 0);
1230
- for (let U = f; U < u; U++)
1231
- o[U] = 0;
1232
- e(h, u - 8, BigInt(this.length * 8), d), this.process(h, 0);
1233
- const y = (0, t.createView)(c), p = this.outputLen;
1234
- if (p % 4)
1235
- throw new Error("_sha2: outputLen should be aligned to 32bit");
1236
- const g = p / 4, S = this.get();
1237
- if (g > S.length)
1238
- throw new Error("_sha2: outputLen bigger than state");
1239
- for (let U = 0; U < g; U++)
1240
- y.setUint32(4 * U, S[U], d);
571
+ return this.length += n.length, this.roundClean(), this;
572
+ }
573
+ digestInto(n) {
574
+ (0, e.aexists)(this), (0, e.aoutput)(n, this), this.finished = !0;
575
+ const { buffer: a, view: l, blockLen: f, isLE: I } = this;
576
+ let { pos: A } = this;
577
+ a[A++] = 128, (0, e.clean)(this.buffer.subarray(A)), this.padOffset > f - A && (this.process(l, 0), A = 0);
578
+ for (let g = A; g < f; g++) a[g] = 0;
579
+ s(l, f - 8, BigInt(this.length * 8), I), this.process(l, 0);
580
+ const _ = (0, e.createView)(n), k = this.outputLen;
581
+ if (k % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
582
+ const C = k / 4, B = this.get();
583
+ if (C > B.length) throw new Error("_sha2: outputLen bigger than state");
584
+ for (let g = 0; g < C; g++) _.setUint32(4 * g, B[g], I);
1241
585
  }
1242
586
  digest() {
1243
- const { buffer: c, outputLen: o } = this;
1244
- this.digestInto(c);
1245
- const h = c.slice(0, o);
1246
- return this.destroy(), h;
587
+ const { buffer: n, outputLen: a } = this;
588
+ this.digestInto(n);
589
+ const l = n.slice(0, a);
590
+ return this.destroy(), l;
1247
591
  }
1248
- _cloneInto(c) {
1249
- c || (c = new this.constructor()), c.set(...this.get());
1250
- const { blockLen: o, buffer: h, length: u, finished: d, destroyed: f, pos: y } = this;
1251
- return c.destroyed = f, c.finished = d, c.length = u, c.pos = y, u % o && c.buffer.set(h), c;
592
+ _cloneInto(n) {
593
+ n || (n = new this.constructor()), n.set(...this.get());
594
+ const { blockLen: a, buffer: l, length: f, finished: I, destroyed: A, pos: _ } = this;
595
+ return n.destroyed = A, n.finished = I, n.length = f, n.pos = _, f % a && n.buffer.set(l), n;
1252
596
  }
1253
597
  clone() {
1254
598
  return this._cloneInto();
1255
599
  }
1256
- }
1257
- return X.HashMD = n, X.SHA256_IV = Uint32Array.from([
600
+ };
601
+ t.HashMD = c, t.SHA256_IV = Uint32Array.from([
1258
602
  1779033703,
1259
603
  3144134277,
1260
604
  1013904242,
@@ -1263,7 +607,7 @@ function E0() {
1263
607
  2600822924,
1264
608
  528734635,
1265
609
  1541459225
1266
- ]), X.SHA224_IV = Uint32Array.from([
610
+ ]), t.SHA224_IV = Uint32Array.from([
1267
611
  3238371032,
1268
612
  914150663,
1269
613
  812702999,
@@ -1272,7 +616,7 @@ function E0() {
1272
616
  1750603025,
1273
617
  1694076839,
1274
618
  3204075428
1275
- ]), X.SHA384_IV = Uint32Array.from([
619
+ ]), t.SHA384_IV = Uint32Array.from([
1276
620
  3418070365,
1277
621
  3238371032,
1278
622
  1654270250,
@@ -1289,7 +633,7 @@ function E0() {
1289
633
  1694076839,
1290
634
  1203062813,
1291
635
  3204075428
1292
- ]), X.SHA512_IV = Uint32Array.from([
636
+ ]), t.SHA512_IV = Uint32Array.from([
1293
637
  1779033703,
1294
638
  4089235720,
1295
639
  3144134277,
@@ -1306,98 +650,101 @@ function E0() {
1306
650
  4215389547,
1307
651
  1541459225,
1308
652
  327033209
1309
- ]), X;
1310
- }
1311
- var B = {}, $t;
1312
- function V0() {
1313
- if ($t) return B;
1314
- $t = 1, Object.defineProperty(B, "__esModule", { value: !0 }), B.toBig = B.shrSL = B.shrSH = B.rotrSL = B.rotrSH = B.rotrBL = B.rotrBH = B.rotr32L = B.rotr32H = B.rotlSL = B.rotlSH = B.rotlBL = B.rotlBH = B.add5L = B.add5H = B.add4L = B.add4H = B.add3L = B.add3H = void 0, B.add = M, B.fromBig = s, B.split = i;
1315
- const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
1316
- function s(l, b = !1) {
1317
- return b ? { h: Number(l & t), l: Number(l >> e & t) } : { h: Number(l >> e & t) | 0, l: Number(l & t) | 0 };
1318
- }
1319
- function i(l, b = !1) {
1320
- const x = l.length;
1321
- let C = new Uint32Array(x), w = new Uint32Array(x);
1322
- for (let k = 0; k < x; k++) {
1323
- const { h: v, l: j } = s(l[k], b);
1324
- [C[k], w[k]] = [v, j];
1325
- }
1326
- return [C, w];
653
+ ]);
654
+ })), be = /* @__PURE__ */ X(((t) => {
655
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.toBig = t.shrSL = t.shrSH = t.rotrSL = t.rotrSH = t.rotrBL = t.rotrBH = t.rotr32L = t.rotr32H = t.rotlSL = t.rotlSH = t.rotlBL = t.rotlBH = t.add5L = t.add5H = t.add4L = t.add4H = t.add3L = t.add3H = void 0, t.add = G, t.fromBig = h, t.split = r;
656
+ var e = /* @__PURE__ */ BigInt(2 ** 32 - 1), s = /* @__PURE__ */ BigInt(32);
657
+ function h(o, H = !1) {
658
+ return H ? {
659
+ h: Number(o & e),
660
+ l: Number(o >> s & e)
661
+ } : {
662
+ h: Number(o >> s & e) | 0,
663
+ l: Number(o & e) | 0
664
+ };
1327
665
  }
1328
- const n = (l, b) => BigInt(l >>> 0) << e | BigInt(b >>> 0);
1329
- B.toBig = n;
1330
- const r = (l, b, x) => l >>> x;
1331
- B.shrSH = r;
1332
- const c = (l, b, x) => l << 32 - x | b >>> x;
1333
- B.shrSL = c;
1334
- const o = (l, b, x) => l >>> x | b << 32 - x;
1335
- B.rotrSH = o;
1336
- const h = (l, b, x) => l << 32 - x | b >>> x;
1337
- B.rotrSL = h;
1338
- const u = (l, b, x) => l << 64 - x | b >>> x - 32;
1339
- B.rotrBH = u;
1340
- const d = (l, b, x) => l >>> x - 32 | b << 64 - x;
1341
- B.rotrBL = d;
1342
- const f = (l, b) => b;
1343
- B.rotr32H = f;
1344
- const y = (l, b) => l;
1345
- B.rotr32L = y;
1346
- const p = (l, b, x) => l << x | b >>> 32 - x;
1347
- B.rotlSH = p;
1348
- const g = (l, b, x) => b << x | l >>> 32 - x;
1349
- B.rotlSL = g;
1350
- const S = (l, b, x) => b << x - 32 | l >>> 64 - x;
1351
- B.rotlBH = S;
1352
- const U = (l, b, x) => l << x - 32 | b >>> 64 - x;
1353
- B.rotlBL = U;
1354
- function M(l, b, x, C) {
1355
- const w = (b >>> 0) + (C >>> 0);
1356
- return { h: l + x + (w / 2 ** 32 | 0) | 0, l: w | 0 };
666
+ function r(o, H = !1) {
667
+ const u = o.length;
668
+ let b = new Uint32Array(u), p = new Uint32Array(u);
669
+ for (let O = 0; O < u; O++) {
670
+ const { h: F, l: j } = h(o[O], H);
671
+ [b[O], p[O]] = [F, j];
672
+ }
673
+ return [b, p];
674
+ }
675
+ var c = (o, H) => BigInt(o >>> 0) << s | BigInt(H >>> 0);
676
+ t.toBig = c;
677
+ var n = (o, H, u) => o >>> u;
678
+ t.shrSH = n;
679
+ var a = (o, H, u) => o << 32 - u | H >>> u;
680
+ t.shrSL = a;
681
+ var l = (o, H, u) => o >>> u | H << 32 - u;
682
+ t.rotrSH = l;
683
+ var f = (o, H, u) => o << 32 - u | H >>> u;
684
+ t.rotrSL = f;
685
+ var I = (o, H, u) => o << 64 - u | H >>> u - 32;
686
+ t.rotrBH = I;
687
+ var A = (o, H, u) => o >>> u - 32 | H << 64 - u;
688
+ t.rotrBL = A;
689
+ var _ = (o, H) => H;
690
+ t.rotr32H = _;
691
+ var k = (o, H) => o;
692
+ t.rotr32L = k;
693
+ var C = (o, H, u) => o << u | H >>> 32 - u;
694
+ t.rotlSH = C;
695
+ var B = (o, H, u) => H << u | o >>> 32 - u;
696
+ t.rotlSL = B;
697
+ var g = (o, H, u) => H << u - 32 | o >>> 64 - u;
698
+ t.rotlBH = g;
699
+ var T = (o, H, u) => o << u - 32 | H >>> 64 - u;
700
+ t.rotlBL = T;
701
+ function G(o, H, u, b) {
702
+ const p = (H >>> 0) + (b >>> 0);
703
+ return {
704
+ h: o + u + (p / 2 ** 32 | 0) | 0,
705
+ l: p | 0
706
+ };
1357
707
  }
1358
- const D = (l, b, x) => (l >>> 0) + (b >>> 0) + (x >>> 0);
1359
- B.add3L = D;
1360
- const H = (l, b, x, C) => b + x + C + (l / 2 ** 32 | 0) | 0;
1361
- B.add3H = H;
1362
- const E = (l, b, x, C) => (l >>> 0) + (b >>> 0) + (x >>> 0) + (C >>> 0);
1363
- B.add4L = E;
1364
- const A = (l, b, x, C, w) => b + x + C + w + (l / 2 ** 32 | 0) | 0;
1365
- B.add4H = A;
1366
- const L = (l, b, x, C, w) => (l >>> 0) + (b >>> 0) + (x >>> 0) + (C >>> 0) + (w >>> 0);
1367
- B.add5L = L;
1368
- const m = (l, b, x, C, w, k) => b + x + C + w + k + (l / 2 ** 32 | 0) | 0;
1369
- B.add5H = m;
1370
- const V = {
1371
- fromBig: s,
1372
- split: i,
1373
- toBig: n,
1374
- shrSH: r,
1375
- shrSL: c,
1376
- rotrSH: o,
1377
- rotrSL: h,
1378
- rotrBH: u,
1379
- rotrBL: d,
1380
- rotr32H: f,
1381
- rotr32L: y,
1382
- rotlSH: p,
1383
- rotlSL: g,
1384
- rotlBH: S,
1385
- rotlBL: U,
1386
- add: M,
1387
- add3L: D,
1388
- add3H: H,
1389
- add4L: E,
1390
- add4H: A,
708
+ var L = (o, H, u) => (o >>> 0) + (H >>> 0) + (u >>> 0);
709
+ t.add3L = L;
710
+ var v = (o, H, u, b) => H + u + b + (o / 2 ** 32 | 0) | 0;
711
+ t.add3H = v;
712
+ var y = (o, H, u, b) => (o >>> 0) + (H >>> 0) + (u >>> 0) + (b >>> 0);
713
+ t.add4L = y;
714
+ var w = (o, H, u, b, p) => H + u + b + p + (o / 2 ** 32 | 0) | 0;
715
+ t.add4H = w;
716
+ var V = (o, H, u, b, p) => (o >>> 0) + (H >>> 0) + (u >>> 0) + (b >>> 0) + (p >>> 0);
717
+ t.add5L = V;
718
+ var m = (o, H, u, b, p, O) => H + u + b + p + O + (o / 2 ** 32 | 0) | 0;
719
+ t.add5H = m;
720
+ var E = {
721
+ fromBig: h,
722
+ split: r,
723
+ toBig: c,
724
+ shrSH: n,
725
+ shrSL: a,
726
+ rotrSH: l,
727
+ rotrSL: f,
728
+ rotrBH: I,
729
+ rotrBL: A,
730
+ rotr32H: _,
731
+ rotr32L: k,
732
+ rotlSH: C,
733
+ rotlSL: B,
734
+ rotlBH: g,
735
+ rotlBL: T,
736
+ add: G,
737
+ add3L: L,
738
+ add3H: v,
739
+ add4L: y,
740
+ add4H: w,
1391
741
  add5H: m,
1392
- add5L: L
742
+ add5L: V
1393
743
  };
1394
- return B.default = V, B;
1395
- }
1396
- var te;
1397
- function Ce() {
1398
- if (te) return F;
1399
- te = 1, Object.defineProperty(F, "__esModule", { value: !0 }), F.sha512_224 = F.sha512_256 = F.sha384 = F.sha512 = F.sha224 = F.sha256 = F.SHA512_256 = F.SHA512_224 = F.SHA384 = F.SHA512 = F.SHA224 = F.SHA256 = void 0;
1400
- const t = /* @__PURE__ */ E0(), e = /* @__PURE__ */ V0(), s = /* @__PURE__ */ Ct(), i = /* @__PURE__ */ Uint32Array.from([
744
+ t.default = E;
745
+ })), Zt = /* @__PURE__ */ X(((t) => {
746
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.sha512_224 = t.sha512_256 = t.sha384 = t.sha512 = t.sha224 = t.sha256 = t.SHA512_256 = t.SHA512_224 = t.SHA384 = t.SHA512 = t.SHA224 = t.SHA256 = void 0;
747
+ var e = He(), s = be(), h = st(), r = /* @__PURE__ */ Uint32Array.from([
1401
748
  1116352408,
1402
749
  1899447441,
1403
750
  3049323471,
@@ -1462,48 +809,54 @@ function Ce() {
1462
809
  2756734187,
1463
810
  3204031479,
1464
811
  3329325298
1465
- ]), n = /* @__PURE__ */ new Uint32Array(64);
1466
- class r extends t.HashMD {
1467
- constructor(H = 32) {
1468
- super(64, H, 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;
812
+ ]), c = /* @__PURE__ */ new Uint32Array(64), n = class extends e.HashMD {
813
+ constructor(L = 32) {
814
+ super(64, L, 8, !1), this.A = e.SHA256_IV[0] | 0, this.B = e.SHA256_IV[1] | 0, this.C = e.SHA256_IV[2] | 0, this.D = e.SHA256_IV[3] | 0, this.E = e.SHA256_IV[4] | 0, this.F = e.SHA256_IV[5] | 0, this.G = e.SHA256_IV[6] | 0, this.H = e.SHA256_IV[7] | 0;
1469
815
  }
1470
816
  get() {
1471
- const { A: H, B: E, C: A, D: L, E: m, F: V, G: l, H: b } = this;
1472
- return [H, E, A, L, m, V, l, b];
1473
- }
1474
- // prettier-ignore
1475
- set(H, E, A, L, m, V, l, b) {
1476
- this.A = H | 0, this.B = E | 0, this.C = A | 0, this.D = L | 0, this.E = m | 0, this.F = V | 0, this.G = l | 0, this.H = b | 0;
1477
- }
1478
- process(H, E) {
1479
- for (let w = 0; w < 16; w++, E += 4)
1480
- n[w] = H.getUint32(E, !1);
1481
- for (let w = 16; w < 64; w++) {
1482
- const k = n[w - 15], v = n[w - 2], j = (0, s.rotr)(k, 7) ^ (0, s.rotr)(k, 18) ^ k >>> 3, P = (0, s.rotr)(v, 17) ^ (0, s.rotr)(v, 19) ^ v >>> 10;
1483
- n[w] = P + n[w - 7] + j + n[w - 16] | 0;
817
+ const { A: L, B: v, C: y, D: w, E: V, F: m, G: E, H: o } = this;
818
+ return [
819
+ L,
820
+ v,
821
+ y,
822
+ w,
823
+ V,
824
+ m,
825
+ E,
826
+ o
827
+ ];
828
+ }
829
+ set(L, v, y, w, V, m, E, o) {
830
+ this.A = L | 0, this.B = v | 0, this.C = y | 0, this.D = w | 0, this.E = V | 0, this.F = m | 0, this.G = E | 0, this.H = o | 0;
831
+ }
832
+ process(L, v) {
833
+ for (let b = 0; b < 16; b++, v += 4) c[b] = L.getUint32(v, !1);
834
+ for (let b = 16; b < 64; b++) {
835
+ const p = c[b - 15], O = c[b - 2], F = (0, h.rotr)(p, 7) ^ (0, h.rotr)(p, 18) ^ p >>> 3;
836
+ c[b] = ((0, h.rotr)(O, 17) ^ (0, h.rotr)(O, 19) ^ O >>> 10) + c[b - 7] + F + c[b - 16] | 0;
1484
837
  }
1485
- let { A, B: L, C: m, D: V, E: l, F: b, G: x, H: C } = this;
1486
- for (let w = 0; w < 64; w++) {
1487
- const k = (0, s.rotr)(l, 6) ^ (0, s.rotr)(l, 11) ^ (0, s.rotr)(l, 25), v = C + k + (0, t.Chi)(l, b, x) + i[w] + n[w] | 0, P = ((0, s.rotr)(A, 2) ^ (0, s.rotr)(A, 13) ^ (0, s.rotr)(A, 22)) + (0, t.Maj)(A, L, m) | 0;
1488
- C = x, x = b, b = l, l = V + v | 0, V = m, m = L, L = A, A = v + P | 0;
838
+ let { A: y, B: w, C: V, D: m, E, F: o, G: H, H: u } = this;
839
+ for (let b = 0; b < 64; b++) {
840
+ const p = (0, h.rotr)(E, 6) ^ (0, h.rotr)(E, 11) ^ (0, h.rotr)(E, 25), O = u + p + (0, e.Chi)(E, o, H) + r[b] + c[b] | 0, F = ((0, h.rotr)(y, 2) ^ (0, h.rotr)(y, 13) ^ (0, h.rotr)(y, 22)) + (0, e.Maj)(y, w, V) | 0;
841
+ u = H, H = o, o = E, E = m + O | 0, m = V, V = w, w = y, y = O + F | 0;
1489
842
  }
1490
- A = A + this.A | 0, L = L + this.B | 0, m = m + this.C | 0, V = V + this.D | 0, l = l + this.E | 0, b = b + this.F | 0, x = x + this.G | 0, C = C + this.H | 0, this.set(A, L, m, V, l, b, x, C);
843
+ y = y + this.A | 0, w = w + this.B | 0, V = V + this.C | 0, m = m + this.D | 0, E = E + this.E | 0, o = o + this.F | 0, H = H + this.G | 0, u = u + this.H | 0, this.set(y, w, V, m, E, o, H, u);
1491
844
  }
1492
845
  roundClean() {
1493
- (0, s.clean)(n);
846
+ (0, h.clean)(c);
1494
847
  }
1495
848
  destroy() {
1496
- this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
849
+ this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, h.clean)(this.buffer);
1497
850
  }
1498
- }
1499
- F.SHA256 = r;
1500
- class c extends r {
851
+ };
852
+ t.SHA256 = n;
853
+ var a = class extends n {
1501
854
  constructor() {
1502
- 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;
855
+ super(28), this.A = e.SHA224_IV[0] | 0, this.B = e.SHA224_IV[1] | 0, this.C = e.SHA224_IV[2] | 0, this.D = e.SHA224_IV[3] | 0, this.E = e.SHA224_IV[4] | 0, this.F = e.SHA224_IV[5] | 0, this.G = e.SHA224_IV[6] | 0, this.H = e.SHA224_IV[7] | 0;
1503
856
  }
1504
- }
1505
- F.SHA224 = c;
1506
- const o = e.split([
857
+ };
858
+ t.SHA224 = a;
859
+ var l = s.split([
1507
860
  "0x428a2f98d728ae22",
1508
861
  "0x7137449123ef65cd",
1509
862
  "0xb5c0fbcfec4d3b2f",
@@ -1584,51 +937,65 @@ function Ce() {
1584
937
  "0x597f299cfc657e2a",
1585
938
  "0x5fcb6fab3ad6faec",
1586
939
  "0x6c44198c4a475817"
1587
- ].map((D) => BigInt(D))), h = o[0], u = o[1], d = /* @__PURE__ */ new Uint32Array(80), f = /* @__PURE__ */ new Uint32Array(80);
1588
- class y extends t.HashMD {
1589
- constructor(H = 64) {
1590
- super(128, H, 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;
940
+ ].map((L) => BigInt(L))), f = l[0], I = l[1], A = /* @__PURE__ */ new Uint32Array(80), _ = /* @__PURE__ */ new Uint32Array(80), k = class extends e.HashMD {
941
+ constructor(L = 64) {
942
+ super(128, L, 16, !1), this.Ah = e.SHA512_IV[0] | 0, this.Al = e.SHA512_IV[1] | 0, this.Bh = e.SHA512_IV[2] | 0, this.Bl = e.SHA512_IV[3] | 0, this.Ch = e.SHA512_IV[4] | 0, this.Cl = e.SHA512_IV[5] | 0, this.Dh = e.SHA512_IV[6] | 0, this.Dl = e.SHA512_IV[7] | 0, this.Eh = e.SHA512_IV[8] | 0, this.El = e.SHA512_IV[9] | 0, this.Fh = e.SHA512_IV[10] | 0, this.Fl = e.SHA512_IV[11] | 0, this.Gh = e.SHA512_IV[12] | 0, this.Gl = e.SHA512_IV[13] | 0, this.Hh = e.SHA512_IV[14] | 0, this.Hl = e.SHA512_IV[15] | 0;
1591
943
  }
1592
- // prettier-ignore
1593
944
  get() {
1594
- const { Ah: H, Al: E, Bh: A, Bl: L, Ch: m, Cl: V, Dh: l, Dl: b, Eh: x, El: C, Fh: w, Fl: k, Gh: v, Gl: j, Hh: P, Hl: Q } = this;
1595
- return [H, E, A, L, m, V, l, b, x, C, w, k, v, j, P, Q];
1596
- }
1597
- // prettier-ignore
1598
- set(H, E, A, L, m, V, l, b, x, C, w, k, v, j, P, Q) {
1599
- this.Ah = H | 0, this.Al = E | 0, this.Bh = A | 0, this.Bl = L | 0, this.Ch = m | 0, this.Cl = V | 0, this.Dh = l | 0, this.Dl = b | 0, this.Eh = x | 0, this.El = C | 0, this.Fh = w | 0, this.Fl = k | 0, this.Gh = v | 0, this.Gl = j | 0, this.Hh = P | 0, this.Hl = Q | 0;
1600
- }
1601
- process(H, E) {
1602
- for (let I = 0; I < 16; I++, E += 4)
1603
- d[I] = H.getUint32(E), f[I] = H.getUint32(E += 4);
1604
- for (let I = 16; I < 80; I++) {
1605
- const O = d[I - 15] | 0, T = f[I - 15] | 0, R = e.rotrSH(O, T, 1) ^ e.rotrSH(O, T, 8) ^ e.shrSH(O, T, 7), ut = e.rotrSL(O, T, 1) ^ e.rotrSL(O, T, 8) ^ e.shrSL(O, T, 7), Y = d[I - 2] | 0, Z = f[I - 2] | 0, gt = e.rotrSH(Y, Z, 19) ^ e.rotrBH(Y, Z, 61) ^ e.shrSH(Y, Z, 6), kt = e.rotrSL(Y, Z, 19) ^ e.rotrBL(Y, Z, 61) ^ e.shrSL(Y, Z, 6), St = e.add4L(ut, kt, f[I - 7], f[I - 16]), Ot = e.add4H(St, R, gt, d[I - 7], d[I - 16]);
1606
- d[I] = Ot | 0, f[I] = St | 0;
945
+ const { Ah: L, Al: v, Bh: y, Bl: w, Ch: V, Cl: m, Dh: E, Dl: o, Eh: H, El: u, Fh: b, Fl: p, Gh: O, Gl: F, Hh: j, Hl: P } = this;
946
+ return [
947
+ L,
948
+ v,
949
+ y,
950
+ w,
951
+ V,
952
+ m,
953
+ E,
954
+ o,
955
+ H,
956
+ u,
957
+ b,
958
+ p,
959
+ O,
960
+ F,
961
+ j,
962
+ P
963
+ ];
964
+ }
965
+ set(L, v, y, w, V, m, E, o, H, u, b, p, O, F, j, P) {
966
+ this.Ah = L | 0, this.Al = v | 0, this.Bh = y | 0, this.Bl = w | 0, this.Ch = V | 0, this.Cl = m | 0, this.Dh = E | 0, this.Dl = o | 0, this.Eh = H | 0, this.El = u | 0, this.Fh = b | 0, this.Fl = p | 0, this.Gh = O | 0, this.Gl = F | 0, this.Hh = j | 0, this.Hl = P | 0;
967
+ }
968
+ process(L, v) {
969
+ for (let S = 0; S < 16; S++, v += 4)
970
+ A[S] = L.getUint32(v), _[S] = L.getUint32(v += 4);
971
+ for (let S = 16; S < 80; S++) {
972
+ const U = A[S - 15] | 0, D = _[S - 15] | 0, M = s.rotrSH(U, D, 1) ^ s.rotrSH(U, D, 8) ^ s.shrSH(U, D, 7), Q = s.rotrSL(U, D, 1) ^ s.rotrSL(U, D, 8) ^ s.shrSL(U, D, 7), R = A[S - 2] | 0, W = _[S - 2] | 0, z = s.rotrSH(R, W, 19) ^ s.rotrBH(R, W, 61) ^ s.shrSH(R, W, 6), it = s.rotrSL(R, W, 19) ^ s.rotrBL(R, W, 61) ^ s.shrSL(R, W, 6), x = s.add4L(Q, it, _[S - 7], _[S - 16]);
973
+ A[S] = s.add4H(x, M, z, A[S - 7], A[S - 16]) | 0, _[S] = x | 0;
1607
974
  }
1608
- let { Ah: A, Al: L, Bh: m, Bl: V, Ch: l, Cl: b, Dh: x, Dl: C, Eh: w, El: k, Fh: v, Fl: j, Gh: P, Gl: Q, Hh: a, Hl: _ } = this;
1609
- for (let I = 0; I < 80; I++) {
1610
- const O = e.rotrSH(w, k, 14) ^ e.rotrSH(w, k, 18) ^ e.rotrBH(w, k, 41), T = e.rotrSL(w, k, 14) ^ e.rotrSL(w, k, 18) ^ e.rotrBL(w, k, 41), R = w & v ^ ~w & P, ut = k & j ^ ~k & Q, Y = e.add5L(_, T, ut, u[I], f[I]), Z = e.add5H(Y, a, O, R, h[I], d[I]), gt = Y | 0, kt = e.rotrSH(A, L, 28) ^ e.rotrBH(A, L, 34) ^ e.rotrBH(A, L, 39), St = e.rotrSL(A, L, 28) ^ e.rotrBL(A, L, 34) ^ e.rotrBL(A, L, 39), Ot = A & m ^ A & l ^ m & l, ke = L & V ^ L & b ^ V & b;
1611
- a = P | 0, _ = Q | 0, P = v | 0, Q = j | 0, v = w | 0, j = k | 0, { h: w, l: k } = e.add(x | 0, C | 0, Z | 0, gt | 0), x = l | 0, C = b | 0, l = m | 0, b = V | 0, m = A | 0, V = L | 0;
1612
- const Pt = e.add3L(gt, St, ke);
1613
- A = e.add3H(Pt, Z, kt, Ot), L = Pt | 0;
975
+ let { Ah: y, Al: w, Bh: V, Bl: m, Ch: E, Cl: o, Dh: H, Dl: u, Eh: b, El: p, Fh: O, Fl: F, Gh: j, Gl: P, Hh: i, Hl: d } = this;
976
+ for (let S = 0; S < 80; S++) {
977
+ const U = s.rotrSH(b, p, 14) ^ s.rotrSH(b, p, 18) ^ s.rotrBH(b, p, 41), D = s.rotrSL(b, p, 14) ^ s.rotrSL(b, p, 18) ^ s.rotrBL(b, p, 41), M = b & O ^ ~b & j, Q = p & F ^ ~p & P, R = s.add5L(d, D, Q, I[S], _[S]), W = s.add5H(R, i, U, M, f[S], A[S]), z = R | 0, it = s.rotrSH(y, w, 28) ^ s.rotrBH(y, w, 34) ^ s.rotrBH(y, w, 39), x = s.rotrSL(y, w, 28) ^ s.rotrBL(y, w, 34) ^ s.rotrBL(y, w, 39), $t = y & V ^ y & E ^ V & E, zt = w & m ^ w & o ^ m & o;
978
+ i = j | 0, d = P | 0, j = O | 0, P = F | 0, O = b | 0, F = p | 0, { h: b, l: p } = s.add(H | 0, u | 0, W | 0, z | 0), H = E | 0, u = o | 0, E = V | 0, o = m | 0, V = y | 0, m = w | 0;
979
+ const gt = s.add3L(z, x, zt);
980
+ y = s.add3H(gt, W, it, $t), w = gt | 0;
1614
981
  }
1615
- ({ h: A, l: L } = e.add(this.Ah | 0, this.Al | 0, A | 0, L | 0)), { h: m, l: V } = e.add(this.Bh | 0, this.Bl | 0, m | 0, V | 0), { h: l, l: b } = e.add(this.Ch | 0, this.Cl | 0, l | 0, b | 0), { h: x, l: C } = e.add(this.Dh | 0, this.Dl | 0, x | 0, C | 0), { h: w, l: k } = e.add(this.Eh | 0, this.El | 0, w | 0, k | 0), { h: v, l: j } = e.add(this.Fh | 0, this.Fl | 0, v | 0, j | 0), { h: P, l: Q } = e.add(this.Gh | 0, this.Gl | 0, P | 0, Q | 0), { h: a, l: _ } = e.add(this.Hh | 0, this.Hl | 0, a | 0, _ | 0), this.set(A, L, m, V, l, b, x, C, w, k, v, j, P, Q, a, _);
982
+ ({ h: y, l: w } = s.add(this.Ah | 0, this.Al | 0, y | 0, w | 0)), { h: V, l: m } = s.add(this.Bh | 0, this.Bl | 0, V | 0, m | 0), { h: E, l: o } = s.add(this.Ch | 0, this.Cl | 0, E | 0, o | 0), { h: H, l: u } = s.add(this.Dh | 0, this.Dl | 0, H | 0, u | 0), { h: b, l: p } = s.add(this.Eh | 0, this.El | 0, b | 0, p | 0), { h: O, l: F } = s.add(this.Fh | 0, this.Fl | 0, O | 0, F | 0), { h: j, l: P } = s.add(this.Gh | 0, this.Gl | 0, j | 0, P | 0), { h: i, l: d } = s.add(this.Hh | 0, this.Hl | 0, i | 0, d | 0), this.set(y, w, V, m, E, o, H, u, b, p, O, F, j, P, i, d);
1616
983
  }
1617
984
  roundClean() {
1618
- (0, s.clean)(d, f);
985
+ (0, h.clean)(A, _);
1619
986
  }
1620
987
  destroy() {
1621
- (0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
988
+ (0, h.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1622
989
  }
1623
- }
1624
- F.SHA512 = y;
1625
- class p extends y {
990
+ };
991
+ t.SHA512 = k;
992
+ var C = class extends k {
1626
993
  constructor() {
1627
- 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;
994
+ super(48), this.Ah = e.SHA384_IV[0] | 0, this.Al = e.SHA384_IV[1] | 0, this.Bh = e.SHA384_IV[2] | 0, this.Bl = e.SHA384_IV[3] | 0, this.Ch = e.SHA384_IV[4] | 0, this.Cl = e.SHA384_IV[5] | 0, this.Dh = e.SHA384_IV[6] | 0, this.Dl = e.SHA384_IV[7] | 0, this.Eh = e.SHA384_IV[8] | 0, this.El = e.SHA384_IV[9] | 0, this.Fh = e.SHA384_IV[10] | 0, this.Fl = e.SHA384_IV[11] | 0, this.Gh = e.SHA384_IV[12] | 0, this.Gl = e.SHA384_IV[13] | 0, this.Hh = e.SHA384_IV[14] | 0, this.Hl = e.SHA384_IV[15] | 0;
1628
995
  }
1629
- }
1630
- F.SHA384 = p;
1631
- const g = /* @__PURE__ */ Uint32Array.from([
996
+ };
997
+ t.SHA384 = C;
998
+ var B = /* @__PURE__ */ Uint32Array.from([
1632
999
  2352822216,
1633
1000
  424955298,
1634
1001
  1944164710,
@@ -1645,7 +1012,7 @@ function Ce() {
1645
1012
  1780299464,
1646
1013
  286451373,
1647
1014
  2446758561
1648
- ]), S = /* @__PURE__ */ Uint32Array.from([
1015
+ ]), g = /* @__PURE__ */ Uint32Array.from([
1649
1016
  573645204,
1650
1017
  4230739756,
1651
1018
  2673172387,
@@ -1662,150 +1029,125 @@ function Ce() {
1662
1029
  746961066,
1663
1030
  246885852,
1664
1031
  2177182882
1665
- ]);
1666
- class U extends y {
1032
+ ]), T = class extends k {
1667
1033
  constructor() {
1668
- super(28), this.Ah = g[0] | 0, this.Al = g[1] | 0, this.Bh = g[2] | 0, this.Bl = g[3] | 0, this.Ch = g[4] | 0, this.Cl = g[5] | 0, this.Dh = g[6] | 0, this.Dl = g[7] | 0, this.Eh = g[8] | 0, this.El = g[9] | 0, this.Fh = g[10] | 0, this.Fl = g[11] | 0, this.Gh = g[12] | 0, this.Gl = g[13] | 0, this.Hh = g[14] | 0, this.Hl = g[15] | 0;
1034
+ super(28), this.Ah = B[0] | 0, this.Al = B[1] | 0, this.Bh = B[2] | 0, this.Bl = B[3] | 0, this.Ch = B[4] | 0, this.Cl = B[5] | 0, this.Dh = B[6] | 0, this.Dl = B[7] | 0, this.Eh = B[8] | 0, this.El = B[9] | 0, this.Fh = B[10] | 0, this.Fl = B[11] | 0, this.Gh = B[12] | 0, this.Gl = B[13] | 0, this.Hh = B[14] | 0, this.Hl = B[15] | 0;
1669
1035
  }
1670
- }
1671
- F.SHA512_224 = U;
1672
- class M extends y {
1036
+ };
1037
+ t.SHA512_224 = T;
1038
+ var G = class extends k {
1673
1039
  constructor() {
1674
- super(32), 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;
1040
+ super(32), this.Ah = g[0] | 0, this.Al = g[1] | 0, this.Bh = g[2] | 0, this.Bl = g[3] | 0, this.Ch = g[4] | 0, this.Cl = g[5] | 0, this.Dh = g[6] | 0, this.Dl = g[7] | 0, this.Eh = g[8] | 0, this.El = g[9] | 0, this.Fh = g[10] | 0, this.Fl = g[11] | 0, this.Gh = g[12] | 0, this.Gl = g[13] | 0, this.Hh = g[14] | 0, this.Hl = g[15] | 0;
1675
1041
  }
1676
- }
1677
- return F.SHA512_256 = M, F.sha256 = (0, s.createHasher)(() => new r()), F.sha224 = (0, s.createHasher)(() => new c()), F.sha512 = (0, s.createHasher)(() => new y()), F.sha384 = (0, s.createHasher)(() => new p()), F.sha512_256 = (0, s.createHasher)(() => new M()), F.sha512_224 = (0, s.createHasher)(() => new U()), F;
1678
- }
1679
- var ee;
1680
- function R0() {
1681
- if (ee) return z;
1682
- ee = 1, Object.defineProperty(z, "__esModule", { value: !0 }), z.sha224 = z.SHA224 = z.sha256 = z.SHA256 = void 0;
1683
- const t = /* @__PURE__ */ Ce();
1684
- return z.SHA256 = t.SHA256, z.sha256 = t.sha256, z.SHA224 = t.SHA224, z.sha224 = t.sha224, z;
1685
- }
1686
- var G = {}, se;
1687
- function W0() {
1688
- if (se) return G;
1689
- se = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.sha512_256 = G.SHA512_256 = G.sha512_224 = G.SHA512_224 = G.sha384 = G.SHA384 = G.sha512 = G.SHA512 = void 0;
1690
- const t = /* @__PURE__ */ Ce();
1691
- return G.SHA512 = t.SHA512, G.sha512 = t.sha512, G.SHA384 = t.SHA384, G.sha384 = t.sha384, G.SHA512_224 = t.SHA512_224, G.sha512_224 = t.sha512_224, G.SHA512_256 = t.SHA512_256, G.sha512_256 = t.sha512_256, G;
1692
- }
1693
- var yt = {}, vt = {}, ne;
1694
- function C0() {
1695
- return ne || (ne = 1, (function(t) {
1696
- Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
1697
- const e = /* @__PURE__ */ Ct();
1698
- class s extends e.Hash {
1699
- constructor(r, c) {
1700
- super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(r);
1701
- const o = (0, e.toBytes)(c);
1702
- if (this.iHash = r.create(), typeof this.iHash.update != "function")
1703
- throw new Error("Expected instance of class which extends utils.Hash");
1704
- this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
1705
- const h = this.blockLen, u = new Uint8Array(h);
1706
- u.set(o.length > h ? r.create().update(o).digest() : o);
1707
- for (let d = 0; d < u.length; d++)
1708
- u[d] ^= 54;
1709
- this.iHash.update(u), this.oHash = r.create();
1710
- for (let d = 0; d < u.length; d++)
1711
- u[d] ^= 106;
1712
- this.oHash.update(u), (0, e.clean)(u);
1713
- }
1714
- update(r) {
1715
- return (0, e.aexists)(this), this.iHash.update(r), this;
1716
- }
1717
- digestInto(r) {
1718
- (0, e.aexists)(this), (0, e.abytes)(r, this.outputLen), this.finished = !0, this.iHash.digestInto(r), this.oHash.update(r), this.oHash.digestInto(r), this.destroy();
1719
- }
1720
- digest() {
1721
- const r = new Uint8Array(this.oHash.outputLen);
1722
- return this.digestInto(r), r;
1723
- }
1724
- _cloneInto(r) {
1725
- r || (r = Object.create(Object.getPrototypeOf(this), {}));
1726
- const { oHash: c, iHash: o, finished: h, destroyed: u, blockLen: d, outputLen: f } = this;
1727
- return r = r, r.finished = h, r.destroyed = u, r.blockLen = d, r.outputLen = f, r.oHash = c._cloneInto(r.oHash), r.iHash = o._cloneInto(r.iHash), r;
1728
- }
1729
- clone() {
1730
- return this._cloneInto();
1731
- }
1732
- destroy() {
1733
- this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
1734
- }
1042
+ };
1043
+ t.SHA512_256 = G, t.sha256 = (0, h.createHasher)(() => new n()), t.sha224 = (0, h.createHasher)(() => new a()), t.sha512 = (0, h.createHasher)(() => new k()), t.sha384 = (0, h.createHasher)(() => new C()), t.sha512_256 = (0, h.createHasher)(() => new G()), t.sha512_224 = (0, h.createHasher)(() => new T());
1044
+ })), we = /* @__PURE__ */ X(((t) => {
1045
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.sha224 = t.SHA224 = t.sha256 = t.SHA256 = void 0;
1046
+ var e = Zt();
1047
+ t.SHA256 = e.SHA256, t.sha256 = e.sha256, t.SHA224 = e.SHA224, t.sha224 = e.sha224;
1048
+ })), Le = /* @__PURE__ */ X(((t) => {
1049
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.sha512_256 = t.SHA512_256 = t.sha512_224 = t.SHA512_224 = t.sha384 = t.SHA384 = t.sha512 = t.SHA512 = void 0;
1050
+ var e = Zt();
1051
+ t.SHA512 = e.SHA512, t.sha512 = e.sha512, t.SHA384 = e.SHA384, t.sha384 = e.sha384, t.SHA512_224 = e.SHA512_224, t.sha512_224 = e.sha512_224, t.SHA512_256 = e.SHA512_256, t.sha512_256 = e.sha512_256;
1052
+ })), Ae = /* @__PURE__ */ X(((t) => {
1053
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
1054
+ var e = st(), s = class extends e.Hash {
1055
+ constructor(r, c) {
1056
+ super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(r);
1057
+ const n = (0, e.toBytes)(c);
1058
+ if (this.iHash = r.create(), typeof this.iHash.update != "function") throw new Error("Expected instance of class which extends utils.Hash");
1059
+ this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
1060
+ const a = this.blockLen, l = new Uint8Array(a);
1061
+ l.set(n.length > a ? r.create().update(n).digest() : n);
1062
+ for (let f = 0; f < l.length; f++) l[f] ^= 54;
1063
+ this.iHash.update(l), this.oHash = r.create();
1064
+ for (let f = 0; f < l.length; f++) l[f] ^= 106;
1065
+ this.oHash.update(l), (0, e.clean)(l);
1066
+ }
1067
+ update(r) {
1068
+ return (0, e.aexists)(this), this.iHash.update(r), this;
1069
+ }
1070
+ digestInto(r) {
1071
+ (0, e.aexists)(this), (0, e.abytes)(r, this.outputLen), this.finished = !0, this.iHash.digestInto(r), this.oHash.update(r), this.oHash.digestInto(r), this.destroy();
1735
1072
  }
1736
- t.HMAC = s;
1737
- const i = (n, r, c) => new s(n, r).update(c).digest();
1738
- t.hmac = i, t.hmac.create = (n, r) => new s(n, r);
1739
- })(vt)), vt;
1740
- }
1741
- var re;
1742
- function q0() {
1743
- if (re) return yt;
1744
- re = 1, Object.defineProperty(yt, "__esModule", { value: !0 }), yt.pbkdf2 = n, yt.pbkdf2Async = r;
1745
- const t = /* @__PURE__ */ C0(), e = /* @__PURE__ */ Ct();
1746
- function s(c, o, h, u) {
1747
- (0, e.ahash)(c);
1748
- const d = (0, e.checkOpts)({ dkLen: 32, asyncTick: 10 }, u), { c: f, dkLen: y, asyncTick: p } = d;
1749
- if ((0, e.anumber)(f), (0, e.anumber)(y), (0, e.anumber)(p), f < 1)
1750
- throw new Error("iterations (c) should be >= 1");
1751
- const g = (0, e.kdfInputToBytes)(o), S = (0, e.kdfInputToBytes)(h), U = new Uint8Array(y), M = t.hmac.create(c, g), D = M._cloneInto().update(S);
1752
- return { c: f, dkLen: y, asyncTick: p, DK: U, PRF: M, PRFSalt: D };
1753
- }
1754
- function i(c, o, h, u, d) {
1755
- return c.destroy(), o.destroy(), u && u.destroy(), (0, e.clean)(d), h;
1073
+ digest() {
1074
+ const r = new Uint8Array(this.oHash.outputLen);
1075
+ return this.digestInto(r), r;
1076
+ }
1077
+ _cloneInto(r) {
1078
+ r || (r = Object.create(Object.getPrototypeOf(this), {}));
1079
+ const { oHash: c, iHash: n, finished: a, destroyed: l, blockLen: f, outputLen: I } = this;
1080
+ return r = r, r.finished = a, r.destroyed = l, r.blockLen = f, r.outputLen = I, r.oHash = c._cloneInto(r.oHash), r.iHash = n._cloneInto(r.iHash), r;
1081
+ }
1082
+ clone() {
1083
+ return this._cloneInto();
1084
+ }
1085
+ destroy() {
1086
+ this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
1087
+ }
1088
+ };
1089
+ t.HMAC = s;
1090
+ var h = (r, c, n) => new s(r, c).update(n).digest();
1091
+ t.hmac = h, t.hmac.create = (r, c) => new s(r, c);
1092
+ })), Be = /* @__PURE__ */ X(((t) => {
1093
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.pbkdf2 = c, t.pbkdf2Async = n;
1094
+ var e = Ae(), s = st();
1095
+ function h(a, l, f, I) {
1096
+ (0, s.ahash)(a);
1097
+ const { c: A, dkLen: _, asyncTick: k } = (0, s.checkOpts)({
1098
+ dkLen: 32,
1099
+ asyncTick: 10
1100
+ }, I);
1101
+ if ((0, s.anumber)(A), (0, s.anumber)(_), (0, s.anumber)(k), A < 1) throw new Error("iterations (c) should be >= 1");
1102
+ const C = (0, s.kdfInputToBytes)(l), B = (0, s.kdfInputToBytes)(f), g = new Uint8Array(_), T = e.hmac.create(a, C);
1103
+ return {
1104
+ c: A,
1105
+ dkLen: _,
1106
+ asyncTick: k,
1107
+ DK: g,
1108
+ PRF: T,
1109
+ PRFSalt: T._cloneInto().update(B)
1110
+ };
1756
1111
  }
1757
- function n(c, o, h, u) {
1758
- const { c: d, dkLen: f, DK: y, PRF: p, PRFSalt: g } = s(c, o, h, u);
1759
- let S;
1760
- const U = new Uint8Array(4), M = (0, e.createView)(U), D = new Uint8Array(p.outputLen);
1761
- for (let H = 1, E = 0; E < f; H++, E += p.outputLen) {
1762
- const A = y.subarray(E, E + p.outputLen);
1763
- M.setInt32(0, H, !1), (S = g._cloneInto(S)).update(U).digestInto(D), A.set(D.subarray(0, A.length));
1764
- for (let L = 1; L < d; L++) {
1765
- p._cloneInto(S).update(D).digestInto(D);
1766
- for (let m = 0; m < A.length; m++)
1767
- A[m] ^= D[m];
1112
+ function r(a, l, f, I, A) {
1113
+ return a.destroy(), l.destroy(), I && I.destroy(), (0, s.clean)(A), f;
1114
+ }
1115
+ function c(a, l, f, I) {
1116
+ const { c: A, dkLen: _, DK: k, PRF: C, PRFSalt: B } = h(a, l, f, I);
1117
+ let g;
1118
+ const T = new Uint8Array(4), G = (0, s.createView)(T), L = new Uint8Array(C.outputLen);
1119
+ for (let v = 1, y = 0; y < _; v++, y += C.outputLen) {
1120
+ const w = k.subarray(y, y + C.outputLen);
1121
+ G.setInt32(0, v, !1), (g = B._cloneInto(g)).update(T).digestInto(L), w.set(L.subarray(0, w.length));
1122
+ for (let V = 1; V < A; V++) {
1123
+ C._cloneInto(g).update(L).digestInto(L);
1124
+ for (let m = 0; m < w.length; m++) w[m] ^= L[m];
1768
1125
  }
1769
1126
  }
1770
- return i(p, g, y, S, D);
1771
- }
1772
- async function r(c, o, h, u) {
1773
- const { c: d, dkLen: f, asyncTick: y, DK: p, PRF: g, PRFSalt: S } = s(c, o, h, u);
1774
- let U;
1775
- const M = new Uint8Array(4), D = (0, e.createView)(M), H = new Uint8Array(g.outputLen);
1776
- for (let E = 1, A = 0; A < f; E++, A += g.outputLen) {
1777
- const L = p.subarray(A, A + g.outputLen);
1778
- D.setInt32(0, E, !1), (U = S._cloneInto(U)).update(M).digestInto(H), L.set(H.subarray(0, L.length)), await (0, e.asyncLoop)(d - 1, y, () => {
1779
- g._cloneInto(U).update(H).digestInto(H);
1780
- for (let m = 0; m < L.length; m++)
1781
- L[m] ^= H[m];
1127
+ return r(C, B, k, g, L);
1128
+ }
1129
+ async function n(a, l, f, I) {
1130
+ const { c: A, dkLen: _, asyncTick: k, DK: C, PRF: B, PRFSalt: g } = h(a, l, f, I);
1131
+ let T;
1132
+ const G = new Uint8Array(4), L = (0, s.createView)(G), v = new Uint8Array(B.outputLen);
1133
+ for (let y = 1, w = 0; w < _; y++, w += B.outputLen) {
1134
+ const V = C.subarray(w, w + B.outputLen);
1135
+ L.setInt32(0, y, !1), (T = g._cloneInto(T)).update(G).digestInto(v), V.set(v.subarray(0, V.length)), await (0, s.asyncLoop)(A - 1, k, () => {
1136
+ B._cloneInto(T).update(v).digestInto(v);
1137
+ for (let m = 0; m < V.length; m++) V[m] ^= v[m];
1782
1138
  });
1783
1139
  }
1784
- return i(g, S, p, U, H);
1140
+ return r(B, g, C, T, v);
1785
1141
  }
1786
- return yt;
1787
- }
1142
+ }));
1788
1143
  export {
1789
- G0 as a,
1790
- v0 as b,
1791
- T0 as c,
1792
- ft as d,
1793
- F0 as e,
1794
- j0 as f,
1795
- Mt as g,
1796
- P0 as h,
1797
- Oe as i,
1798
- k0 as j,
1799
- q0 as k,
1800
- W0 as l,
1801
- R0 as m,
1802
- Ct as n,
1803
- O0 as o,
1804
- Ut as p,
1805
- D0 as q,
1806
- M0 as r,
1807
- l0 as s,
1808
- De as t,
1809
- oe as u,
1810
- x0 as v
1144
+ ge as a,
1145
+ Ie as c,
1146
+ st as i,
1147
+ Se as l,
1148
+ Le as n,
1149
+ fe as o,
1150
+ we as r,
1151
+ ue as s,
1152
+ Be as t
1811
1153
  };