@btc-vision/transaction 1.7.25 → 1.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/_version.d.ts +1 -1
- package/browser/btc-vision-bitcoin.js +2326 -1928
- package/browser/index.js +456 -443
- package/browser/noble-curves.js +1045 -1016
- package/browser/noble-hashes.js +841 -776
- package/browser/vendors.js +11416 -15797
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/_version.ts +1 -1
- package/src/crypto/crypto-browser.js +9 -16
- package/vite.config.browser.ts +30 -29
- package/browser/bip39.js +0 -204
- package/browser/bitcoin-utils.js +0 -3172
- package/browser/btc-vision-bip32.js +0 -805
- package/browser/btc-vision-logger.js +0 -86
- package/browser/btc-vision-post-quantum.js +0 -542
- package/browser/polyfills.js +0 -4952
- package/browser/scure-base.js +0 -410
- package/cjs/package.json +0 -3
- package/webpack.config.js +0 -220
package/browser/noble-hashes.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const ft = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
2
|
+
function Ae(t) {
|
|
3
3
|
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function Ht(t) {
|
|
6
6
|
if (!Number.isSafeInteger(t) || t < 0)
|
|
7
7
|
throw new Error("positive integer expected, got " + t);
|
|
8
8
|
}
|
|
9
9
|
function ht(t, ...e) {
|
|
10
|
-
if (!
|
|
10
|
+
if (!Ae(t))
|
|
11
11
|
throw new Error("Uint8Array expected");
|
|
12
12
|
if (e.length > 0 && !e.includes(t.length))
|
|
13
13
|
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function $t(t) {
|
|
16
16
|
if (typeof t != "function" || typeof t.create != "function")
|
|
17
17
|
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
18
|
-
|
|
18
|
+
Ht(t.outputLen), Ht(t.blockLen);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function St(t, e = !0) {
|
|
21
21
|
if (t.destroyed)
|
|
22
22
|
throw new Error("Hash instance has been destroyed");
|
|
23
23
|
if (e && t.finished)
|
|
24
24
|
throw new Error("Hash#digest() has already been called");
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function ye(t, e) {
|
|
27
27
|
ht(t);
|
|
28
28
|
const s = e.outputLen;
|
|
29
29
|
if (t.length < s)
|
|
30
30
|
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function ct(...t) {
|
|
33
33
|
for (let e = 0; e < t.length; e++)
|
|
34
34
|
t[e].fill(0);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function wt(t) {
|
|
37
37
|
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Z(t, e) {
|
|
40
40
|
return t << 32 - e | t >>> e;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const Xt = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", pe = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
46
|
-
function rs(t) {
|
|
47
|
-
if (ht(t), Xt)
|
|
42
|
+
const te = /* @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"));
|
|
43
|
+
function ls(t) {
|
|
44
|
+
if (ht(t), te)
|
|
48
45
|
return t.toHex();
|
|
49
46
|
let e = "";
|
|
50
47
|
for (let s = 0; s < t.length; s++)
|
|
51
|
-
e +=
|
|
48
|
+
e += ge[t[s]];
|
|
52
49
|
return e;
|
|
53
50
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
56
|
-
if (t >=
|
|
57
|
-
return t -
|
|
58
|
-
if (t >=
|
|
59
|
-
return t - (
|
|
60
|
-
if (t >=
|
|
61
|
-
return t - (
|
|
51
|
+
const z = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
52
|
+
function Vt(t) {
|
|
53
|
+
if (t >= z._0 && t <= z._9)
|
|
54
|
+
return t - z._0;
|
|
55
|
+
if (t >= z.A && t <= z.F)
|
|
56
|
+
return t - (z.A - 10);
|
|
57
|
+
if (t >= z.a && t <= z.f)
|
|
58
|
+
return t - (z.a - 10);
|
|
62
59
|
}
|
|
63
|
-
function
|
|
60
|
+
function bs(t) {
|
|
64
61
|
if (typeof t != "string")
|
|
65
62
|
throw new Error("hex string expected, got " + typeof t);
|
|
66
|
-
if (
|
|
63
|
+
if (te)
|
|
67
64
|
return Uint8Array.fromHex(t);
|
|
68
65
|
const e = t.length, s = e / 2;
|
|
69
66
|
if (e % 2)
|
|
70
67
|
throw new Error("hex string expected, got unpadded hex of length " + e);
|
|
71
68
|
const i = new Uint8Array(s);
|
|
72
|
-
for (let o = 0,
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
throw new Error('hex string expected, got non-hex character "' +
|
|
69
|
+
for (let o = 0, r = 0; o < s; o++, r += 2) {
|
|
70
|
+
const n = Vt(t.charCodeAt(r)), h = Vt(t.charCodeAt(r + 1));
|
|
71
|
+
if (n === void 0 || h === void 0) {
|
|
72
|
+
const b = t[r] + t[r + 1];
|
|
73
|
+
throw new Error('hex string expected, got non-hex character "' + b + '" at index ' + r);
|
|
77
74
|
}
|
|
78
|
-
i[o] =
|
|
75
|
+
i[o] = n * 16 + h;
|
|
79
76
|
}
|
|
80
77
|
return i;
|
|
81
78
|
}
|
|
82
|
-
function
|
|
79
|
+
function ee(t) {
|
|
83
80
|
if (typeof t != "string")
|
|
84
81
|
throw new Error("string expected");
|
|
85
82
|
return new Uint8Array(new TextEncoder().encode(t));
|
|
86
83
|
}
|
|
87
|
-
function
|
|
88
|
-
return typeof t == "string" && (t =
|
|
84
|
+
function Ut(t) {
|
|
85
|
+
return typeof t == "string" && (t = ee(t)), ht(t), t;
|
|
89
86
|
}
|
|
90
|
-
function
|
|
87
|
+
function Ct(t) {
|
|
88
|
+
return typeof t == "string" && (t = ee(t)), ht(t), t;
|
|
89
|
+
}
|
|
90
|
+
function xs(...t) {
|
|
91
91
|
let e = 0;
|
|
92
92
|
for (let i = 0; i < t.length; i++) {
|
|
93
93
|
const o = t[i];
|
|
@@ -95,71 +95,76 @@ function os(...t) {
|
|
|
95
95
|
}
|
|
96
96
|
const s = new Uint8Array(e);
|
|
97
97
|
for (let i = 0, o = 0; i < t.length; i++) {
|
|
98
|
-
const
|
|
99
|
-
s.set(
|
|
98
|
+
const r = t[i];
|
|
99
|
+
s.set(r, o), o += r.length;
|
|
100
100
|
}
|
|
101
101
|
return s;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
function _e(t, e) {
|
|
104
|
+
if (e !== void 0 && {}.toString.call(e) !== "[object Object]")
|
|
105
|
+
throw new Error("options should be object or undefined");
|
|
106
|
+
return Object.assign(t, e);
|
|
107
|
+
}
|
|
108
|
+
class se {
|
|
104
109
|
}
|
|
105
|
-
function
|
|
106
|
-
const e = (i) => t().update(
|
|
110
|
+
function ne(t) {
|
|
111
|
+
const e = (i) => t().update(Ut(i)).digest(), s = t();
|
|
107
112
|
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
108
113
|
}
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
112
|
-
if (
|
|
113
|
-
return Uint8Array.from(
|
|
114
|
+
function Hs(t = 32) {
|
|
115
|
+
if (ft && typeof ft.getRandomValues == "function")
|
|
116
|
+
return ft.getRandomValues(new Uint8Array(t));
|
|
117
|
+
if (ft && typeof ft.randomBytes == "function")
|
|
118
|
+
return Uint8Array.from(ft.randomBytes(t));
|
|
114
119
|
throw new Error("crypto.getRandomValues must be defined");
|
|
115
120
|
}
|
|
116
|
-
function
|
|
121
|
+
function we(t, e, s, i) {
|
|
117
122
|
if (typeof t.setBigUint64 == "function")
|
|
118
123
|
return t.setBigUint64(e, s, i);
|
|
119
|
-
const o = BigInt(32),
|
|
120
|
-
t.setUint32(e +
|
|
124
|
+
const o = BigInt(32), r = BigInt(4294967295), n = Number(s >> o & r), h = Number(s & r), b = i ? 4 : 0, x = i ? 0 : 4;
|
|
125
|
+
t.setUint32(e + b, n, i), t.setUint32(e + x, h, i);
|
|
121
126
|
}
|
|
122
|
-
function
|
|
127
|
+
function Se(t, e, s) {
|
|
123
128
|
return t & e ^ ~t & s;
|
|
124
129
|
}
|
|
125
|
-
function
|
|
130
|
+
function Ie(t, e, s) {
|
|
126
131
|
return t & e ^ t & s ^ e & s;
|
|
127
132
|
}
|
|
128
|
-
class
|
|
133
|
+
class re extends se {
|
|
129
134
|
constructor(e, s, i, o) {
|
|
130
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = i, this.isLE = o, this.buffer = new Uint8Array(e), this.view =
|
|
135
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = i, this.isLE = o, this.buffer = new Uint8Array(e), this.view = wt(this.buffer);
|
|
131
136
|
}
|
|
132
137
|
update(e) {
|
|
133
|
-
|
|
134
|
-
const { view: s, buffer: i, blockLen: o } = this,
|
|
135
|
-
for (let
|
|
136
|
-
const h = Math.min(o - this.pos,
|
|
138
|
+
St(this), e = Ut(e), ht(e);
|
|
139
|
+
const { view: s, buffer: i, blockLen: o } = this, r = e.length;
|
|
140
|
+
for (let n = 0; n < r; ) {
|
|
141
|
+
const h = Math.min(o - this.pos, r - n);
|
|
137
142
|
if (h === o) {
|
|
138
|
-
const
|
|
139
|
-
for (; o <=
|
|
140
|
-
this.process(
|
|
143
|
+
const b = wt(e);
|
|
144
|
+
for (; o <= r - n; n += o)
|
|
145
|
+
this.process(b, n);
|
|
141
146
|
continue;
|
|
142
147
|
}
|
|
143
|
-
i.set(e.subarray(
|
|
148
|
+
i.set(e.subarray(n, n + h), this.pos), this.pos += h, n += h, this.pos === o && (this.process(s, 0), this.pos = 0);
|
|
144
149
|
}
|
|
145
150
|
return this.length += e.length, this.roundClean(), this;
|
|
146
151
|
}
|
|
147
152
|
digestInto(e) {
|
|
148
|
-
|
|
149
|
-
const { buffer: s, view: i, blockLen: o, isLE:
|
|
150
|
-
let { pos:
|
|
151
|
-
s[
|
|
152
|
-
for (let
|
|
153
|
-
s[
|
|
154
|
-
|
|
155
|
-
const h =
|
|
156
|
-
if (
|
|
153
|
+
St(this), ye(e, this), this.finished = !0;
|
|
154
|
+
const { buffer: s, view: i, blockLen: o, isLE: r } = this;
|
|
155
|
+
let { pos: n } = this;
|
|
156
|
+
s[n++] = 128, ct(this.buffer.subarray(n)), this.padOffset > o - n && (this.process(i, 0), n = 0);
|
|
157
|
+
for (let u = n; u < o; u++)
|
|
158
|
+
s[u] = 0;
|
|
159
|
+
we(i, o - 8, BigInt(this.length * 8), r), this.process(i, 0);
|
|
160
|
+
const h = wt(e), b = this.outputLen;
|
|
161
|
+
if (b % 4)
|
|
157
162
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
158
|
-
const x =
|
|
159
|
-
if (x >
|
|
163
|
+
const x = b / 4, H = this.get();
|
|
164
|
+
if (x > H.length)
|
|
160
165
|
throw new Error("_sha2: outputLen bigger than state");
|
|
161
|
-
for (let
|
|
162
|
-
h.setUint32(4 *
|
|
166
|
+
for (let u = 0; u < x; u++)
|
|
167
|
+
h.setUint32(4 * u, H[u], r);
|
|
163
168
|
}
|
|
164
169
|
digest() {
|
|
165
170
|
const { buffer: e, outputLen: s } = this;
|
|
@@ -169,14 +174,14 @@ class It extends Jt {
|
|
|
169
174
|
}
|
|
170
175
|
_cloneInto(e) {
|
|
171
176
|
e || (e = new this.constructor()), e.set(...this.get());
|
|
172
|
-
const { blockLen: s, buffer: i, length: o, finished:
|
|
173
|
-
return e.destroyed =
|
|
177
|
+
const { blockLen: s, buffer: i, length: o, finished: r, destroyed: n, pos: h } = this;
|
|
178
|
+
return e.destroyed = n, e.finished = r, e.length = o, e.pos = h, o % s && e.buffer.set(i), e;
|
|
174
179
|
}
|
|
175
180
|
clone() {
|
|
176
181
|
return this._cloneInto();
|
|
177
182
|
}
|
|
178
183
|
}
|
|
179
|
-
const
|
|
184
|
+
const st = /* @__PURE__ */ Uint32Array.from([
|
|
180
185
|
1779033703,
|
|
181
186
|
3144134277,
|
|
182
187
|
1013904242,
|
|
@@ -185,7 +190,42 @@ const tt = /* @__PURE__ */ Uint32Array.from([
|
|
|
185
190
|
2600822924,
|
|
186
191
|
528734635,
|
|
187
192
|
1541459225
|
|
188
|
-
]),
|
|
193
|
+
]), q = /* @__PURE__ */ Uint32Array.from([
|
|
194
|
+
1779033703,
|
|
195
|
+
4089235720,
|
|
196
|
+
3144134277,
|
|
197
|
+
2227873595,
|
|
198
|
+
1013904242,
|
|
199
|
+
4271175723,
|
|
200
|
+
2773480762,
|
|
201
|
+
1595750129,
|
|
202
|
+
1359893119,
|
|
203
|
+
2917565137,
|
|
204
|
+
2600822924,
|
|
205
|
+
725511199,
|
|
206
|
+
528734635,
|
|
207
|
+
4215389547,
|
|
208
|
+
1541459225,
|
|
209
|
+
327033209
|
|
210
|
+
]), At = /* @__PURE__ */ BigInt(2 ** 32 - 1), Dt = /* @__PURE__ */ BigInt(32);
|
|
211
|
+
function Le(t, e = !1) {
|
|
212
|
+
return e ? { h: Number(t & At), l: Number(t >> Dt & At) } : { h: Number(t >> Dt & At) | 0, l: Number(t & At) | 0 };
|
|
213
|
+
}
|
|
214
|
+
function Be(t, e = !1) {
|
|
215
|
+
const s = t.length;
|
|
216
|
+
let i = new Uint32Array(s), o = new Uint32Array(s);
|
|
217
|
+
for (let r = 0; r < s; r++) {
|
|
218
|
+
const { h: n, l: h } = Le(t[r], e);
|
|
219
|
+
[i[r], o[r]] = [n, h];
|
|
220
|
+
}
|
|
221
|
+
return [i, o];
|
|
222
|
+
}
|
|
223
|
+
const Ot = (t, e, s) => t >>> s, Ft = (t, e, s) => t << 32 - s | e >>> s, dt = (t, e, s) => t >>> s | e << 32 - s, ut = (t, e, s) => t << 32 - s | e >>> s, yt = (t, e, s) => t << 64 - s | e >>> s - 32, gt = (t, e, s) => t >>> s - 32 | e << 64 - s;
|
|
224
|
+
function $(t, e, s, i) {
|
|
225
|
+
const o = (e >>> 0) + (i >>> 0);
|
|
226
|
+
return { h: t + s + (o / 2 ** 32 | 0) | 0, l: o | 0 };
|
|
227
|
+
}
|
|
228
|
+
const me = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), Ue = (t, e, s, i) => e + s + i + (t / 2 ** 32 | 0) | 0, Ee = (t, e, s, i) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (i >>> 0), ke = (t, e, s, i, o) => e + s + i + o + (t / 2 ** 32 | 0) | 0, Ve = (t, e, s, i, o) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (i >>> 0) + (o >>> 0), Ce = (t, e, s, i, o, r) => e + s + i + o + r + (t / 2 ** 32 | 0) | 0, De = /* @__PURE__ */ Uint32Array.from([
|
|
189
229
|
1116352408,
|
|
190
230
|
1899447441,
|
|
191
231
|
3049323471,
|
|
@@ -250,170 +290,168 @@ const tt = /* @__PURE__ */ Uint32Array.from([
|
|
|
250
290
|
2756734187,
|
|
251
291
|
3204031479,
|
|
252
292
|
3329325298
|
|
253
|
-
]),
|
|
254
|
-
class
|
|
293
|
+
]), nt = /* @__PURE__ */ new Uint32Array(64);
|
|
294
|
+
class Oe extends re {
|
|
255
295
|
constructor(e = 32) {
|
|
256
|
-
super(64, e, 8, !1), this.A =
|
|
296
|
+
super(64, e, 8, !1), this.A = st[0] | 0, this.B = st[1] | 0, this.C = st[2] | 0, this.D = st[3] | 0, this.E = st[4] | 0, this.F = st[5] | 0, this.G = st[6] | 0, this.H = st[7] | 0;
|
|
257
297
|
}
|
|
258
298
|
get() {
|
|
259
|
-
const { A: e, B: s, C: i, D: o, E:
|
|
260
|
-
return [e, s, i, o,
|
|
299
|
+
const { A: e, B: s, C: i, D: o, E: r, F: n, G: h, H: b } = this;
|
|
300
|
+
return [e, s, i, o, r, n, h, b];
|
|
261
301
|
}
|
|
262
302
|
// prettier-ignore
|
|
263
|
-
set(e, s, i, o,
|
|
264
|
-
this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = o | 0, this.E =
|
|
303
|
+
set(e, s, i, o, r, n, h, b) {
|
|
304
|
+
this.A = e | 0, this.B = s | 0, this.C = i | 0, this.D = o | 0, this.E = r | 0, this.F = n | 0, this.G = h | 0, this.H = b | 0;
|
|
265
305
|
}
|
|
266
306
|
process(e, s) {
|
|
267
|
-
for (let
|
|
268
|
-
|
|
269
|
-
for (let
|
|
270
|
-
const
|
|
271
|
-
|
|
307
|
+
for (let u = 0; u < 16; u++, s += 4)
|
|
308
|
+
nt[u] = e.getUint32(s, !1);
|
|
309
|
+
for (let u = 16; u < 64; u++) {
|
|
310
|
+
const A = nt[u - 15], m = nt[u - 2], w = Z(A, 7) ^ Z(A, 18) ^ A >>> 3, I = Z(m, 17) ^ Z(m, 19) ^ m >>> 10;
|
|
311
|
+
nt[u] = I + nt[u - 7] + w + nt[u - 16] | 0;
|
|
272
312
|
}
|
|
273
|
-
let { A: i, B: o, C:
|
|
274
|
-
for (let
|
|
275
|
-
const
|
|
276
|
-
|
|
313
|
+
let { A: i, B: o, C: r, D: n, E: h, F: b, G: x, H } = this;
|
|
314
|
+
for (let u = 0; u < 64; u++) {
|
|
315
|
+
const A = Z(h, 6) ^ Z(h, 11) ^ Z(h, 25), m = H + A + Se(h, b, x) + De[u] + nt[u] | 0, I = (Z(i, 2) ^ Z(i, 13) ^ Z(i, 22)) + Ie(i, o, r) | 0;
|
|
316
|
+
H = x, x = b, b = h, h = n + m | 0, n = r, r = o, o = i, i = m + I | 0;
|
|
277
317
|
}
|
|
278
|
-
i = i + this.A | 0, o = o + this.B | 0,
|
|
318
|
+
i = i + this.A | 0, o = o + this.B | 0, r = r + this.C | 0, n = n + this.D | 0, h = h + this.E | 0, b = b + this.F | 0, x = x + this.G | 0, H = H + this.H | 0, this.set(i, o, r, n, h, b, x, H);
|
|
279
319
|
}
|
|
280
320
|
roundClean() {
|
|
281
|
-
nt
|
|
321
|
+
ct(nt);
|
|
282
322
|
}
|
|
283
323
|
destroy() {
|
|
284
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
324
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), ct(this.buffer);
|
|
285
325
|
}
|
|
286
326
|
}
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
class ke extends It {
|
|
373
|
-
constructor() {
|
|
374
|
-
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
327
|
+
const ie = Be([
|
|
328
|
+
"0x428a2f98d728ae22",
|
|
329
|
+
"0x7137449123ef65cd",
|
|
330
|
+
"0xb5c0fbcfec4d3b2f",
|
|
331
|
+
"0xe9b5dba58189dbbc",
|
|
332
|
+
"0x3956c25bf348b538",
|
|
333
|
+
"0x59f111f1b605d019",
|
|
334
|
+
"0x923f82a4af194f9b",
|
|
335
|
+
"0xab1c5ed5da6d8118",
|
|
336
|
+
"0xd807aa98a3030242",
|
|
337
|
+
"0x12835b0145706fbe",
|
|
338
|
+
"0x243185be4ee4b28c",
|
|
339
|
+
"0x550c7dc3d5ffb4e2",
|
|
340
|
+
"0x72be5d74f27b896f",
|
|
341
|
+
"0x80deb1fe3b1696b1",
|
|
342
|
+
"0x9bdc06a725c71235",
|
|
343
|
+
"0xc19bf174cf692694",
|
|
344
|
+
"0xe49b69c19ef14ad2",
|
|
345
|
+
"0xefbe4786384f25e3",
|
|
346
|
+
"0x0fc19dc68b8cd5b5",
|
|
347
|
+
"0x240ca1cc77ac9c65",
|
|
348
|
+
"0x2de92c6f592b0275",
|
|
349
|
+
"0x4a7484aa6ea6e483",
|
|
350
|
+
"0x5cb0a9dcbd41fbd4",
|
|
351
|
+
"0x76f988da831153b5",
|
|
352
|
+
"0x983e5152ee66dfab",
|
|
353
|
+
"0xa831c66d2db43210",
|
|
354
|
+
"0xb00327c898fb213f",
|
|
355
|
+
"0xbf597fc7beef0ee4",
|
|
356
|
+
"0xc6e00bf33da88fc2",
|
|
357
|
+
"0xd5a79147930aa725",
|
|
358
|
+
"0x06ca6351e003826f",
|
|
359
|
+
"0x142929670a0e6e70",
|
|
360
|
+
"0x27b70a8546d22ffc",
|
|
361
|
+
"0x2e1b21385c26c926",
|
|
362
|
+
"0x4d2c6dfc5ac42aed",
|
|
363
|
+
"0x53380d139d95b3df",
|
|
364
|
+
"0x650a73548baf63de",
|
|
365
|
+
"0x766a0abb3c77b2a8",
|
|
366
|
+
"0x81c2c92e47edaee6",
|
|
367
|
+
"0x92722c851482353b",
|
|
368
|
+
"0xa2bfe8a14cf10364",
|
|
369
|
+
"0xa81a664bbc423001",
|
|
370
|
+
"0xc24b8b70d0f89791",
|
|
371
|
+
"0xc76c51a30654be30",
|
|
372
|
+
"0xd192e819d6ef5218",
|
|
373
|
+
"0xd69906245565a910",
|
|
374
|
+
"0xf40e35855771202a",
|
|
375
|
+
"0x106aa07032bbd1b8",
|
|
376
|
+
"0x19a4c116b8d2d0c8",
|
|
377
|
+
"0x1e376c085141ab53",
|
|
378
|
+
"0x2748774cdf8eeb99",
|
|
379
|
+
"0x34b0bcb5e19b48a8",
|
|
380
|
+
"0x391c0cb3c5c95a63",
|
|
381
|
+
"0x4ed8aa4ae3418acb",
|
|
382
|
+
"0x5b9cca4f7763e373",
|
|
383
|
+
"0x682e6ff3d6b2b8a3",
|
|
384
|
+
"0x748f82ee5defb2fc",
|
|
385
|
+
"0x78a5636f43172f60",
|
|
386
|
+
"0x84c87814a1f0ab72",
|
|
387
|
+
"0x8cc702081a6439ec",
|
|
388
|
+
"0x90befffa23631e28",
|
|
389
|
+
"0xa4506cebde82bde9",
|
|
390
|
+
"0xbef9a3f7b2c67915",
|
|
391
|
+
"0xc67178f2e372532b",
|
|
392
|
+
"0xca273eceea26619c",
|
|
393
|
+
"0xd186b8c721c0c207",
|
|
394
|
+
"0xeada7dd6cde0eb1e",
|
|
395
|
+
"0xf57d4f7fee6ed178",
|
|
396
|
+
"0x06f067aa72176fba",
|
|
397
|
+
"0x0a637dc5a2c898a6",
|
|
398
|
+
"0x113f9804bef90dae",
|
|
399
|
+
"0x1b710b35131c471b",
|
|
400
|
+
"0x28db77f523047d84",
|
|
401
|
+
"0x32caab7b40c72493",
|
|
402
|
+
"0x3c9ebe0a15c9bebc",
|
|
403
|
+
"0x431d67c49c100d4c",
|
|
404
|
+
"0x4cc5d4becb3e42b6",
|
|
405
|
+
"0x597f299cfc657e2a",
|
|
406
|
+
"0x5fcb6fab3ad6faec",
|
|
407
|
+
"0x6c44198c4a475817"
|
|
408
|
+
].map((t) => BigInt(t))), Fe = ie[0], Te = ie[1], rt = /* @__PURE__ */ new Uint32Array(80), it = /* @__PURE__ */ new Uint32Array(80);
|
|
409
|
+
class Me extends re {
|
|
410
|
+
constructor(e = 64) {
|
|
411
|
+
super(128, e, 16, !1), this.Ah = q[0] | 0, this.Al = q[1] | 0, this.Bh = q[2] | 0, this.Bl = q[3] | 0, this.Ch = q[4] | 0, this.Cl = q[5] | 0, this.Dh = q[6] | 0, this.Dl = q[7] | 0, this.Eh = q[8] | 0, this.El = q[9] | 0, this.Fh = q[10] | 0, this.Fl = q[11] | 0, this.Gh = q[12] | 0, this.Gl = q[13] | 0, this.Hh = q[14] | 0, this.Hl = q[15] | 0;
|
|
375
412
|
}
|
|
413
|
+
// prettier-ignore
|
|
376
414
|
get() {
|
|
377
|
-
const {
|
|
378
|
-
return [e, s, i, o, n];
|
|
415
|
+
const { Ah: e, Al: s, Bh: i, Bl: o, Ch: r, Cl: n, Dh: h, Dl: b, Eh: x, El: H, Fh: u, Fl: A, Gh: m, Gl: w, Hh: I, Hl: C } = this;
|
|
416
|
+
return [e, s, i, o, r, n, h, b, x, H, u, A, m, w, I, C];
|
|
379
417
|
}
|
|
380
|
-
|
|
381
|
-
|
|
418
|
+
// prettier-ignore
|
|
419
|
+
set(e, s, i, o, r, n, h, b, x, H, u, A, m, w, I, C) {
|
|
420
|
+
this.Ah = e | 0, this.Al = s | 0, this.Bh = i | 0, this.Bl = o | 0, this.Ch = r | 0, this.Cl = n | 0, this.Dh = h | 0, this.Dl = b | 0, this.Eh = x | 0, this.El = H | 0, this.Fh = u | 0, this.Fl = A | 0, this.Gh = m | 0, this.Gl = w | 0, this.Hh = I | 0, this.Hl = C | 0;
|
|
382
421
|
}
|
|
383
422
|
process(e, s) {
|
|
384
|
-
for (let
|
|
385
|
-
|
|
386
|
-
let
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
423
|
+
for (let y = 0; y < 16; y++, s += 4)
|
|
424
|
+
rt[y] = e.getUint32(s), it[y] = e.getUint32(s += 4);
|
|
425
|
+
for (let y = 16; y < 80; y++) {
|
|
426
|
+
const O = rt[y - 15] | 0, L = it[y - 15] | 0, E = dt(O, L, 1) ^ dt(O, L, 8) ^ Ot(O, L, 7), D = ut(O, L, 1) ^ ut(O, L, 8) ^ Ft(O, L, 7), B = rt[y - 2] | 0, a = it[y - 2] | 0, d = dt(B, a, 19) ^ yt(B, a, 61) ^ Ot(B, a, 6), f = ut(B, a, 19) ^ gt(B, a, 61) ^ Ft(B, a, 6), p = Ee(D, f, it[y - 7], it[y - 16]), l = ke(p, E, d, rt[y - 7], rt[y - 16]);
|
|
427
|
+
rt[y] = l | 0, it[y] = p | 0;
|
|
428
|
+
}
|
|
429
|
+
let { Ah: i, Al: o, Bh: r, Bl: n, Ch: h, Cl: b, Dh: x, Dl: H, Eh: u, El: A, Fh: m, Fl: w, Gh: I, Gl: C, Hh: R, Hl: M } = this;
|
|
430
|
+
for (let y = 0; y < 80; y++) {
|
|
431
|
+
const O = dt(u, A, 14) ^ dt(u, A, 18) ^ yt(u, A, 41), L = ut(u, A, 14) ^ ut(u, A, 18) ^ gt(u, A, 41), E = u & m ^ ~u & I, D = A & w ^ ~A & C, B = Ve(M, L, D, Te[y], it[y]), a = Ce(B, R, O, E, Fe[y], rt[y]), d = B | 0, f = dt(i, o, 28) ^ yt(i, o, 34) ^ yt(i, o, 39), p = ut(i, o, 28) ^ gt(i, o, 34) ^ gt(i, o, 39), l = i & r ^ i & h ^ r & h, S = o & n ^ o & b ^ n & b;
|
|
432
|
+
R = I | 0, M = C | 0, I = m | 0, C = w | 0, m = u | 0, w = A | 0, { h: u, l: A } = $(x | 0, H | 0, a | 0, d | 0), x = h | 0, H = b | 0, h = r | 0, b = n | 0, r = i | 0, n = o | 0;
|
|
433
|
+
const U = me(d, p, S);
|
|
434
|
+
i = Ue(U, a, f, l), o = U | 0;
|
|
397
435
|
}
|
|
398
|
-
this.
|
|
436
|
+
({ h: i, l: o } = $(this.Ah | 0, this.Al | 0, i | 0, o | 0)), { h: r, l: n } = $(this.Bh | 0, this.Bl | 0, r | 0, n | 0), { h, l: b } = $(this.Ch | 0, this.Cl | 0, h | 0, b | 0), { h: x, l: H } = $(this.Dh | 0, this.Dl | 0, x | 0, H | 0), { h: u, l: A } = $(this.Eh | 0, this.El | 0, u | 0, A | 0), { h: m, l: w } = $(this.Fh | 0, this.Fl | 0, m | 0, w | 0), { h: I, l: C } = $(this.Gh | 0, this.Gl | 0, I | 0, C | 0), { h: R, l: M } = $(this.Hh | 0, this.Hl | 0, R | 0, M | 0), this.set(i, o, r, n, h, b, x, H, u, A, m, w, I, C, R, M);
|
|
399
437
|
}
|
|
400
438
|
roundClean() {
|
|
401
|
-
|
|
439
|
+
ct(rt, it);
|
|
402
440
|
}
|
|
403
441
|
destroy() {
|
|
404
|
-
|
|
442
|
+
ct(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
405
443
|
}
|
|
406
444
|
}
|
|
407
|
-
const
|
|
408
|
-
var j = {},
|
|
409
|
-
function
|
|
410
|
-
return
|
|
445
|
+
const ve = /* @__PURE__ */ ne(() => new Oe()), Re = /* @__PURE__ */ ne(() => new Me()), ps = ve;
|
|
446
|
+
var j = {}, K = {}, Bt = {}, lt = {}, Tt;
|
|
447
|
+
function Ge() {
|
|
448
|
+
return Tt || (Tt = 1, Object.defineProperty(lt, "__esModule", { value: !0 }), lt.crypto = void 0, lt.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), lt;
|
|
411
449
|
}
|
|
412
|
-
var
|
|
413
|
-
function
|
|
414
|
-
return
|
|
415
|
-
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 = o, t.ahash =
|
|
416
|
-
const e = /* @__PURE__ */
|
|
450
|
+
var Mt;
|
|
451
|
+
function pt() {
|
|
452
|
+
return Mt || (Mt = 1, (function(t) {
|
|
453
|
+
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 = o, t.ahash = r, t.aexists = n, t.aoutput = h, t.u8 = b, t.u32 = x, t.clean = H, t.createView = u, t.rotr = A, t.rotl = m, t.byteSwap = w, t.byteSwap32 = I, t.bytesToHex = M, t.hexToBytes = L, t.asyncLoop = D, t.utf8ToBytes = B, t.bytesToUtf8 = a, t.toBytes = d, t.kdfInputToBytes = f, t.concatBytes = p, t.checkOpts = l, t.createHasher = U, t.createOptHasher = k, t.createXOFer = F, t.randomBytes = v;
|
|
454
|
+
const e = /* @__PURE__ */ Ge();
|
|
417
455
|
function s(c) {
|
|
418
456
|
return c instanceof Uint8Array || ArrayBuffer.isView(c) && c.constructor.name === "Uint8Array";
|
|
419
457
|
}
|
|
@@ -421,105 +459,105 @@ function lt() {
|
|
|
421
459
|
if (!Number.isSafeInteger(c) || c < 0)
|
|
422
460
|
throw new Error("positive integer expected, got " + c);
|
|
423
461
|
}
|
|
424
|
-
function o(c, ...
|
|
462
|
+
function o(c, ...g) {
|
|
425
463
|
if (!s(c))
|
|
426
464
|
throw new Error("Uint8Array expected");
|
|
427
|
-
if (
|
|
428
|
-
throw new Error("Uint8Array expected of length " +
|
|
465
|
+
if (g.length > 0 && !g.includes(c.length))
|
|
466
|
+
throw new Error("Uint8Array expected of length " + g + ", got length=" + c.length);
|
|
429
467
|
}
|
|
430
|
-
function
|
|
468
|
+
function r(c) {
|
|
431
469
|
if (typeof c != "function" || typeof c.create != "function")
|
|
432
470
|
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
433
471
|
i(c.outputLen), i(c.blockLen);
|
|
434
472
|
}
|
|
435
|
-
function
|
|
473
|
+
function n(c, g = !0) {
|
|
436
474
|
if (c.destroyed)
|
|
437
475
|
throw new Error("Hash instance has been destroyed");
|
|
438
|
-
if (
|
|
476
|
+
if (g && c.finished)
|
|
439
477
|
throw new Error("Hash#digest() has already been called");
|
|
440
478
|
}
|
|
441
|
-
function h(c,
|
|
479
|
+
function h(c, g) {
|
|
442
480
|
o(c);
|
|
443
|
-
const
|
|
444
|
-
if (c.length <
|
|
445
|
-
throw new Error("digestInto() expects output buffer of length at least " +
|
|
481
|
+
const _ = g.outputLen;
|
|
482
|
+
if (c.length < _)
|
|
483
|
+
throw new Error("digestInto() expects output buffer of length at least " + _);
|
|
446
484
|
}
|
|
447
|
-
function
|
|
485
|
+
function b(c) {
|
|
448
486
|
return new Uint8Array(c.buffer, c.byteOffset, c.byteLength);
|
|
449
487
|
}
|
|
450
488
|
function x(c) {
|
|
451
489
|
return new Uint32Array(c.buffer, c.byteOffset, Math.floor(c.byteLength / 4));
|
|
452
490
|
}
|
|
453
|
-
function
|
|
454
|
-
for (let
|
|
455
|
-
c[
|
|
491
|
+
function H(...c) {
|
|
492
|
+
for (let g = 0; g < c.length; g++)
|
|
493
|
+
c[g].fill(0);
|
|
456
494
|
}
|
|
457
|
-
function
|
|
495
|
+
function u(c) {
|
|
458
496
|
return new DataView(c.buffer, c.byteOffset, c.byteLength);
|
|
459
497
|
}
|
|
460
|
-
function
|
|
461
|
-
return c << 32 -
|
|
498
|
+
function A(c, g) {
|
|
499
|
+
return c << 32 - g | c >>> g;
|
|
462
500
|
}
|
|
463
|
-
function
|
|
464
|
-
return c <<
|
|
501
|
+
function m(c, g) {
|
|
502
|
+
return c << g | c >>> 32 - g >>> 0;
|
|
465
503
|
}
|
|
466
504
|
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
467
|
-
function
|
|
505
|
+
function w(c) {
|
|
468
506
|
return c << 24 & 4278190080 | c << 8 & 16711680 | c >>> 8 & 65280 | c >>> 24 & 255;
|
|
469
507
|
}
|
|
470
|
-
t.swap8IfBE = t.isLE ? (c) => c : (c) =>
|
|
471
|
-
function
|
|
472
|
-
for (let
|
|
473
|
-
c[
|
|
508
|
+
t.swap8IfBE = t.isLE ? (c) => c : (c) => w(c), t.byteSwapIfBE = t.swap8IfBE;
|
|
509
|
+
function I(c) {
|
|
510
|
+
for (let g = 0; g < c.length; g++)
|
|
511
|
+
c[g] = w(c[g]);
|
|
474
512
|
return c;
|
|
475
513
|
}
|
|
476
|
-
t.swap32IfBE = t.isLE ? (c) => c :
|
|
477
|
-
const
|
|
478
|
-
function
|
|
479
|
-
if (o(c),
|
|
514
|
+
t.swap32IfBE = t.isLE ? (c) => c : I;
|
|
515
|
+
const C = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", R = /* @__PURE__ */ Array.from({ length: 256 }, (c, g) => g.toString(16).padStart(2, "0"));
|
|
516
|
+
function M(c) {
|
|
517
|
+
if (o(c), C)
|
|
480
518
|
return c.toHex();
|
|
481
|
-
let
|
|
482
|
-
for (let
|
|
483
|
-
|
|
484
|
-
return
|
|
485
|
-
}
|
|
486
|
-
const
|
|
487
|
-
function
|
|
488
|
-
if (c >=
|
|
489
|
-
return c -
|
|
490
|
-
if (c >=
|
|
491
|
-
return c - (
|
|
492
|
-
if (c >=
|
|
493
|
-
return c - (
|
|
494
|
-
}
|
|
495
|
-
function
|
|
519
|
+
let g = "";
|
|
520
|
+
for (let _ = 0; _ < c.length; _++)
|
|
521
|
+
g += R[c[_]];
|
|
522
|
+
return g;
|
|
523
|
+
}
|
|
524
|
+
const y = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
525
|
+
function O(c) {
|
|
526
|
+
if (c >= y._0 && c <= y._9)
|
|
527
|
+
return c - y._0;
|
|
528
|
+
if (c >= y.A && c <= y.F)
|
|
529
|
+
return c - (y.A - 10);
|
|
530
|
+
if (c >= y.a && c <= y.f)
|
|
531
|
+
return c - (y.a - 10);
|
|
532
|
+
}
|
|
533
|
+
function L(c) {
|
|
496
534
|
if (typeof c != "string")
|
|
497
535
|
throw new Error("hex string expected, got " + typeof c);
|
|
498
|
-
if (
|
|
536
|
+
if (C)
|
|
499
537
|
return Uint8Array.fromHex(c);
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
throw new Error("hex string expected, got unpadded hex of length " +
|
|
503
|
-
const
|
|
504
|
-
for (let
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
508
|
-
throw new Error('hex string expected, got non-hex character "' +
|
|
538
|
+
const g = c.length, _ = g / 2;
|
|
539
|
+
if (g % 2)
|
|
540
|
+
throw new Error("hex string expected, got unpadded hex of length " + g);
|
|
541
|
+
const T = new Uint8Array(_);
|
|
542
|
+
for (let G = 0, P = 0; G < _; G++, P += 2) {
|
|
543
|
+
const tt = O(c.charCodeAt(P)), X = O(c.charCodeAt(P + 1));
|
|
544
|
+
if (tt === void 0 || X === void 0) {
|
|
545
|
+
const J = c[P] + c[P + 1];
|
|
546
|
+
throw new Error('hex string expected, got non-hex character "' + J + '" at index ' + P);
|
|
509
547
|
}
|
|
510
|
-
|
|
548
|
+
T[G] = tt * 16 + X;
|
|
511
549
|
}
|
|
512
|
-
return
|
|
550
|
+
return T;
|
|
513
551
|
}
|
|
514
|
-
const
|
|
552
|
+
const E = async () => {
|
|
515
553
|
};
|
|
516
|
-
t.nextTick =
|
|
517
|
-
async function
|
|
518
|
-
let
|
|
519
|
-
for (let
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
|
|
554
|
+
t.nextTick = E;
|
|
555
|
+
async function D(c, g, _) {
|
|
556
|
+
let T = Date.now();
|
|
557
|
+
for (let G = 0; G < c; G++) {
|
|
558
|
+
_(G);
|
|
559
|
+
const P = Date.now() - T;
|
|
560
|
+
P >= 0 && P < g || (await (0, t.nextTick)(), T += P);
|
|
523
561
|
}
|
|
524
562
|
}
|
|
525
563
|
function B(c) {
|
|
@@ -530,46 +568,46 @@ function lt() {
|
|
|
530
568
|
function a(c) {
|
|
531
569
|
return new TextDecoder().decode(c);
|
|
532
570
|
}
|
|
533
|
-
function
|
|
571
|
+
function d(c) {
|
|
534
572
|
return typeof c == "string" && (c = B(c)), o(c), c;
|
|
535
573
|
}
|
|
536
574
|
function f(c) {
|
|
537
575
|
return typeof c == "string" && (c = B(c)), o(c), c;
|
|
538
576
|
}
|
|
539
|
-
function
|
|
540
|
-
let
|
|
541
|
-
for (let
|
|
542
|
-
const
|
|
543
|
-
o(
|
|
577
|
+
function p(...c) {
|
|
578
|
+
let g = 0;
|
|
579
|
+
for (let T = 0; T < c.length; T++) {
|
|
580
|
+
const G = c[T];
|
|
581
|
+
o(G), g += G.length;
|
|
544
582
|
}
|
|
545
|
-
const
|
|
546
|
-
for (let
|
|
547
|
-
const
|
|
548
|
-
|
|
583
|
+
const _ = new Uint8Array(g);
|
|
584
|
+
for (let T = 0, G = 0; T < c.length; T++) {
|
|
585
|
+
const P = c[T];
|
|
586
|
+
_.set(P, G), G += P.length;
|
|
549
587
|
}
|
|
550
|
-
return
|
|
588
|
+
return _;
|
|
551
589
|
}
|
|
552
|
-
function l(c,
|
|
553
|
-
if (
|
|
590
|
+
function l(c, g) {
|
|
591
|
+
if (g !== void 0 && {}.toString.call(g) !== "[object Object]")
|
|
554
592
|
throw new Error("options should be object or undefined");
|
|
555
|
-
return Object.assign(c,
|
|
593
|
+
return Object.assign(c, g);
|
|
556
594
|
}
|
|
557
|
-
class
|
|
595
|
+
class S {
|
|
558
596
|
}
|
|
559
|
-
t.Hash =
|
|
560
|
-
function
|
|
561
|
-
const
|
|
562
|
-
return
|
|
597
|
+
t.Hash = S;
|
|
598
|
+
function U(c) {
|
|
599
|
+
const g = (T) => c().update(d(T)).digest(), _ = c();
|
|
600
|
+
return g.outputLen = _.outputLen, g.blockLen = _.blockLen, g.create = () => c(), g;
|
|
563
601
|
}
|
|
564
|
-
function
|
|
565
|
-
const
|
|
566
|
-
return
|
|
602
|
+
function k(c) {
|
|
603
|
+
const g = (T, G) => c(G).update(d(T)).digest(), _ = c({});
|
|
604
|
+
return g.outputLen = _.outputLen, g.blockLen = _.blockLen, g.create = (T) => c(T), g;
|
|
567
605
|
}
|
|
568
|
-
function
|
|
569
|
-
const
|
|
570
|
-
return
|
|
606
|
+
function F(c) {
|
|
607
|
+
const g = (T, G) => c(G).update(d(T)).digest(), _ = c({});
|
|
608
|
+
return g.outputLen = _.outputLen, g.blockLen = _.blockLen, g.create = (T) => c(T), g;
|
|
571
609
|
}
|
|
572
|
-
t.wrapConstructor =
|
|
610
|
+
t.wrapConstructor = U, t.wrapConstructorWithOpts = k, t.wrapXOFConstructorWithOpts = F;
|
|
573
611
|
function v(c = 32) {
|
|
574
612
|
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
575
613
|
return e.crypto.getRandomValues(new Uint8Array(c));
|
|
@@ -577,77 +615,77 @@ function lt() {
|
|
|
577
615
|
return Uint8Array.from(e.crypto.randomBytes(c));
|
|
578
616
|
throw new Error("crypto.getRandomValues must be defined");
|
|
579
617
|
}
|
|
580
|
-
})(
|
|
618
|
+
})(Bt)), Bt;
|
|
581
619
|
}
|
|
582
|
-
var
|
|
583
|
-
function
|
|
584
|
-
if (
|
|
585
|
-
|
|
586
|
-
const t = /* @__PURE__ */
|
|
587
|
-
function e(
|
|
588
|
-
if (typeof
|
|
589
|
-
return
|
|
590
|
-
const x = BigInt(32),
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
function s(
|
|
594
|
-
return
|
|
595
|
-
}
|
|
596
|
-
function i(
|
|
597
|
-
return
|
|
620
|
+
var vt;
|
|
621
|
+
function oe() {
|
|
622
|
+
if (vt) return K;
|
|
623
|
+
vt = 1, Object.defineProperty(K, "__esModule", { value: !0 }), K.SHA512_IV = K.SHA384_IV = K.SHA224_IV = K.SHA256_IV = K.HashMD = void 0, K.setBigUint64 = e, K.Chi = s, K.Maj = i;
|
|
624
|
+
const t = /* @__PURE__ */ pt();
|
|
625
|
+
function e(r, n, h, b) {
|
|
626
|
+
if (typeof r.setBigUint64 == "function")
|
|
627
|
+
return r.setBigUint64(n, h, b);
|
|
628
|
+
const x = BigInt(32), H = BigInt(4294967295), u = Number(h >> x & H), A = Number(h & H), m = b ? 4 : 0, w = b ? 0 : 4;
|
|
629
|
+
r.setUint32(n + m, u, b), r.setUint32(n + w, A, b);
|
|
630
|
+
}
|
|
631
|
+
function s(r, n, h) {
|
|
632
|
+
return r & n ^ ~r & h;
|
|
633
|
+
}
|
|
634
|
+
function i(r, n, h) {
|
|
635
|
+
return r & n ^ r & h ^ n & h;
|
|
598
636
|
}
|
|
599
637
|
class o extends t.Hash {
|
|
600
|
-
constructor(
|
|
601
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen =
|
|
602
|
-
}
|
|
603
|
-
update(
|
|
604
|
-
(0, t.aexists)(this),
|
|
605
|
-
const { view: h, buffer:
|
|
606
|
-
for (let
|
|
607
|
-
const
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
for (; x <=
|
|
611
|
-
this.process(
|
|
638
|
+
constructor(n, h, b, x) {
|
|
639
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = n, this.outputLen = h, this.padOffset = b, this.isLE = x, this.buffer = new Uint8Array(n), this.view = (0, t.createView)(this.buffer);
|
|
640
|
+
}
|
|
641
|
+
update(n) {
|
|
642
|
+
(0, t.aexists)(this), n = (0, t.toBytes)(n), (0, t.abytes)(n);
|
|
643
|
+
const { view: h, buffer: b, blockLen: x } = this, H = n.length;
|
|
644
|
+
for (let u = 0; u < H; ) {
|
|
645
|
+
const A = Math.min(x - this.pos, H - u);
|
|
646
|
+
if (A === x) {
|
|
647
|
+
const m = (0, t.createView)(n);
|
|
648
|
+
for (; x <= H - u; u += x)
|
|
649
|
+
this.process(m, u);
|
|
612
650
|
continue;
|
|
613
651
|
}
|
|
614
|
-
|
|
652
|
+
b.set(n.subarray(u, u + A), this.pos), this.pos += A, u += A, this.pos === x && (this.process(h, 0), this.pos = 0);
|
|
615
653
|
}
|
|
616
|
-
return this.length +=
|
|
617
|
-
}
|
|
618
|
-
digestInto(
|
|
619
|
-
(0, t.aexists)(this), (0, t.aoutput)(
|
|
620
|
-
const { buffer: h, view:
|
|
621
|
-
let { pos:
|
|
622
|
-
h[
|
|
623
|
-
for (let
|
|
624
|
-
h[
|
|
625
|
-
e(
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
654
|
+
return this.length += n.length, this.roundClean(), this;
|
|
655
|
+
}
|
|
656
|
+
digestInto(n) {
|
|
657
|
+
(0, t.aexists)(this), (0, t.aoutput)(n, this), this.finished = !0;
|
|
658
|
+
const { buffer: h, view: b, blockLen: x, isLE: H } = this;
|
|
659
|
+
let { pos: u } = this;
|
|
660
|
+
h[u++] = 128, (0, t.clean)(this.buffer.subarray(u)), this.padOffset > x - u && (this.process(b, 0), u = 0);
|
|
661
|
+
for (let C = u; C < x; C++)
|
|
662
|
+
h[C] = 0;
|
|
663
|
+
e(b, x - 8, BigInt(this.length * 8), H), this.process(b, 0);
|
|
664
|
+
const A = (0, t.createView)(n), m = this.outputLen;
|
|
665
|
+
if (m % 4)
|
|
628
666
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
629
|
-
const
|
|
630
|
-
if (
|
|
667
|
+
const w = m / 4, I = this.get();
|
|
668
|
+
if (w > I.length)
|
|
631
669
|
throw new Error("_sha2: outputLen bigger than state");
|
|
632
|
-
for (let
|
|
633
|
-
|
|
670
|
+
for (let C = 0; C < w; C++)
|
|
671
|
+
A.setUint32(4 * C, I[C], H);
|
|
634
672
|
}
|
|
635
673
|
digest() {
|
|
636
|
-
const { buffer:
|
|
637
|
-
this.digestInto(
|
|
638
|
-
const
|
|
639
|
-
return this.destroy(),
|
|
674
|
+
const { buffer: n, outputLen: h } = this;
|
|
675
|
+
this.digestInto(n);
|
|
676
|
+
const b = n.slice(0, h);
|
|
677
|
+
return this.destroy(), b;
|
|
640
678
|
}
|
|
641
|
-
_cloneInto(
|
|
642
|
-
|
|
643
|
-
const { blockLen: h, buffer:
|
|
644
|
-
return
|
|
679
|
+
_cloneInto(n) {
|
|
680
|
+
n || (n = new this.constructor()), n.set(...this.get());
|
|
681
|
+
const { blockLen: h, buffer: b, length: x, finished: H, destroyed: u, pos: A } = this;
|
|
682
|
+
return n.destroyed = u, n.finished = H, n.length = x, n.pos = A, x % h && n.buffer.set(b), n;
|
|
645
683
|
}
|
|
646
684
|
clone() {
|
|
647
685
|
return this._cloneInto();
|
|
648
686
|
}
|
|
649
687
|
}
|
|
650
|
-
return
|
|
688
|
+
return K.HashMD = o, K.SHA256_IV = Uint32Array.from([
|
|
651
689
|
1779033703,
|
|
652
690
|
3144134277,
|
|
653
691
|
1013904242,
|
|
@@ -656,7 +694,7 @@ function se() {
|
|
|
656
694
|
2600822924,
|
|
657
695
|
528734635,
|
|
658
696
|
1541459225
|
|
659
|
-
]),
|
|
697
|
+
]), K.SHA224_IV = Uint32Array.from([
|
|
660
698
|
3238371032,
|
|
661
699
|
914150663,
|
|
662
700
|
812702999,
|
|
@@ -665,7 +703,7 @@ function se() {
|
|
|
665
703
|
1750603025,
|
|
666
704
|
1694076839,
|
|
667
705
|
3204075428
|
|
668
|
-
]),
|
|
706
|
+
]), K.SHA384_IV = Uint32Array.from([
|
|
669
707
|
3418070365,
|
|
670
708
|
3238371032,
|
|
671
709
|
1654270250,
|
|
@@ -682,7 +720,7 @@ function se() {
|
|
|
682
720
|
1694076839,
|
|
683
721
|
1203062813,
|
|
684
722
|
3204075428
|
|
685
|
-
]),
|
|
723
|
+
]), K.SHA512_IV = Uint32Array.from([
|
|
686
724
|
1779033703,
|
|
687
725
|
4089235720,
|
|
688
726
|
3144134277,
|
|
@@ -699,98 +737,98 @@ function se() {
|
|
|
699
737
|
4215389547,
|
|
700
738
|
1541459225,
|
|
701
739
|
327033209
|
|
702
|
-
]),
|
|
740
|
+
]), K;
|
|
703
741
|
}
|
|
704
|
-
var
|
|
705
|
-
function
|
|
706
|
-
if (
|
|
707
|
-
|
|
742
|
+
var V = {}, Rt;
|
|
743
|
+
function je() {
|
|
744
|
+
if (Rt) return V;
|
|
745
|
+
Rt = 1, Object.defineProperty(V, "__esModule", { value: !0 }), V.toBig = V.shrSL = V.shrSH = V.rotrSL = V.rotrSH = V.rotrBL = V.rotrBH = V.rotr32L = V.rotr32H = V.rotlSL = V.rotlSH = V.rotlBL = V.rotlBH = V.add5L = V.add5H = V.add4L = V.add4H = V.add3L = V.add3H = void 0, V.add = R, V.fromBig = s, V.split = i;
|
|
708
746
|
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
709
|
-
function s(a,
|
|
710
|
-
return
|
|
747
|
+
function s(a, d = !1) {
|
|
748
|
+
return d ? { h: Number(a & t), l: Number(a >> e & t) } : { h: Number(a >> e & t) | 0, l: Number(a & t) | 0 };
|
|
711
749
|
}
|
|
712
|
-
function i(a,
|
|
750
|
+
function i(a, d = !1) {
|
|
713
751
|
const f = a.length;
|
|
714
|
-
let
|
|
715
|
-
for (let
|
|
716
|
-
const { h:
|
|
717
|
-
[
|
|
718
|
-
}
|
|
719
|
-
return [
|
|
720
|
-
}
|
|
721
|
-
const o = (a,
|
|
722
|
-
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const h = (a,
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
const x = (a,
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
const
|
|
740
|
-
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
747
|
-
function
|
|
748
|
-
const l = (
|
|
752
|
+
let p = new Uint32Array(f), l = new Uint32Array(f);
|
|
753
|
+
for (let S = 0; S < f; S++) {
|
|
754
|
+
const { h: U, l: k } = s(a[S], d);
|
|
755
|
+
[p[S], l[S]] = [U, k];
|
|
756
|
+
}
|
|
757
|
+
return [p, l];
|
|
758
|
+
}
|
|
759
|
+
const o = (a, d) => BigInt(a >>> 0) << e | BigInt(d >>> 0);
|
|
760
|
+
V.toBig = o;
|
|
761
|
+
const r = (a, d, f) => a >>> f;
|
|
762
|
+
V.shrSH = r;
|
|
763
|
+
const n = (a, d, f) => a << 32 - f | d >>> f;
|
|
764
|
+
V.shrSL = n;
|
|
765
|
+
const h = (a, d, f) => a >>> f | d << 32 - f;
|
|
766
|
+
V.rotrSH = h;
|
|
767
|
+
const b = (a, d, f) => a << 32 - f | d >>> f;
|
|
768
|
+
V.rotrSL = b;
|
|
769
|
+
const x = (a, d, f) => a << 64 - f | d >>> f - 32;
|
|
770
|
+
V.rotrBH = x;
|
|
771
|
+
const H = (a, d, f) => a >>> f - 32 | d << 64 - f;
|
|
772
|
+
V.rotrBL = H;
|
|
773
|
+
const u = (a, d) => d;
|
|
774
|
+
V.rotr32H = u;
|
|
775
|
+
const A = (a, d) => a;
|
|
776
|
+
V.rotr32L = A;
|
|
777
|
+
const m = (a, d, f) => a << f | d >>> 32 - f;
|
|
778
|
+
V.rotlSH = m;
|
|
779
|
+
const w = (a, d, f) => d << f | a >>> 32 - f;
|
|
780
|
+
V.rotlSL = w;
|
|
781
|
+
const I = (a, d, f) => d << f - 32 | a >>> 64 - f;
|
|
782
|
+
V.rotlBH = I;
|
|
783
|
+
const C = (a, d, f) => a << f - 32 | d >>> 64 - f;
|
|
784
|
+
V.rotlBL = C;
|
|
785
|
+
function R(a, d, f, p) {
|
|
786
|
+
const l = (d >>> 0) + (p >>> 0);
|
|
749
787
|
return { h: a + f + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
750
788
|
}
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
789
|
+
const M = (a, d, f) => (a >>> 0) + (d >>> 0) + (f >>> 0);
|
|
790
|
+
V.add3L = M;
|
|
791
|
+
const y = (a, d, f, p) => d + f + p + (a / 2 ** 32 | 0) | 0;
|
|
792
|
+
V.add3H = y;
|
|
793
|
+
const O = (a, d, f, p) => (a >>> 0) + (d >>> 0) + (f >>> 0) + (p >>> 0);
|
|
794
|
+
V.add4L = O;
|
|
795
|
+
const L = (a, d, f, p, l) => d + f + p + l + (a / 2 ** 32 | 0) | 0;
|
|
796
|
+
V.add4H = L;
|
|
797
|
+
const E = (a, d, f, p, l) => (a >>> 0) + (d >>> 0) + (f >>> 0) + (p >>> 0) + (l >>> 0);
|
|
798
|
+
V.add5L = E;
|
|
799
|
+
const D = (a, d, f, p, l, S) => d + f + p + l + S + (a / 2 ** 32 | 0) | 0;
|
|
800
|
+
V.add5H = D;
|
|
763
801
|
const B = {
|
|
764
802
|
fromBig: s,
|
|
765
803
|
split: i,
|
|
766
804
|
toBig: o,
|
|
767
|
-
shrSH:
|
|
768
|
-
shrSL:
|
|
805
|
+
shrSH: r,
|
|
806
|
+
shrSL: n,
|
|
769
807
|
rotrSH: h,
|
|
770
|
-
rotrSL:
|
|
808
|
+
rotrSL: b,
|
|
771
809
|
rotrBH: x,
|
|
772
|
-
rotrBL:
|
|
773
|
-
rotr32H:
|
|
774
|
-
rotr32L:
|
|
775
|
-
rotlSH:
|
|
776
|
-
rotlSL:
|
|
777
|
-
rotlBH:
|
|
778
|
-
rotlBL:
|
|
779
|
-
add:
|
|
780
|
-
add3L:
|
|
781
|
-
add3H:
|
|
782
|
-
add4L:
|
|
783
|
-
add4H:
|
|
784
|
-
add5H:
|
|
785
|
-
add5L:
|
|
810
|
+
rotrBL: H,
|
|
811
|
+
rotr32H: u,
|
|
812
|
+
rotr32L: A,
|
|
813
|
+
rotlSH: m,
|
|
814
|
+
rotlSL: w,
|
|
815
|
+
rotlBH: I,
|
|
816
|
+
rotlBL: C,
|
|
817
|
+
add: R,
|
|
818
|
+
add3L: M,
|
|
819
|
+
add3H: y,
|
|
820
|
+
add4L: O,
|
|
821
|
+
add4H: L,
|
|
822
|
+
add5H: D,
|
|
823
|
+
add5L: E
|
|
786
824
|
};
|
|
787
|
-
return
|
|
825
|
+
return V.default = B, V;
|
|
788
826
|
}
|
|
789
|
-
var
|
|
790
|
-
function
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
const t = /* @__PURE__ */
|
|
827
|
+
var Gt;
|
|
828
|
+
function ce() {
|
|
829
|
+
if (Gt) return j;
|
|
830
|
+
Gt = 1, Object.defineProperty(j, "__esModule", { value: !0 }), j.sha512_224 = j.sha512_256 = j.sha384 = j.sha512 = j.sha224 = j.sha256 = j.SHA512_256 = j.SHA512_224 = j.SHA384 = j.SHA512 = j.SHA224 = j.SHA256 = void 0;
|
|
831
|
+
const t = /* @__PURE__ */ oe(), e = /* @__PURE__ */ je(), s = /* @__PURE__ */ pt(), i = /* @__PURE__ */ Uint32Array.from([
|
|
794
832
|
1116352408,
|
|
795
833
|
1899447441,
|
|
796
834
|
3049323471,
|
|
@@ -856,31 +894,31 @@ function ne() {
|
|
|
856
894
|
3204031479,
|
|
857
895
|
3329325298
|
|
858
896
|
]), o = /* @__PURE__ */ new Uint32Array(64);
|
|
859
|
-
class
|
|
860
|
-
constructor(
|
|
861
|
-
super(64,
|
|
897
|
+
class r extends t.HashMD {
|
|
898
|
+
constructor(y = 32) {
|
|
899
|
+
super(64, y, 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;
|
|
862
900
|
}
|
|
863
901
|
get() {
|
|
864
|
-
const { A:
|
|
865
|
-
return [
|
|
902
|
+
const { A: y, B: O, C: L, D: E, E: D, F: B, G: a, H: d } = this;
|
|
903
|
+
return [y, O, L, E, D, B, a, d];
|
|
866
904
|
}
|
|
867
905
|
// prettier-ignore
|
|
868
|
-
set(
|
|
869
|
-
this.A =
|
|
906
|
+
set(y, O, L, E, D, B, a, d) {
|
|
907
|
+
this.A = y | 0, this.B = O | 0, this.C = L | 0, this.D = E | 0, this.E = D | 0, this.F = B | 0, this.G = a | 0, this.H = d | 0;
|
|
870
908
|
}
|
|
871
|
-
process(
|
|
872
|
-
for (let l = 0; l < 16; l++,
|
|
873
|
-
o[l] =
|
|
909
|
+
process(y, O) {
|
|
910
|
+
for (let l = 0; l < 16; l++, O += 4)
|
|
911
|
+
o[l] = y.getUint32(O, !1);
|
|
874
912
|
for (let l = 16; l < 64; l++) {
|
|
875
|
-
const
|
|
876
|
-
o[l] =
|
|
913
|
+
const S = o[l - 15], U = o[l - 2], k = (0, s.rotr)(S, 7) ^ (0, s.rotr)(S, 18) ^ S >>> 3, F = (0, s.rotr)(U, 17) ^ (0, s.rotr)(U, 19) ^ U >>> 10;
|
|
914
|
+
o[l] = F + o[l - 7] + k + o[l - 16] | 0;
|
|
877
915
|
}
|
|
878
|
-
let { A:
|
|
916
|
+
let { A: L, B: E, C: D, D: B, E: a, F: d, G: f, H: p } = this;
|
|
879
917
|
for (let l = 0; l < 64; l++) {
|
|
880
|
-
const
|
|
881
|
-
|
|
918
|
+
const S = (0, s.rotr)(a, 6) ^ (0, s.rotr)(a, 11) ^ (0, s.rotr)(a, 25), U = p + S + (0, t.Chi)(a, d, f) + i[l] + o[l] | 0, F = ((0, s.rotr)(L, 2) ^ (0, s.rotr)(L, 13) ^ (0, s.rotr)(L, 22)) + (0, t.Maj)(L, E, D) | 0;
|
|
919
|
+
p = f, f = d, d = a, a = B + U | 0, B = D, D = E, E = L, L = U + F | 0;
|
|
882
920
|
}
|
|
883
|
-
|
|
921
|
+
L = L + this.A | 0, E = E + this.B | 0, D = D + this.C | 0, B = B + this.D | 0, a = a + this.E | 0, d = d + this.F | 0, f = f + this.G | 0, p = p + this.H | 0, this.set(L, E, D, B, a, d, f, p);
|
|
884
922
|
}
|
|
885
923
|
roundClean() {
|
|
886
924
|
(0, s.clean)(o);
|
|
@@ -889,13 +927,13 @@ function ne() {
|
|
|
889
927
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
|
|
890
928
|
}
|
|
891
929
|
}
|
|
892
|
-
j.SHA256 =
|
|
893
|
-
class
|
|
930
|
+
j.SHA256 = r;
|
|
931
|
+
class n extends r {
|
|
894
932
|
constructor() {
|
|
895
933
|
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;
|
|
896
934
|
}
|
|
897
935
|
}
|
|
898
|
-
j.SHA224 =
|
|
936
|
+
j.SHA224 = n;
|
|
899
937
|
const h = e.split([
|
|
900
938
|
"0x428a2f98d728ae22",
|
|
901
939
|
"0x7137449123ef65cd",
|
|
@@ -977,51 +1015,51 @@ function ne() {
|
|
|
977
1015
|
"0x597f299cfc657e2a",
|
|
978
1016
|
"0x5fcb6fab3ad6faec",
|
|
979
1017
|
"0x6c44198c4a475817"
|
|
980
|
-
].map((
|
|
981
|
-
class
|
|
982
|
-
constructor(
|
|
983
|
-
super(128,
|
|
1018
|
+
].map((M) => BigInt(M))), b = h[0], x = h[1], H = /* @__PURE__ */ new Uint32Array(80), u = /* @__PURE__ */ new Uint32Array(80);
|
|
1019
|
+
class A extends t.HashMD {
|
|
1020
|
+
constructor(y = 64) {
|
|
1021
|
+
super(128, y, 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;
|
|
984
1022
|
}
|
|
985
1023
|
// prettier-ignore
|
|
986
1024
|
get() {
|
|
987
|
-
const { Ah:
|
|
988
|
-
return [
|
|
1025
|
+
const { Ah: y, Al: O, Bh: L, Bl: E, Ch: D, Cl: B, Dh: a, Dl: d, Eh: f, El: p, Fh: l, Fl: S, Gh: U, Gl: k, Hh: F, Hl: v } = this;
|
|
1026
|
+
return [y, O, L, E, D, B, a, d, f, p, l, S, U, k, F, v];
|
|
989
1027
|
}
|
|
990
1028
|
// prettier-ignore
|
|
991
|
-
set(
|
|
992
|
-
this.Ah =
|
|
993
|
-
}
|
|
994
|
-
process(
|
|
995
|
-
for (let
|
|
996
|
-
|
|
997
|
-
for (let
|
|
998
|
-
const
|
|
999
|
-
|
|
1029
|
+
set(y, O, L, E, D, B, a, d, f, p, l, S, U, k, F, v) {
|
|
1030
|
+
this.Ah = y | 0, this.Al = O | 0, this.Bh = L | 0, this.Bl = E | 0, this.Ch = D | 0, this.Cl = B | 0, this.Dh = a | 0, this.Dl = d | 0, this.Eh = f | 0, this.El = p | 0, this.Fh = l | 0, this.Fl = S | 0, this.Gh = U | 0, this.Gl = k | 0, this.Hh = F | 0, this.Hl = v | 0;
|
|
1031
|
+
}
|
|
1032
|
+
process(y, O) {
|
|
1033
|
+
for (let _ = 0; _ < 16; _++, O += 4)
|
|
1034
|
+
H[_] = y.getUint32(O), u[_] = y.getUint32(O += 4);
|
|
1035
|
+
for (let _ = 16; _ < 80; _++) {
|
|
1036
|
+
const T = H[_ - 15] | 0, G = u[_ - 15] | 0, P = e.rotrSH(T, G, 1) ^ e.rotrSH(T, G, 8) ^ e.shrSH(T, G, 7), tt = e.rotrSL(T, G, 1) ^ e.rotrSL(T, G, 8) ^ e.shrSL(T, G, 7), X = H[_ - 2] | 0, J = u[_ - 2] | 0, at = e.rotrSH(X, J, 19) ^ e.rotrBH(X, J, 61) ^ e.shrSH(X, J, 6), Q = e.rotrSL(X, J, 19) ^ e.rotrBL(X, J, 61) ^ e.shrSL(X, J, 6), et = e.add4L(tt, Q, u[_ - 7], u[_ - 16]), Lt = e.add4H(et, P, at, H[_ - 7], H[_ - 16]);
|
|
1037
|
+
H[_] = Lt | 0, u[_] = et | 0;
|
|
1000
1038
|
}
|
|
1001
|
-
let { Ah:
|
|
1002
|
-
for (let
|
|
1003
|
-
const
|
|
1004
|
-
c =
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1039
|
+
let { Ah: L, Al: E, Bh: D, Bl: B, Ch: a, Cl: d, Dh: f, Dl: p, Eh: l, El: S, Fh: U, Fl: k, Gh: F, Gl: v, Hh: c, Hl: g } = this;
|
|
1040
|
+
for (let _ = 0; _ < 80; _++) {
|
|
1041
|
+
const T = e.rotrSH(l, S, 14) ^ e.rotrSH(l, S, 18) ^ e.rotrBH(l, S, 41), G = e.rotrSL(l, S, 14) ^ e.rotrSL(l, S, 18) ^ e.rotrBL(l, S, 41), P = l & U ^ ~l & F, tt = S & k ^ ~S & v, X = e.add5L(g, G, tt, x[_], u[_]), J = e.add5H(X, c, T, P, b[_], H[_]), at = X | 0, Q = e.rotrSH(L, E, 28) ^ e.rotrBH(L, E, 34) ^ e.rotrBH(L, E, 39), et = e.rotrSL(L, E, 28) ^ e.rotrBL(L, E, 34) ^ e.rotrBL(L, E, 39), Lt = L & D ^ L & a ^ D & a, pe = E & B ^ E & d ^ B & d;
|
|
1042
|
+
c = F | 0, g = v | 0, F = U | 0, v = k | 0, U = l | 0, k = S | 0, { h: l, l: S } = e.add(f | 0, p | 0, J | 0, at | 0), f = a | 0, p = d | 0, a = D | 0, d = B | 0, D = L | 0, B = E | 0;
|
|
1043
|
+
const kt = e.add3L(at, et, pe);
|
|
1044
|
+
L = e.add3H(kt, J, Q, Lt), E = kt | 0;
|
|
1007
1045
|
}
|
|
1008
|
-
({ h:
|
|
1046
|
+
({ h: L, l: E } = e.add(this.Ah | 0, this.Al | 0, L | 0, E | 0)), { h: D, l: B } = e.add(this.Bh | 0, this.Bl | 0, D | 0, B | 0), { h: a, l: d } = e.add(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: f, l: p } = e.add(this.Dh | 0, this.Dl | 0, f | 0, p | 0), { h: l, l: S } = e.add(this.Eh | 0, this.El | 0, l | 0, S | 0), { h: U, l: k } = e.add(this.Fh | 0, this.Fl | 0, U | 0, k | 0), { h: F, l: v } = e.add(this.Gh | 0, this.Gl | 0, F | 0, v | 0), { h: c, l: g } = e.add(this.Hh | 0, this.Hl | 0, c | 0, g | 0), this.set(L, E, D, B, a, d, f, p, l, S, U, k, F, v, c, g);
|
|
1009
1047
|
}
|
|
1010
1048
|
roundClean() {
|
|
1011
|
-
(0, s.clean)(
|
|
1049
|
+
(0, s.clean)(H, u);
|
|
1012
1050
|
}
|
|
1013
1051
|
destroy() {
|
|
1014
1052
|
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1015
1053
|
}
|
|
1016
1054
|
}
|
|
1017
|
-
j.SHA512 =
|
|
1018
|
-
class
|
|
1055
|
+
j.SHA512 = A;
|
|
1056
|
+
class m extends A {
|
|
1019
1057
|
constructor() {
|
|
1020
1058
|
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;
|
|
1021
1059
|
}
|
|
1022
1060
|
}
|
|
1023
|
-
j.SHA384 =
|
|
1024
|
-
const
|
|
1061
|
+
j.SHA384 = m;
|
|
1062
|
+
const w = /* @__PURE__ */ Uint32Array.from([
|
|
1025
1063
|
2352822216,
|
|
1026
1064
|
424955298,
|
|
1027
1065
|
1944164710,
|
|
@@ -1038,7 +1076,7 @@ function ne() {
|
|
|
1038
1076
|
1780299464,
|
|
1039
1077
|
286451373,
|
|
1040
1078
|
2446758561
|
|
1041
|
-
]),
|
|
1079
|
+
]), I = /* @__PURE__ */ Uint32Array.from([
|
|
1042
1080
|
573645204,
|
|
1043
1081
|
4230739756,
|
|
1044
1082
|
2673172387,
|
|
@@ -1056,54 +1094,54 @@ function ne() {
|
|
|
1056
1094
|
246885852,
|
|
1057
1095
|
2177182882
|
|
1058
1096
|
]);
|
|
1059
|
-
class
|
|
1097
|
+
class C extends A {
|
|
1060
1098
|
constructor() {
|
|
1061
|
-
super(28), this.Ah =
|
|
1099
|
+
super(28), this.Ah = w[0] | 0, this.Al = w[1] | 0, this.Bh = w[2] | 0, this.Bl = w[3] | 0, this.Ch = w[4] | 0, this.Cl = w[5] | 0, this.Dh = w[6] | 0, this.Dl = w[7] | 0, this.Eh = w[8] | 0, this.El = w[9] | 0, this.Fh = w[10] | 0, this.Fl = w[11] | 0, this.Gh = w[12] | 0, this.Gl = w[13] | 0, this.Hh = w[14] | 0, this.Hl = w[15] | 0;
|
|
1062
1100
|
}
|
|
1063
1101
|
}
|
|
1064
|
-
j.SHA512_224 =
|
|
1065
|
-
class
|
|
1102
|
+
j.SHA512_224 = C;
|
|
1103
|
+
class R extends A {
|
|
1066
1104
|
constructor() {
|
|
1067
|
-
super(32), this.Ah =
|
|
1105
|
+
super(32), this.Ah = I[0] | 0, this.Al = I[1] | 0, this.Bh = I[2] | 0, this.Bl = I[3] | 0, this.Ch = I[4] | 0, this.Cl = I[5] | 0, this.Dh = I[6] | 0, this.Dl = I[7] | 0, this.Eh = I[8] | 0, this.El = I[9] | 0, this.Fh = I[10] | 0, this.Fl = I[11] | 0, this.Gh = I[12] | 0, this.Gl = I[13] | 0, this.Hh = I[14] | 0, this.Hl = I[15] | 0;
|
|
1068
1106
|
}
|
|
1069
1107
|
}
|
|
1070
|
-
return j.SHA512_256 =
|
|
1108
|
+
return j.SHA512_256 = R, j.sha256 = (0, s.createHasher)(() => new r()), j.sha224 = (0, s.createHasher)(() => new n()), j.sha512 = (0, s.createHasher)(() => new A()), j.sha384 = (0, s.createHasher)(() => new m()), j.sha512_256 = (0, s.createHasher)(() => new R()), j.sha512_224 = (0, s.createHasher)(() => new C()), j;
|
|
1071
1109
|
}
|
|
1072
|
-
var
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1110
|
+
var mt = {}, jt;
|
|
1111
|
+
function Pe() {
|
|
1112
|
+
return jt || (jt = 1, (function(t) {
|
|
1075
1113
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
|
|
1076
|
-
const e = /* @__PURE__ */
|
|
1114
|
+
const e = /* @__PURE__ */ pt();
|
|
1077
1115
|
class s extends e.Hash {
|
|
1078
|
-
constructor(
|
|
1079
|
-
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(
|
|
1080
|
-
const h = (0, e.toBytes)(
|
|
1081
|
-
if (this.iHash =
|
|
1116
|
+
constructor(r, n) {
|
|
1117
|
+
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(r);
|
|
1118
|
+
const h = (0, e.toBytes)(n);
|
|
1119
|
+
if (this.iHash = r.create(), typeof this.iHash.update != "function")
|
|
1082
1120
|
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1083
1121
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1084
|
-
const
|
|
1085
|
-
x.set(h.length >
|
|
1086
|
-
for (let
|
|
1087
|
-
x[
|
|
1088
|
-
this.iHash.update(x), this.oHash =
|
|
1089
|
-
for (let
|
|
1090
|
-
x[
|
|
1122
|
+
const b = this.blockLen, x = new Uint8Array(b);
|
|
1123
|
+
x.set(h.length > b ? r.create().update(h).digest() : h);
|
|
1124
|
+
for (let H = 0; H < x.length; H++)
|
|
1125
|
+
x[H] ^= 54;
|
|
1126
|
+
this.iHash.update(x), this.oHash = r.create();
|
|
1127
|
+
for (let H = 0; H < x.length; H++)
|
|
1128
|
+
x[H] ^= 106;
|
|
1091
1129
|
this.oHash.update(x), (0, e.clean)(x);
|
|
1092
1130
|
}
|
|
1093
|
-
update(
|
|
1094
|
-
return (0, e.aexists)(this), this.iHash.update(
|
|
1131
|
+
update(r) {
|
|
1132
|
+
return (0, e.aexists)(this), this.iHash.update(r), this;
|
|
1095
1133
|
}
|
|
1096
|
-
digestInto(
|
|
1097
|
-
(0, e.aexists)(this), (0, e.abytes)(
|
|
1134
|
+
digestInto(r) {
|
|
1135
|
+
(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();
|
|
1098
1136
|
}
|
|
1099
1137
|
digest() {
|
|
1100
|
-
const
|
|
1101
|
-
return this.digestInto(
|
|
1138
|
+
const r = new Uint8Array(this.oHash.outputLen);
|
|
1139
|
+
return this.digestInto(r), r;
|
|
1102
1140
|
}
|
|
1103
|
-
_cloneInto(
|
|
1104
|
-
|
|
1105
|
-
const { oHash:
|
|
1106
|
-
return
|
|
1141
|
+
_cloneInto(r) {
|
|
1142
|
+
r || (r = Object.create(Object.getPrototypeOf(this), {}));
|
|
1143
|
+
const { oHash: n, iHash: h, finished: b, destroyed: x, blockLen: H, outputLen: u } = this;
|
|
1144
|
+
return r = r, r.finished = b, r.destroyed = x, r.blockLen = H, r.outputLen = u, r.oHash = n._cloneInto(r.oHash), r.iHash = h._cloneInto(r.iHash), r;
|
|
1107
1145
|
}
|
|
1108
1146
|
clone() {
|
|
1109
1147
|
return this._cloneInto();
|
|
@@ -1113,15 +1151,15 @@ function Oe() {
|
|
|
1113
1151
|
}
|
|
1114
1152
|
}
|
|
1115
1153
|
t.HMAC = s;
|
|
1116
|
-
const i = (o,
|
|
1117
|
-
t.hmac = i, t.hmac.create = (o,
|
|
1118
|
-
})(
|
|
1154
|
+
const i = (o, r, n) => new s(o, r).update(n).digest();
|
|
1155
|
+
t.hmac = i, t.hmac.create = (o, r) => new s(o, r);
|
|
1156
|
+
})(mt)), mt;
|
|
1119
1157
|
}
|
|
1120
|
-
var
|
|
1121
|
-
function
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
1124
|
-
const t = /* @__PURE__ */
|
|
1158
|
+
var ot = {}, N = {}, Pt;
|
|
1159
|
+
function We() {
|
|
1160
|
+
if (Pt) return N;
|
|
1161
|
+
Pt = 1, Object.defineProperty(N, "__esModule", { value: !0 }), N.ripemd160 = N.RIPEMD160 = N.md5 = N.MD5 = N.sha1 = N.SHA1 = void 0;
|
|
1162
|
+
const t = /* @__PURE__ */ oe(), e = /* @__PURE__ */ pt(), s = /* @__PURE__ */ Uint32Array.from([
|
|
1125
1163
|
1732584193,
|
|
1126
1164
|
4023233417,
|
|
1127
1165
|
2562383102,
|
|
@@ -1133,25 +1171,25 @@ function Me() {
|
|
|
1133
1171
|
super(64, 20, 8, !1), this.A = s[0] | 0, this.B = s[1] | 0, this.C = s[2] | 0, this.D = s[3] | 0, this.E = s[4] | 0;
|
|
1134
1172
|
}
|
|
1135
1173
|
get() {
|
|
1136
|
-
const { A: a, B:
|
|
1137
|
-
return [a,
|
|
1138
|
-
}
|
|
1139
|
-
set(a,
|
|
1140
|
-
this.A = a | 0, this.B =
|
|
1141
|
-
}
|
|
1142
|
-
process(a,
|
|
1143
|
-
for (let
|
|
1144
|
-
i[
|
|
1145
|
-
for (let
|
|
1146
|
-
i[
|
|
1147
|
-
let { A: f, B:
|
|
1148
|
-
for (let
|
|
1149
|
-
let
|
|
1150
|
-
|
|
1151
|
-
const c = (0, e.rotl)(f, 5) +
|
|
1152
|
-
|
|
1174
|
+
const { A: a, B: d, C: f, D: p, E: l } = this;
|
|
1175
|
+
return [a, d, f, p, l];
|
|
1176
|
+
}
|
|
1177
|
+
set(a, d, f, p, l) {
|
|
1178
|
+
this.A = a | 0, this.B = d | 0, this.C = f | 0, this.D = p | 0, this.E = l | 0;
|
|
1179
|
+
}
|
|
1180
|
+
process(a, d) {
|
|
1181
|
+
for (let k = 0; k < 16; k++, d += 4)
|
|
1182
|
+
i[k] = a.getUint32(d, !1);
|
|
1183
|
+
for (let k = 16; k < 80; k++)
|
|
1184
|
+
i[k] = (0, e.rotl)(i[k - 3] ^ i[k - 8] ^ i[k - 14] ^ i[k - 16], 1);
|
|
1185
|
+
let { A: f, B: p, C: l, D: S, E: U } = this;
|
|
1186
|
+
for (let k = 0; k < 80; k++) {
|
|
1187
|
+
let F, v;
|
|
1188
|
+
k < 20 ? (F = (0, t.Chi)(p, l, S), v = 1518500249) : k < 40 ? (F = p ^ l ^ S, v = 1859775393) : k < 60 ? (F = (0, t.Maj)(p, l, S), v = 2400959708) : (F = p ^ l ^ S, v = 3395469782);
|
|
1189
|
+
const c = (0, e.rotl)(f, 5) + F + U + v + i[k] | 0;
|
|
1190
|
+
U = S, S = l, l = (0, e.rotl)(p, 30), p = f, f = c;
|
|
1153
1191
|
}
|
|
1154
|
-
f = f + this.A | 0,
|
|
1192
|
+
f = f + this.A | 0, p = p + this.B | 0, l = l + this.C | 0, S = S + this.D | 0, U = U + this.E | 0, this.set(f, p, l, S, U);
|
|
1155
1193
|
}
|
|
1156
1194
|
roundClean() {
|
|
1157
1195
|
(0, e.clean)(i);
|
|
@@ -1160,38 +1198,38 @@ function Me() {
|
|
|
1160
1198
|
this.set(0, 0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1161
1199
|
}
|
|
1162
1200
|
}
|
|
1163
|
-
|
|
1164
|
-
const
|
|
1201
|
+
N.SHA1 = o, N.sha1 = (0, e.createHasher)(() => new o());
|
|
1202
|
+
const r = /* @__PURE__ */ Math.pow(2, 32), n = /* @__PURE__ */ Array.from({ length: 64 }, (B, a) => Math.floor(r * Math.abs(Math.sin(a + 1)))), h = /* @__PURE__ */ s.slice(0, 4), b = /* @__PURE__ */ new Uint32Array(16);
|
|
1165
1203
|
class x extends t.HashMD {
|
|
1166
1204
|
constructor() {
|
|
1167
1205
|
super(64, 16, 8, !0), this.A = h[0] | 0, this.B = h[1] | 0, this.C = h[2] | 0, this.D = h[3] | 0;
|
|
1168
1206
|
}
|
|
1169
1207
|
get() {
|
|
1170
|
-
const { A: a, B:
|
|
1171
|
-
return [a,
|
|
1172
|
-
}
|
|
1173
|
-
set(a,
|
|
1174
|
-
this.A = a | 0, this.B =
|
|
1175
|
-
}
|
|
1176
|
-
process(a,
|
|
1177
|
-
for (let
|
|
1178
|
-
|
|
1179
|
-
let { A: f, B:
|
|
1180
|
-
for (let
|
|
1181
|
-
let
|
|
1182
|
-
|
|
1208
|
+
const { A: a, B: d, C: f, D: p } = this;
|
|
1209
|
+
return [a, d, f, p];
|
|
1210
|
+
}
|
|
1211
|
+
set(a, d, f, p) {
|
|
1212
|
+
this.A = a | 0, this.B = d | 0, this.C = f | 0, this.D = p | 0;
|
|
1213
|
+
}
|
|
1214
|
+
process(a, d) {
|
|
1215
|
+
for (let U = 0; U < 16; U++, d += 4)
|
|
1216
|
+
b[U] = a.getUint32(d, !0);
|
|
1217
|
+
let { A: f, B: p, C: l, D: S } = this;
|
|
1218
|
+
for (let U = 0; U < 64; U++) {
|
|
1219
|
+
let k, F, v;
|
|
1220
|
+
U < 16 ? (k = (0, t.Chi)(p, l, S), F = U, v = [7, 12, 17, 22]) : U < 32 ? (k = (0, t.Chi)(S, p, l), F = (5 * U + 1) % 16, v = [5, 9, 14, 20]) : U < 48 ? (k = p ^ l ^ S, F = (3 * U + 5) % 16, v = [4, 11, 16, 23]) : (k = l ^ (p | ~S), F = 7 * U % 16, v = [6, 10, 15, 21]), k = k + f + n[U] + b[F], f = S, S = l, l = p, p = p + (0, e.rotl)(k, v[U % 4]);
|
|
1183
1221
|
}
|
|
1184
|
-
f = f + this.A | 0,
|
|
1222
|
+
f = f + this.A | 0, p = p + this.B | 0, l = l + this.C | 0, S = S + this.D | 0, this.set(f, p, l, S);
|
|
1185
1223
|
}
|
|
1186
1224
|
roundClean() {
|
|
1187
|
-
(0, e.clean)(
|
|
1225
|
+
(0, e.clean)(b);
|
|
1188
1226
|
}
|
|
1189
1227
|
destroy() {
|
|
1190
1228
|
this.set(0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1191
1229
|
}
|
|
1192
1230
|
}
|
|
1193
|
-
|
|
1194
|
-
const
|
|
1231
|
+
N.MD5 = x, N.md5 = (0, e.createHasher)(() => new x());
|
|
1232
|
+
const H = /* @__PURE__ */ Uint8Array.from([
|
|
1195
1233
|
7,
|
|
1196
1234
|
4,
|
|
1197
1235
|
13,
|
|
@@ -1208,212 +1246,212 @@ function Me() {
|
|
|
1208
1246
|
14,
|
|
1209
1247
|
11,
|
|
1210
1248
|
8
|
|
1211
|
-
]),
|
|
1212
|
-
const
|
|
1249
|
+
]), u = Uint8Array.from(new Array(16).fill(0).map((B, a) => a)), A = u.map((B) => (9 * B + 5) % 16), m = /* @__PURE__ */ (() => {
|
|
1250
|
+
const d = [[u], [A]];
|
|
1213
1251
|
for (let f = 0; f < 4; f++)
|
|
1214
|
-
for (let
|
|
1215
|
-
|
|
1216
|
-
return
|
|
1217
|
-
})(),
|
|
1252
|
+
for (let p of d)
|
|
1253
|
+
p.push(p[f].map((l) => H[l]));
|
|
1254
|
+
return d;
|
|
1255
|
+
})(), w = m[0], I = m[1], C = /* @__PURE__ */ [
|
|
1218
1256
|
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
1219
1257
|
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
1220
1258
|
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
1221
1259
|
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
1222
1260
|
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
1223
|
-
].map((B) => Uint8Array.from(B)),
|
|
1261
|
+
].map((B) => Uint8Array.from(B)), R = /* @__PURE__ */ w.map((B, a) => B.map((d) => C[a][d])), M = /* @__PURE__ */ I.map((B, a) => B.map((d) => C[a][d])), y = /* @__PURE__ */ Uint32Array.from([
|
|
1224
1262
|
0,
|
|
1225
1263
|
1518500249,
|
|
1226
1264
|
1859775393,
|
|
1227
1265
|
2400959708,
|
|
1228
1266
|
2840853838
|
|
1229
|
-
]),
|
|
1267
|
+
]), O = /* @__PURE__ */ Uint32Array.from([
|
|
1230
1268
|
1352829926,
|
|
1231
1269
|
1548603684,
|
|
1232
1270
|
1836072691,
|
|
1233
1271
|
2053994217,
|
|
1234
1272
|
0
|
|
1235
1273
|
]);
|
|
1236
|
-
function
|
|
1237
|
-
return B === 0 ? a ^
|
|
1274
|
+
function L(B, a, d, f) {
|
|
1275
|
+
return B === 0 ? a ^ d ^ f : B === 1 ? a & d | ~a & f : B === 2 ? (a | ~d) ^ f : B === 3 ? a & f | d & ~f : a ^ (d | ~f);
|
|
1238
1276
|
}
|
|
1239
|
-
const
|
|
1240
|
-
class
|
|
1277
|
+
const E = /* @__PURE__ */ new Uint32Array(16);
|
|
1278
|
+
class D extends t.HashMD {
|
|
1241
1279
|
constructor() {
|
|
1242
1280
|
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
1243
1281
|
}
|
|
1244
1282
|
get() {
|
|
1245
|
-
const { h0: a, h1:
|
|
1246
|
-
return [a,
|
|
1247
|
-
}
|
|
1248
|
-
set(a,
|
|
1249
|
-
this.h0 = a | 0, this.h1 =
|
|
1250
|
-
}
|
|
1251
|
-
process(a,
|
|
1252
|
-
for (let
|
|
1253
|
-
|
|
1254
|
-
let f = this.h0 | 0,
|
|
1255
|
-
for (let
|
|
1256
|
-
const
|
|
1257
|
-
for (let
|
|
1258
|
-
const
|
|
1259
|
-
f = c, c =
|
|
1283
|
+
const { h0: a, h1: d, h2: f, h3: p, h4: l } = this;
|
|
1284
|
+
return [a, d, f, p, l];
|
|
1285
|
+
}
|
|
1286
|
+
set(a, d, f, p, l) {
|
|
1287
|
+
this.h0 = a | 0, this.h1 = d | 0, this.h2 = f | 0, this.h3 = p | 0, this.h4 = l | 0;
|
|
1288
|
+
}
|
|
1289
|
+
process(a, d) {
|
|
1290
|
+
for (let _ = 0; _ < 16; _++, d += 4)
|
|
1291
|
+
E[_] = a.getUint32(d, !0);
|
|
1292
|
+
let f = this.h0 | 0, p = f, l = this.h1 | 0, S = l, U = this.h2 | 0, k = U, F = this.h3 | 0, v = F, c = this.h4 | 0, g = c;
|
|
1293
|
+
for (let _ = 0; _ < 5; _++) {
|
|
1294
|
+
const T = 4 - _, G = y[_], P = O[_], tt = w[_], X = I[_], J = R[_], at = M[_];
|
|
1295
|
+
for (let Q = 0; Q < 16; Q++) {
|
|
1296
|
+
const et = (0, e.rotl)(f + L(_, l, U, F) + E[tt[Q]] + G, J[Q]) + c | 0;
|
|
1297
|
+
f = c, c = F, F = (0, e.rotl)(U, 10) | 0, U = l, l = et;
|
|
1260
1298
|
}
|
|
1261
|
-
for (let
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1299
|
+
for (let Q = 0; Q < 16; Q++) {
|
|
1300
|
+
const et = (0, e.rotl)(p + L(T, S, k, v) + E[X[Q]] + P, at[Q]) + g | 0;
|
|
1301
|
+
p = g, g = v, v = (0, e.rotl)(k, 10) | 0, k = S, S = et;
|
|
1264
1302
|
}
|
|
1265
1303
|
}
|
|
1266
|
-
this.set(this.h1 +
|
|
1304
|
+
this.set(this.h1 + U + v | 0, this.h2 + F + g | 0, this.h3 + c + p | 0, this.h4 + f + S | 0, this.h0 + l + k | 0);
|
|
1267
1305
|
}
|
|
1268
1306
|
roundClean() {
|
|
1269
|
-
(0, e.clean)(
|
|
1307
|
+
(0, e.clean)(E);
|
|
1270
1308
|
}
|
|
1271
1309
|
destroy() {
|
|
1272
1310
|
this.destroyed = !0, (0, e.clean)(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
1273
1311
|
}
|
|
1274
1312
|
}
|
|
1275
|
-
return
|
|
1313
|
+
return N.RIPEMD160 = D, N.ripemd160 = (0, e.createHasher)(() => new D()), N;
|
|
1276
1314
|
}
|
|
1277
|
-
var
|
|
1278
|
-
function
|
|
1279
|
-
if (
|
|
1280
|
-
|
|
1281
|
-
const t = /* @__PURE__ */
|
|
1282
|
-
return
|
|
1315
|
+
var Wt;
|
|
1316
|
+
function As() {
|
|
1317
|
+
if (Wt) return ot;
|
|
1318
|
+
Wt = 1, Object.defineProperty(ot, "__esModule", { value: !0 }), ot.ripemd160 = ot.RIPEMD160 = void 0;
|
|
1319
|
+
const t = /* @__PURE__ */ We();
|
|
1320
|
+
return ot.RIPEMD160 = t.RIPEMD160, ot.ripemd160 = t.ripemd160, ot;
|
|
1283
1321
|
}
|
|
1284
|
-
var
|
|
1285
|
-
function
|
|
1286
|
-
if (
|
|
1287
|
-
|
|
1288
|
-
const t = /* @__PURE__ */
|
|
1289
|
-
return
|
|
1322
|
+
var Y = {}, qt;
|
|
1323
|
+
function ys() {
|
|
1324
|
+
if (qt) return Y;
|
|
1325
|
+
qt = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.sha224 = Y.SHA224 = Y.sha256 = Y.SHA256 = void 0;
|
|
1326
|
+
const t = /* @__PURE__ */ ce();
|
|
1327
|
+
return Y.SHA256 = t.SHA256, Y.sha256 = t.sha256, Y.SHA224 = t.SHA224, Y.sha224 = t.sha224, Y;
|
|
1290
1328
|
}
|
|
1291
|
-
var
|
|
1292
|
-
function
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1295
|
-
const t = /* @__PURE__ */
|
|
1296
|
-
return
|
|
1329
|
+
var W = {}, Kt;
|
|
1330
|
+
function gs() {
|
|
1331
|
+
if (Kt) return W;
|
|
1332
|
+
Kt = 1, Object.defineProperty(W, "__esModule", { value: !0 }), W.sha512_256 = W.SHA512_256 = W.sha512_224 = W.SHA512_224 = W.sha384 = W.SHA384 = W.sha512 = W.SHA512 = void 0;
|
|
1333
|
+
const t = /* @__PURE__ */ ce();
|
|
1334
|
+
return W.SHA512 = t.SHA512, W.sha512 = t.sha512, W.SHA384 = t.SHA384, W.sha384 = t.sha384, W.SHA512_224 = t.SHA512_224, W.sha512_224 = t.sha512_224, W.SHA512_256 = t.SHA512_256, W.sha512_256 = t.sha512_256, W;
|
|
1297
1335
|
}
|
|
1298
|
-
function
|
|
1336
|
+
function qe(t) {
|
|
1299
1337
|
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1300
1338
|
}
|
|
1301
|
-
function
|
|
1339
|
+
function Nt(t, e = "") {
|
|
1302
1340
|
if (!Number.isSafeInteger(t) || t < 0) {
|
|
1303
1341
|
const s = e && `"${e}" `;
|
|
1304
1342
|
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
1305
1343
|
}
|
|
1306
1344
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const i =
|
|
1309
|
-
if (!i ||
|
|
1310
|
-
const
|
|
1311
|
-
throw new Error(
|
|
1345
|
+
function It(t, e, s = "") {
|
|
1346
|
+
const i = qe(t), o = t?.length, r = e !== void 0;
|
|
1347
|
+
if (!i || r && o !== e) {
|
|
1348
|
+
const n = s && `"${s}" `, h = r ? ` of length ${e}` : "", b = i ? `length=${o}` : `type=${typeof t}`;
|
|
1349
|
+
throw new Error(n + "expected Uint8Array" + h + ", got " + b);
|
|
1312
1350
|
}
|
|
1313
1351
|
return t;
|
|
1314
1352
|
}
|
|
1315
|
-
function
|
|
1353
|
+
function Xt(t, e = !0) {
|
|
1316
1354
|
if (t.destroyed)
|
|
1317
1355
|
throw new Error("Hash instance has been destroyed");
|
|
1318
1356
|
if (e && t.finished)
|
|
1319
1357
|
throw new Error("Hash#digest() has already been called");
|
|
1320
1358
|
}
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1359
|
+
function Ke(t, e) {
|
|
1360
|
+
It(t, void 0, "digestInto() output");
|
|
1323
1361
|
const s = e.outputLen;
|
|
1324
1362
|
if (t.length < s)
|
|
1325
1363
|
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
1326
1364
|
}
|
|
1327
|
-
function
|
|
1365
|
+
function Ne(t) {
|
|
1328
1366
|
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
1329
1367
|
}
|
|
1330
|
-
function
|
|
1368
|
+
function he(...t) {
|
|
1331
1369
|
for (let e = 0; e < t.length; e++)
|
|
1332
1370
|
t[e].fill(0);
|
|
1333
1371
|
}
|
|
1334
|
-
const
|
|
1335
|
-
function
|
|
1372
|
+
const Xe = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1373
|
+
function Je(t) {
|
|
1336
1374
|
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
1337
1375
|
}
|
|
1338
|
-
function
|
|
1376
|
+
function Qe(t) {
|
|
1339
1377
|
for (let e = 0; e < t.length; e++)
|
|
1340
|
-
t[e] =
|
|
1378
|
+
t[e] = Je(t[e]);
|
|
1341
1379
|
return t;
|
|
1342
1380
|
}
|
|
1343
|
-
const
|
|
1344
|
-
function
|
|
1381
|
+
const Jt = Xe ? (t) => t : Qe;
|
|
1382
|
+
function _s(...t) {
|
|
1345
1383
|
let e = 0;
|
|
1346
1384
|
for (let i = 0; i < t.length; i++) {
|
|
1347
1385
|
const o = t[i];
|
|
1348
|
-
|
|
1386
|
+
It(o), e += o.length;
|
|
1349
1387
|
}
|
|
1350
1388
|
const s = new Uint8Array(e);
|
|
1351
1389
|
for (let i = 0, o = 0; i < t.length; i++) {
|
|
1352
|
-
const
|
|
1353
|
-
s.set(
|
|
1390
|
+
const r = t[i];
|
|
1391
|
+
s.set(r, o), o += r.length;
|
|
1354
1392
|
}
|
|
1355
1393
|
return s;
|
|
1356
1394
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const s = (o,
|
|
1395
|
+
function Ye(t, e = {}) {
|
|
1396
|
+
const s = (o, r) => t(r).update(o).digest(), i = t(void 0);
|
|
1359
1397
|
return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (o) => t(o), Object.assign(s, e), Object.freeze(s);
|
|
1360
1398
|
}
|
|
1361
|
-
function
|
|
1399
|
+
function ws(t = 32) {
|
|
1362
1400
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
1363
1401
|
if (typeof e?.getRandomValues != "function")
|
|
1364
1402
|
throw new Error("crypto.getRandomValues must be defined");
|
|
1365
1403
|
return e.getRandomValues(new Uint8Array(t));
|
|
1366
1404
|
}
|
|
1367
|
-
const
|
|
1405
|
+
const ae = (t) => ({
|
|
1368
1406
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
1369
|
-
}),
|
|
1370
|
-
function
|
|
1371
|
-
return e ? { h: Number(t &
|
|
1407
|
+
}), _t = /* @__PURE__ */ BigInt(2 ** 32 - 1), Qt = /* @__PURE__ */ BigInt(32);
|
|
1408
|
+
function Ze(t, e = !1) {
|
|
1409
|
+
return e ? { h: Number(t & _t), l: Number(t >> Qt & _t) } : { h: Number(t >> Qt & _t) | 0, l: Number(t & _t) | 0 };
|
|
1372
1410
|
}
|
|
1373
|
-
function
|
|
1411
|
+
function ze(t, e = !1) {
|
|
1374
1412
|
const s = t.length;
|
|
1375
1413
|
let i = new Uint32Array(s), o = new Uint32Array(s);
|
|
1376
|
-
for (let
|
|
1377
|
-
const { h:
|
|
1378
|
-
[i[
|
|
1414
|
+
for (let r = 0; r < s; r++) {
|
|
1415
|
+
const { h: n, l: h } = Ze(t[r], e);
|
|
1416
|
+
[i[r], o[r]] = [n, h];
|
|
1379
1417
|
}
|
|
1380
1418
|
return [i, o];
|
|
1381
1419
|
}
|
|
1382
|
-
const
|
|
1383
|
-
for (let t = 0, e =
|
|
1384
|
-
[s, i] = [i, (2 * s + 3 * i) % 5],
|
|
1385
|
-
let o =
|
|
1386
|
-
for (let
|
|
1387
|
-
e = (e <<
|
|
1388
|
-
|
|
1420
|
+
const $e = (t, e, s) => t << s | e >>> 32 - s, ts = (t, e, s) => e << s | t >>> 32 - s, es = (t, e, s) => e << s - 32 | t >>> 64 - s, ss = (t, e, s) => t << s - 32 | e >>> 64 - s, ns = BigInt(0), bt = BigInt(1), rs = BigInt(2), is = BigInt(7), os = BigInt(256), cs = BigInt(113), fe = [], de = [], ue = [];
|
|
1421
|
+
for (let t = 0, e = bt, s = 1, i = 0; t < 24; t++) {
|
|
1422
|
+
[s, i] = [i, (2 * s + 3 * i) % 5], fe.push(2 * (5 * i + s)), de.push((t + 1) * (t + 2) / 2 % 64);
|
|
1423
|
+
let o = ns;
|
|
1424
|
+
for (let r = 0; r < 7; r++)
|
|
1425
|
+
e = (e << bt ^ (e >> is) * cs) % os, e & rs && (o ^= bt << (bt << BigInt(r)) - bt);
|
|
1426
|
+
ue.push(o);
|
|
1389
1427
|
}
|
|
1390
|
-
const
|
|
1391
|
-
function
|
|
1428
|
+
const le = ze(ue, !0), hs = le[0], as = le[1], Yt = (t, e, s) => s > 32 ? es(t, e, s) : $e(t, e, s), Zt = (t, e, s) => s > 32 ? ss(t, e, s) : ts(t, e, s);
|
|
1429
|
+
function fs(t, e = 24) {
|
|
1392
1430
|
const s = new Uint32Array(10);
|
|
1393
1431
|
for (let i = 24 - e; i < 24; i++) {
|
|
1394
|
-
for (let
|
|
1395
|
-
s[
|
|
1396
|
-
for (let
|
|
1397
|
-
const h = (
|
|
1398
|
-
for (let
|
|
1399
|
-
t[
|
|
1400
|
-
}
|
|
1401
|
-
let o = t[2],
|
|
1402
|
-
for (let
|
|
1403
|
-
const h =
|
|
1404
|
-
o = t[
|
|
1405
|
-
}
|
|
1406
|
-
for (let
|
|
1432
|
+
for (let n = 0; n < 10; n++)
|
|
1433
|
+
s[n] = t[n] ^ t[n + 10] ^ t[n + 20] ^ t[n + 30] ^ t[n + 40];
|
|
1434
|
+
for (let n = 0; n < 10; n += 2) {
|
|
1435
|
+
const h = (n + 8) % 10, b = (n + 2) % 10, x = s[b], H = s[b + 1], u = Yt(x, H, 1) ^ s[h], A = Zt(x, H, 1) ^ s[h + 1];
|
|
1436
|
+
for (let m = 0; m < 50; m += 10)
|
|
1437
|
+
t[n + m] ^= u, t[n + m + 1] ^= A;
|
|
1438
|
+
}
|
|
1439
|
+
let o = t[2], r = t[3];
|
|
1440
|
+
for (let n = 0; n < 24; n++) {
|
|
1441
|
+
const h = de[n], b = Yt(o, r, h), x = Zt(o, r, h), H = fe[n];
|
|
1442
|
+
o = t[H], r = t[H + 1], t[H] = b, t[H + 1] = x;
|
|
1443
|
+
}
|
|
1444
|
+
for (let n = 0; n < 50; n += 10) {
|
|
1407
1445
|
for (let h = 0; h < 10; h++)
|
|
1408
|
-
s[h] = t[
|
|
1446
|
+
s[h] = t[n + h];
|
|
1409
1447
|
for (let h = 0; h < 10; h++)
|
|
1410
|
-
t[
|
|
1448
|
+
t[n + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
1411
1449
|
}
|
|
1412
|
-
t[0] ^=
|
|
1450
|
+
t[0] ^= hs[i], t[1] ^= as[i];
|
|
1413
1451
|
}
|
|
1414
|
-
|
|
1452
|
+
he(s);
|
|
1415
1453
|
}
|
|
1416
|
-
class
|
|
1454
|
+
class Et {
|
|
1417
1455
|
state;
|
|
1418
1456
|
pos = 0;
|
|
1419
1457
|
posOut = 0;
|
|
@@ -1426,24 +1464,24 @@ class Lt {
|
|
|
1426
1464
|
enableXOF = !1;
|
|
1427
1465
|
rounds;
|
|
1428
1466
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1429
|
-
constructor(e, s, i, o = !1,
|
|
1430
|
-
if (this.blockLen = e, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds =
|
|
1467
|
+
constructor(e, s, i, o = !1, r = 24) {
|
|
1468
|
+
if (this.blockLen = e, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, Nt(i, "outputLen"), !(0 < e && e < 200))
|
|
1431
1469
|
throw new Error("only keccak-f1600 function is supported");
|
|
1432
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
1470
|
+
this.state = new Uint8Array(200), this.state32 = Ne(this.state);
|
|
1433
1471
|
}
|
|
1434
1472
|
clone() {
|
|
1435
1473
|
return this._cloneInto();
|
|
1436
1474
|
}
|
|
1437
1475
|
keccak() {
|
|
1438
|
-
|
|
1476
|
+
Jt(this.state32), fs(this.state32, this.rounds), Jt(this.state32), this.posOut = 0, this.pos = 0;
|
|
1439
1477
|
}
|
|
1440
1478
|
update(e) {
|
|
1441
|
-
|
|
1479
|
+
Xt(this), It(e);
|
|
1442
1480
|
const { blockLen: s, state: i } = this, o = e.length;
|
|
1443
|
-
for (let
|
|
1444
|
-
const
|
|
1445
|
-
for (let h = 0; h <
|
|
1446
|
-
i[this.pos++] ^= e[
|
|
1481
|
+
for (let r = 0; r < o; ) {
|
|
1482
|
+
const n = Math.min(s - this.pos, o - r);
|
|
1483
|
+
for (let h = 0; h < n; h++)
|
|
1484
|
+
i[this.pos++] ^= e[r++];
|
|
1447
1485
|
this.pos === s && this.keccak();
|
|
1448
1486
|
}
|
|
1449
1487
|
return this;
|
|
@@ -1456,12 +1494,12 @@ class Lt {
|
|
|
1456
1494
|
e[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
|
|
1457
1495
|
}
|
|
1458
1496
|
writeInto(e) {
|
|
1459
|
-
|
|
1497
|
+
Xt(this, !1), It(e), this.finish();
|
|
1460
1498
|
const s = this.state, { blockLen: i } = this;
|
|
1461
|
-
for (let o = 0,
|
|
1499
|
+
for (let o = 0, r = e.length; o < r; ) {
|
|
1462
1500
|
this.posOut >= i && this.keccak();
|
|
1463
|
-
const
|
|
1464
|
-
e.set(s.subarray(this.posOut, this.posOut +
|
|
1501
|
+
const n = Math.min(i - this.posOut, r - o);
|
|
1502
|
+
e.set(s.subarray(this.posOut, this.posOut + n), o), this.posOut += n, o += n;
|
|
1465
1503
|
}
|
|
1466
1504
|
return e;
|
|
1467
1505
|
}
|
|
@@ -1471,10 +1509,10 @@ class Lt {
|
|
|
1471
1509
|
return this.writeInto(e);
|
|
1472
1510
|
}
|
|
1473
1511
|
xof(e) {
|
|
1474
|
-
return
|
|
1512
|
+
return Nt(e), this.xofInto(new Uint8Array(e));
|
|
1475
1513
|
}
|
|
1476
1514
|
digestInto(e) {
|
|
1477
|
-
if (
|
|
1515
|
+
if (Ke(e, this), this.finished)
|
|
1478
1516
|
throw new Error("digest() was already called");
|
|
1479
1517
|
return this.writeInto(e), this.destroy(), e;
|
|
1480
1518
|
}
|
|
@@ -1482,35 +1520,35 @@ class Lt {
|
|
|
1482
1520
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1483
1521
|
}
|
|
1484
1522
|
destroy() {
|
|
1485
|
-
this.destroyed = !0,
|
|
1523
|
+
this.destroyed = !0, he(this.state);
|
|
1486
1524
|
}
|
|
1487
1525
|
_cloneInto(e) {
|
|
1488
|
-
const { blockLen: s, suffix: i, outputLen: o, rounds:
|
|
1489
|
-
return e ||= new
|
|
1526
|
+
const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: n } = this;
|
|
1527
|
+
return e ||= new Et(s, i, o, n, 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 = o, e.enableXOF = n, e.destroyed = this.destroyed, e;
|
|
1490
1528
|
}
|
|
1491
1529
|
}
|
|
1492
|
-
const
|
|
1493
|
-
class
|
|
1530
|
+
const be = (t, e, s, i = {}) => Ye((o = {}) => new Et(e, t, o.dkLen === void 0 ? s : o.dkLen, !0), i), Ss = /* @__PURE__ */ be(31, 168, 16, /* @__PURE__ */ ae(11)), Is = /* @__PURE__ */ be(31, 136, 32, /* @__PURE__ */ ae(12));
|
|
1531
|
+
class xe extends se {
|
|
1494
1532
|
constructor(e, s) {
|
|
1495
|
-
super(), this.finished = !1, this.destroyed = !1,
|
|
1496
|
-
const i =
|
|
1533
|
+
super(), this.finished = !1, this.destroyed = !1, $t(e);
|
|
1534
|
+
const i = Ut(s);
|
|
1497
1535
|
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
1498
1536
|
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1499
1537
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1500
|
-
const o = this.blockLen,
|
|
1501
|
-
|
|
1502
|
-
for (let
|
|
1503
|
-
n
|
|
1504
|
-
this.iHash.update(
|
|
1505
|
-
for (let
|
|
1506
|
-
n
|
|
1507
|
-
this.oHash.update(
|
|
1538
|
+
const o = this.blockLen, r = new Uint8Array(o);
|
|
1539
|
+
r.set(i.length > o ? e.create().update(i).digest() : i);
|
|
1540
|
+
for (let n = 0; n < r.length; n++)
|
|
1541
|
+
r[n] ^= 54;
|
|
1542
|
+
this.iHash.update(r), this.oHash = e.create();
|
|
1543
|
+
for (let n = 0; n < r.length; n++)
|
|
1544
|
+
r[n] ^= 106;
|
|
1545
|
+
this.oHash.update(r), ct(r);
|
|
1508
1546
|
}
|
|
1509
1547
|
update(e) {
|
|
1510
|
-
return
|
|
1548
|
+
return St(this), this.iHash.update(e), this;
|
|
1511
1549
|
}
|
|
1512
1550
|
digestInto(e) {
|
|
1513
|
-
|
|
1551
|
+
St(this), ht(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
1514
1552
|
}
|
|
1515
1553
|
digest() {
|
|
1516
1554
|
const e = new Uint8Array(this.oHash.outputLen);
|
|
@@ -1518,8 +1556,8 @@ class ue extends Jt {
|
|
|
1518
1556
|
}
|
|
1519
1557
|
_cloneInto(e) {
|
|
1520
1558
|
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
1521
|
-
const { oHash: s, iHash: i, finished: o, destroyed:
|
|
1522
|
-
return e = e, e.finished = o, e.destroyed =
|
|
1559
|
+
const { oHash: s, iHash: i, finished: o, destroyed: r, blockLen: n, outputLen: h } = this;
|
|
1560
|
+
return e = e, e.finished = o, e.destroyed = r, e.blockLen = n, e.outputLen = h, e.oHash = s._cloneInto(e.oHash), e.iHash = i._cloneInto(e.iHash), e;
|
|
1523
1561
|
}
|
|
1524
1562
|
clone() {
|
|
1525
1563
|
return this._cloneInto();
|
|
@@ -1528,81 +1566,108 @@ class ue extends Jt {
|
|
|
1528
1566
|
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
1529
1567
|
}
|
|
1530
1568
|
}
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1569
|
+
const He = (t, e, s) => new xe(t, e).update(s).digest();
|
|
1570
|
+
He.create = (t, e) => new xe(t, e);
|
|
1571
|
+
function ds(t, e, s, i) {
|
|
1572
|
+
$t(t);
|
|
1573
|
+
const o = _e({ dkLen: 32, asyncTick: 10 }, i), { c: r, dkLen: n, asyncTick: h } = o;
|
|
1574
|
+
if (Ht(r), Ht(n), Ht(h), r < 1)
|
|
1575
|
+
throw new Error("iterations (c) should be >= 1");
|
|
1576
|
+
const b = Ct(e), x = Ct(s), H = new Uint8Array(n), u = He.create(t, b), A = u._cloneInto().update(x);
|
|
1577
|
+
return { c: r, dkLen: n, asyncTick: h, DK: H, PRF: u, PRFSalt: A };
|
|
1578
|
+
}
|
|
1579
|
+
function us(t, e, s, i, o) {
|
|
1580
|
+
return t.destroy(), e.destroy(), i && i.destroy(), ct(o), s;
|
|
1581
|
+
}
|
|
1582
|
+
function Ls(t, e, s, i) {
|
|
1583
|
+
const { c: o, dkLen: r, DK: n, PRF: h, PRFSalt: b } = ds(t, e, s, i);
|
|
1584
|
+
let x;
|
|
1585
|
+
const H = new Uint8Array(4), u = wt(H), A = new Uint8Array(h.outputLen);
|
|
1586
|
+
for (let m = 1, w = 0; w < r; m++, w += h.outputLen) {
|
|
1587
|
+
const I = n.subarray(w, w + h.outputLen);
|
|
1588
|
+
u.setInt32(0, m, !1), (x = b._cloneInto(x)).update(H).digestInto(A), I.set(A.subarray(0, I.length));
|
|
1589
|
+
for (let C = 1; C < o; C++) {
|
|
1590
|
+
h._cloneInto(x).update(A).digestInto(A);
|
|
1591
|
+
for (let R = 0; R < I.length; R++)
|
|
1592
|
+
I[R] ^= A[R];
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
return us(h, b, n, x, A);
|
|
1596
|
+
}
|
|
1597
|
+
const Bs = Re;
|
|
1598
|
+
var xt = {}, zt;
|
|
1599
|
+
function ms() {
|
|
1600
|
+
if (zt) return xt;
|
|
1601
|
+
zt = 1, Object.defineProperty(xt, "__esModule", { value: !0 }), xt.pbkdf2 = o, xt.pbkdf2Async = r;
|
|
1602
|
+
const t = /* @__PURE__ */ Pe(), e = /* @__PURE__ */ pt();
|
|
1603
|
+
function s(n, h, b, x) {
|
|
1604
|
+
(0, e.ahash)(n);
|
|
1605
|
+
const H = (0, e.checkOpts)({ dkLen: 32, asyncTick: 10 }, x), { c: u, dkLen: A, asyncTick: m } = H;
|
|
1606
|
+
if ((0, e.anumber)(u), (0, e.anumber)(A), (0, e.anumber)(m), u < 1)
|
|
1542
1607
|
throw new Error("iterations (c) should be >= 1");
|
|
1543
|
-
const
|
|
1544
|
-
return { c:
|
|
1545
|
-
}
|
|
1546
|
-
function i(
|
|
1547
|
-
return
|
|
1548
|
-
}
|
|
1549
|
-
function o(
|
|
1550
|
-
const { c:
|
|
1551
|
-
let
|
|
1552
|
-
const
|
|
1553
|
-
for (let
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
for (let
|
|
1557
|
-
|
|
1558
|
-
for (let
|
|
1559
|
-
|
|
1608
|
+
const w = (0, e.kdfInputToBytes)(h), I = (0, e.kdfInputToBytes)(b), C = new Uint8Array(A), R = t.hmac.create(n, w), M = R._cloneInto().update(I);
|
|
1609
|
+
return { c: u, dkLen: A, asyncTick: m, DK: C, PRF: R, PRFSalt: M };
|
|
1610
|
+
}
|
|
1611
|
+
function i(n, h, b, x, H) {
|
|
1612
|
+
return n.destroy(), h.destroy(), x && x.destroy(), (0, e.clean)(H), b;
|
|
1613
|
+
}
|
|
1614
|
+
function o(n, h, b, x) {
|
|
1615
|
+
const { c: H, dkLen: u, DK: A, PRF: m, PRFSalt: w } = s(n, h, b, x);
|
|
1616
|
+
let I;
|
|
1617
|
+
const C = new Uint8Array(4), R = (0, e.createView)(C), M = new Uint8Array(m.outputLen);
|
|
1618
|
+
for (let y = 1, O = 0; O < u; y++, O += m.outputLen) {
|
|
1619
|
+
const L = A.subarray(O, O + m.outputLen);
|
|
1620
|
+
R.setInt32(0, y, !1), (I = w._cloneInto(I)).update(C).digestInto(M), L.set(M.subarray(0, L.length));
|
|
1621
|
+
for (let E = 1; E < H; E++) {
|
|
1622
|
+
m._cloneInto(I).update(M).digestInto(M);
|
|
1623
|
+
for (let D = 0; D < L.length; D++)
|
|
1624
|
+
L[D] ^= M[D];
|
|
1560
1625
|
}
|
|
1561
1626
|
}
|
|
1562
|
-
return i(
|
|
1563
|
-
}
|
|
1564
|
-
async function n
|
|
1565
|
-
const { c:
|
|
1566
|
-
let
|
|
1567
|
-
const
|
|
1568
|
-
for (let
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
for (let
|
|
1573
|
-
|
|
1627
|
+
return i(m, w, A, I, M);
|
|
1628
|
+
}
|
|
1629
|
+
async function r(n, h, b, x) {
|
|
1630
|
+
const { c: H, dkLen: u, asyncTick: A, DK: m, PRF: w, PRFSalt: I } = s(n, h, b, x);
|
|
1631
|
+
let C;
|
|
1632
|
+
const R = new Uint8Array(4), M = (0, e.createView)(R), y = new Uint8Array(w.outputLen);
|
|
1633
|
+
for (let O = 1, L = 0; L < u; O++, L += w.outputLen) {
|
|
1634
|
+
const E = m.subarray(L, L + w.outputLen);
|
|
1635
|
+
M.setInt32(0, O, !1), (C = I._cloneInto(C)).update(R).digestInto(y), E.set(y.subarray(0, E.length)), await (0, e.asyncLoop)(H - 1, A, () => {
|
|
1636
|
+
w._cloneInto(C).update(y).digestInto(y);
|
|
1637
|
+
for (let D = 0; D < E.length; D++)
|
|
1638
|
+
E[D] ^= y[D];
|
|
1574
1639
|
});
|
|
1575
1640
|
}
|
|
1576
|
-
return i(
|
|
1641
|
+
return i(w, I, m, C, y);
|
|
1577
1642
|
}
|
|
1578
|
-
return
|
|
1643
|
+
return xt;
|
|
1579
1644
|
}
|
|
1580
1645
|
export {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1646
|
+
ee as A,
|
|
1647
|
+
Pe as a,
|
|
1648
|
+
ce as b,
|
|
1649
|
+
ls as c,
|
|
1650
|
+
ht as d,
|
|
1651
|
+
xs as e,
|
|
1652
|
+
Ht as f,
|
|
1653
|
+
$t as g,
|
|
1654
|
+
bs as h,
|
|
1655
|
+
Ae as i,
|
|
1656
|
+
Hs as j,
|
|
1657
|
+
He as k,
|
|
1593
1658
|
ps as l,
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1659
|
+
As as m,
|
|
1660
|
+
ys as n,
|
|
1661
|
+
gs as o,
|
|
1662
|
+
It as p,
|
|
1663
|
+
ws as q,
|
|
1664
|
+
pt as r,
|
|
1665
|
+
ve as s,
|
|
1666
|
+
_s as t,
|
|
1667
|
+
qe as u,
|
|
1668
|
+
Ss as v,
|
|
1669
|
+
Is as w,
|
|
1670
|
+
Bs as x,
|
|
1671
|
+
Ls as y,
|
|
1672
|
+
ms as z
|
|
1608
1673
|
};
|