@btc-vision/transaction 1.7.26 → 1.7.28
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 -1927
- package/browser/index.js +3 -3
- package/browser/noble-curves.js +1 -1
- package/browser/noble-hashes.js +705 -830
- package/browser/vendors.js +375 -375
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +36 -19
- package/src/_version.ts +1 -1
- package/cjs/package.json +0 -3
package/browser/noble-hashes.js
CHANGED
|
@@ -1,190 +1,187 @@
|
|
|
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
|
-
function
|
|
10
|
-
if (!
|
|
9
|
+
function ht(t, ...e) {
|
|
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
|
|
27
|
-
|
|
26
|
+
function ye(t, e) {
|
|
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 ce = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Ce = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
46
|
-
function Ds(t) {
|
|
47
|
-
if (ft(t), ce)
|
|
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
|
-
const
|
|
68
|
+
const i = new Uint8Array(s);
|
|
72
69
|
for (let o = 0, r = 0; o < s; o++, r += 2) {
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
throw new Error('hex string expected, got non-hex character "' +
|
|
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
|
-
|
|
75
|
+
i[o] = n * 16 + h;
|
|
79
76
|
}
|
|
80
|
-
return
|
|
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
|
|
91
|
-
return typeof t == "string" && (t =
|
|
87
|
+
function Ct(t) {
|
|
88
|
+
return typeof t == "string" && (t = ee(t)), ht(t), t;
|
|
92
89
|
}
|
|
93
|
-
function
|
|
90
|
+
function xs(...t) {
|
|
94
91
|
let e = 0;
|
|
95
|
-
for (let
|
|
96
|
-
const o = t[
|
|
97
|
-
|
|
92
|
+
for (let i = 0; i < t.length; i++) {
|
|
93
|
+
const o = t[i];
|
|
94
|
+
ht(o), e += o.length;
|
|
98
95
|
}
|
|
99
96
|
const s = new Uint8Array(e);
|
|
100
|
-
for (let
|
|
101
|
-
const r = t[
|
|
97
|
+
for (let i = 0, o = 0; i < t.length; i++) {
|
|
98
|
+
const r = t[i];
|
|
102
99
|
s.set(r, o), o += r.length;
|
|
103
100
|
}
|
|
104
101
|
return s;
|
|
105
102
|
}
|
|
106
|
-
function
|
|
103
|
+
function _e(t, e) {
|
|
107
104
|
if (e !== void 0 && {}.toString.call(e) !== "[object Object]")
|
|
108
105
|
throw new Error("options should be object or undefined");
|
|
109
106
|
return Object.assign(t, e);
|
|
110
107
|
}
|
|
111
|
-
class
|
|
108
|
+
class se {
|
|
112
109
|
}
|
|
113
|
-
function
|
|
114
|
-
const e = (
|
|
110
|
+
function ne(t) {
|
|
111
|
+
const e = (i) => t().update(Ut(i)).digest(), s = t();
|
|
115
112
|
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
116
113
|
}
|
|
117
|
-
function
|
|
118
|
-
if (
|
|
119
|
-
return
|
|
120
|
-
if (
|
|
121
|
-
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));
|
|
122
119
|
throw new Error("crypto.getRandomValues must be defined");
|
|
123
120
|
}
|
|
124
|
-
function
|
|
121
|
+
function we(t, e, s, i) {
|
|
125
122
|
if (typeof t.setBigUint64 == "function")
|
|
126
|
-
return t.setBigUint64(e, s,
|
|
127
|
-
const o = BigInt(32), r = BigInt(4294967295),
|
|
128
|
-
t.setUint32(e +
|
|
123
|
+
return t.setBigUint64(e, s, i);
|
|
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);
|
|
129
126
|
}
|
|
130
|
-
function
|
|
127
|
+
function Se(t, e, s) {
|
|
131
128
|
return t & e ^ ~t & s;
|
|
132
129
|
}
|
|
133
|
-
function
|
|
130
|
+
function Ie(t, e, s) {
|
|
134
131
|
return t & e ^ t & s ^ e & s;
|
|
135
132
|
}
|
|
136
|
-
class
|
|
137
|
-
constructor(e, s,
|
|
138
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset =
|
|
133
|
+
class re extends se {
|
|
134
|
+
constructor(e, s, i, o) {
|
|
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);
|
|
139
136
|
}
|
|
140
137
|
update(e) {
|
|
141
|
-
|
|
142
|
-
const { view: s, buffer:
|
|
143
|
-
for (let
|
|
144
|
-
const h = Math.min(o - this.pos, r -
|
|
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);
|
|
145
142
|
if (h === o) {
|
|
146
|
-
const
|
|
147
|
-
for (; o <= r -
|
|
148
|
-
this.process(
|
|
143
|
+
const b = wt(e);
|
|
144
|
+
for (; o <= r - n; n += o)
|
|
145
|
+
this.process(b, n);
|
|
149
146
|
continue;
|
|
150
147
|
}
|
|
151
|
-
|
|
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);
|
|
152
149
|
}
|
|
153
150
|
return this.length += e.length, this.roundClean(), this;
|
|
154
151
|
}
|
|
155
152
|
digestInto(e) {
|
|
156
|
-
|
|
157
|
-
const { buffer: s, view:
|
|
158
|
-
let { pos:
|
|
159
|
-
s[
|
|
160
|
-
for (let
|
|
161
|
-
s[
|
|
162
|
-
|
|
163
|
-
const h =
|
|
164
|
-
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)
|
|
165
162
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
163
|
+
const x = b / 4, H = this.get();
|
|
164
|
+
if (x > H.length)
|
|
168
165
|
throw new Error("_sha2: outputLen bigger than state");
|
|
169
|
-
for (let
|
|
170
|
-
h.setUint32(4 *
|
|
166
|
+
for (let u = 0; u < x; u++)
|
|
167
|
+
h.setUint32(4 * u, H[u], r);
|
|
171
168
|
}
|
|
172
169
|
digest() {
|
|
173
170
|
const { buffer: e, outputLen: s } = this;
|
|
174
171
|
this.digestInto(e);
|
|
175
|
-
const
|
|
176
|
-
return this.destroy(),
|
|
172
|
+
const i = e.slice(0, s);
|
|
173
|
+
return this.destroy(), i;
|
|
177
174
|
}
|
|
178
175
|
_cloneInto(e) {
|
|
179
176
|
e || (e = new this.constructor()), e.set(...this.get());
|
|
180
|
-
const { blockLen: s, buffer:
|
|
181
|
-
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;
|
|
182
179
|
}
|
|
183
180
|
clone() {
|
|
184
181
|
return this._cloneInto();
|
|
185
182
|
}
|
|
186
183
|
}
|
|
187
|
-
const
|
|
184
|
+
const st = /* @__PURE__ */ Uint32Array.from([
|
|
188
185
|
1779033703,
|
|
189
186
|
3144134277,
|
|
190
187
|
1013904242,
|
|
@@ -210,25 +207,25 @@ const nt = /* @__PURE__ */ Uint32Array.from([
|
|
|
210
207
|
4215389547,
|
|
211
208
|
1541459225,
|
|
212
209
|
327033209
|
|
213
|
-
]),
|
|
214
|
-
function
|
|
215
|
-
return e ? { h: Number(t &
|
|
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 };
|
|
216
213
|
}
|
|
217
|
-
function
|
|
214
|
+
function Be(t, e = !1) {
|
|
218
215
|
const s = t.length;
|
|
219
|
-
let
|
|
216
|
+
let i = new Uint32Array(s), o = new Uint32Array(s);
|
|
220
217
|
for (let r = 0; r < s; r++) {
|
|
221
|
-
const { h:
|
|
222
|
-
[
|
|
218
|
+
const { h: n, l: h } = Le(t[r], e);
|
|
219
|
+
[i[r], o[r]] = [n, h];
|
|
223
220
|
}
|
|
224
|
-
return [
|
|
221
|
+
return [i, o];
|
|
225
222
|
}
|
|
226
|
-
const
|
|
227
|
-
function
|
|
228
|
-
const o = (e >>> 0) + (
|
|
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);
|
|
229
226
|
return { h: t + s + (o / 2 ** 32 | 0) | 0, l: o | 0 };
|
|
230
227
|
}
|
|
231
|
-
const
|
|
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([
|
|
232
229
|
1116352408,
|
|
233
230
|
1899447441,
|
|
234
231
|
3049323471,
|
|
@@ -293,41 +290,41 @@ const Me = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), ve = (t, e, s, n) =>
|
|
|
293
290
|
2756734187,
|
|
294
291
|
3204031479,
|
|
295
292
|
3329325298
|
|
296
|
-
]),
|
|
297
|
-
class
|
|
293
|
+
]), nt = /* @__PURE__ */ new Uint32Array(64);
|
|
294
|
+
class Oe extends re {
|
|
298
295
|
constructor(e = 32) {
|
|
299
|
-
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;
|
|
300
297
|
}
|
|
301
298
|
get() {
|
|
302
|
-
const { A: e, B: s, C:
|
|
303
|
-
return [e, s,
|
|
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];
|
|
304
301
|
}
|
|
305
302
|
// prettier-ignore
|
|
306
|
-
set(e, s,
|
|
307
|
-
this.A = e | 0, this.B = s | 0, this.C =
|
|
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;
|
|
308
305
|
}
|
|
309
306
|
process(e, s) {
|
|
310
|
-
for (let
|
|
311
|
-
|
|
312
|
-
for (let
|
|
313
|
-
const A =
|
|
314
|
-
|
|
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;
|
|
315
312
|
}
|
|
316
|
-
let { A:
|
|
317
|
-
for (let
|
|
318
|
-
const A =
|
|
319
|
-
|
|
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;
|
|
320
317
|
}
|
|
321
|
-
|
|
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);
|
|
322
319
|
}
|
|
323
320
|
roundClean() {
|
|
324
|
-
|
|
321
|
+
ct(nt);
|
|
325
322
|
}
|
|
326
323
|
destroy() {
|
|
327
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
324
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), ct(this.buffer);
|
|
328
325
|
}
|
|
329
326
|
}
|
|
330
|
-
const
|
|
327
|
+
const ie = Be([
|
|
331
328
|
"0x428a2f98d728ae22",
|
|
332
329
|
"0x7137449123ef65cd",
|
|
333
330
|
"0xb5c0fbcfec4d3b2f",
|
|
@@ -408,279 +405,159 @@ const ue = Te([
|
|
|
408
405
|
"0x597f299cfc657e2a",
|
|
409
406
|
"0x5fcb6fab3ad6faec",
|
|
410
407
|
"0x6c44198c4a475817"
|
|
411
|
-
].map((t) => BigInt(t))),
|
|
412
|
-
class
|
|
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 {
|
|
413
410
|
constructor(e = 64) {
|
|
414
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;
|
|
415
412
|
}
|
|
416
413
|
// prettier-ignore
|
|
417
414
|
get() {
|
|
418
|
-
const { Ah: e, Al: s, Bh:
|
|
419
|
-
return [e, s,
|
|
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];
|
|
420
417
|
}
|
|
421
418
|
// prettier-ignore
|
|
422
|
-
set(e, s,
|
|
423
|
-
this.Ah = e | 0, this.Al = s | 0, this.Bh =
|
|
424
|
-
}
|
|
425
|
-
process(e, s) {
|
|
426
|
-
for (let g = 0; g < 16; g++, s += 4)
|
|
427
|
-
it[g] = e.getUint32(s), ot[g] = e.getUint32(s += 4);
|
|
428
|
-
for (let g = 16; g < 80; g++) {
|
|
429
|
-
const F = it[g - 15] | 0, _ = ot[g - 15] | 0, U = lt(F, _, 1) ^ lt(F, _, 8) ^ Gt(F, _, 7), D = bt(F, _, 1) ^ bt(F, _, 8) ^ jt(F, _, 7), B = it[g - 2] | 0, a = ot[g - 2] | 0, u = lt(B, a, 19) ^ wt(B, a, 61) ^ Gt(B, a, 6), f = bt(B, a, 19) ^ St(B, a, 61) ^ jt(B, a, 6), H = Re(D, f, ot[g - 7], ot[g - 16]), p = Ge(H, U, u, it[g - 7], it[g - 16]);
|
|
430
|
-
it[g] = p | 0, ot[g] = H | 0;
|
|
431
|
-
}
|
|
432
|
-
let { Ah: n, Al: o, Bh: r, Bl: i, Ch: h, Cl: d, Dh: b, Dl: x, Eh: l, El: A, Fh: y, Fl: I, Gh: L, Gl: V, Hh: v, Hl: M } = this;
|
|
433
|
-
for (let g = 0; g < 80; g++) {
|
|
434
|
-
const F = lt(l, A, 14) ^ lt(l, A, 18) ^ wt(l, A, 41), _ = bt(l, A, 14) ^ bt(l, A, 18) ^ St(l, A, 41), U = l & y ^ ~l & L, D = A & I ^ ~A & V, B = je(M, _, D, Ne[g], ot[g]), a = Pe(B, v, F, U, Ke[g], it[g]), u = B | 0, f = lt(n, o, 28) ^ wt(n, o, 34) ^ wt(n, o, 39), H = bt(n, o, 28) ^ St(n, o, 34) ^ St(n, o, 39), p = n & r ^ n & h ^ r & h, m = o & i ^ o & d ^ i & d;
|
|
435
|
-
v = L | 0, M = V | 0, L = y | 0, V = I | 0, y = l | 0, I = A | 0, { h: l, l: A } = tt(b | 0, x | 0, a | 0, u | 0), b = h | 0, x = d | 0, h = r | 0, d = i | 0, r = n | 0, i = o | 0;
|
|
436
|
-
const E = Me(u, H, m);
|
|
437
|
-
n = ve(E, a, f, p), o = E | 0;
|
|
438
|
-
}
|
|
439
|
-
({ h: n, l: o } = tt(this.Ah | 0, this.Al | 0, n | 0, o | 0)), { h: r, l: i } = tt(this.Bh | 0, this.Bl | 0, r | 0, i | 0), { h, l: d } = tt(this.Ch | 0, this.Cl | 0, h | 0, d | 0), { h: b, l: x } = tt(this.Dh | 0, this.Dl | 0, b | 0, x | 0), { h: l, l: A } = tt(this.Eh | 0, this.El | 0, l | 0, A | 0), { h: y, l: I } = tt(this.Fh | 0, this.Fl | 0, y | 0, I | 0), { h: L, l: V } = tt(this.Gh | 0, this.Gl | 0, L | 0, V | 0), { h: v, l: M } = tt(this.Hh | 0, this.Hl | 0, v | 0, M | 0), this.set(n, o, r, i, h, d, b, x, l, A, y, I, L, V, v, M);
|
|
440
|
-
}
|
|
441
|
-
roundClean() {
|
|
442
|
-
Z(it, ot);
|
|
443
|
-
}
|
|
444
|
-
destroy() {
|
|
445
|
-
Z(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
const Je = /* @__PURE__ */ Et(() => new qe()), Qe = /* @__PURE__ */ Et(() => new Xe()), Ms = Je, xt = /* @__PURE__ */ Uint32Array.from([
|
|
449
|
-
1732584193,
|
|
450
|
-
4023233417,
|
|
451
|
-
2562383102,
|
|
452
|
-
271733878,
|
|
453
|
-
3285377520
|
|
454
|
-
]), ct = /* @__PURE__ */ new Uint32Array(80);
|
|
455
|
-
class Ye extends kt {
|
|
456
|
-
constructor() {
|
|
457
|
-
super(64, 20, 8, !1), this.A = xt[0] | 0, this.B = xt[1] | 0, this.C = xt[2] | 0, this.D = xt[3] | 0, this.E = xt[4] | 0;
|
|
458
|
-
}
|
|
459
|
-
get() {
|
|
460
|
-
const { A: e, B: s, C: n, D: o, E: r } = this;
|
|
461
|
-
return [e, s, n, o, r];
|
|
462
|
-
}
|
|
463
|
-
set(e, s, n, o, r) {
|
|
464
|
-
this.A = e | 0, this.B = s | 0, this.C = n | 0, this.D = o | 0, this.E = r | 0;
|
|
465
|
-
}
|
|
466
|
-
process(e, s) {
|
|
467
|
-
for (let d = 0; d < 16; d++, s += 4)
|
|
468
|
-
ct[d] = e.getUint32(s, !1);
|
|
469
|
-
for (let d = 16; d < 80; d++)
|
|
470
|
-
ct[d] = at(ct[d - 3] ^ ct[d - 8] ^ ct[d - 14] ^ ct[d - 16], 1);
|
|
471
|
-
let { A: n, B: o, C: r, D: i, E: h } = this;
|
|
472
|
-
for (let d = 0; d < 80; d++) {
|
|
473
|
-
let b, x;
|
|
474
|
-
d < 20 ? (b = fe(o, r, i), x = 1518500249) : d < 40 ? (b = o ^ r ^ i, x = 1859775393) : d < 60 ? (b = de(o, r, i), x = 2400959708) : (b = o ^ r ^ i, x = 3395469782);
|
|
475
|
-
const l = at(n, 5) + b + h + x + ct[d] | 0;
|
|
476
|
-
h = i, i = r, r = at(o, 30), o = n, n = l;
|
|
477
|
-
}
|
|
478
|
-
n = n + this.A | 0, o = o + this.B | 0, r = r + this.C | 0, i = i + this.D | 0, h = h + this.E | 0, this.set(n, o, r, i, h);
|
|
479
|
-
}
|
|
480
|
-
roundClean() {
|
|
481
|
-
Z(ct);
|
|
482
|
-
}
|
|
483
|
-
destroy() {
|
|
484
|
-
this.set(0, 0, 0, 0, 0), Z(this.buffer);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
const Ze = /* @__PURE__ */ Et(() => new Ye()), ze = /* @__PURE__ */ Uint8Array.from([
|
|
488
|
-
7,
|
|
489
|
-
4,
|
|
490
|
-
13,
|
|
491
|
-
1,
|
|
492
|
-
10,
|
|
493
|
-
6,
|
|
494
|
-
15,
|
|
495
|
-
3,
|
|
496
|
-
12,
|
|
497
|
-
0,
|
|
498
|
-
9,
|
|
499
|
-
5,
|
|
500
|
-
2,
|
|
501
|
-
14,
|
|
502
|
-
11,
|
|
503
|
-
8
|
|
504
|
-
]), le = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), $e = le.map((t) => (9 * t + 5) % 16), be = /* @__PURE__ */ (() => {
|
|
505
|
-
const s = [[le], [$e]];
|
|
506
|
-
for (let n = 0; n < 4; n++)
|
|
507
|
-
for (let o of s)
|
|
508
|
-
o.push(o[n].map((r) => ze[r]));
|
|
509
|
-
return s;
|
|
510
|
-
})(), xe = be[0], pe = be[1], He = /* @__PURE__ */ [
|
|
511
|
-
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
512
|
-
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
513
|
-
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
514
|
-
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
515
|
-
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
516
|
-
].map((t) => Uint8Array.from(t)), ts = /* @__PURE__ */ xe.map((t, e) => t.map((s) => He[e][s])), es = /* @__PURE__ */ pe.map((t, e) => t.map((s) => He[e][s])), ss = /* @__PURE__ */ Uint32Array.from([
|
|
517
|
-
0,
|
|
518
|
-
1518500249,
|
|
519
|
-
1859775393,
|
|
520
|
-
2400959708,
|
|
521
|
-
2840853838
|
|
522
|
-
]), ns = /* @__PURE__ */ Uint32Array.from([
|
|
523
|
-
1352829926,
|
|
524
|
-
1548603684,
|
|
525
|
-
1836072691,
|
|
526
|
-
2053994217,
|
|
527
|
-
0
|
|
528
|
-
]);
|
|
529
|
-
function Pt(t, e, s, n) {
|
|
530
|
-
return t === 0 ? e ^ s ^ n : t === 1 ? e & s | ~e & n : t === 2 ? (e | ~s) ^ n : t === 3 ? e & n | s & ~n : e ^ (s | ~n);
|
|
531
|
-
}
|
|
532
|
-
const It = /* @__PURE__ */ new Uint32Array(16);
|
|
533
|
-
class rs extends kt {
|
|
534
|
-
constructor() {
|
|
535
|
-
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
536
|
-
}
|
|
537
|
-
get() {
|
|
538
|
-
const { h0: e, h1: s, h2: n, h3: o, h4: r } = this;
|
|
539
|
-
return [e, s, n, o, r];
|
|
540
|
-
}
|
|
541
|
-
set(e, s, n, o, r) {
|
|
542
|
-
this.h0 = e | 0, this.h1 = s | 0, this.h2 = n | 0, this.h3 = o | 0, this.h4 = r | 0;
|
|
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;
|
|
543
421
|
}
|
|
544
422
|
process(e, s) {
|
|
545
423
|
for (let y = 0; y < 16; y++, s += 4)
|
|
546
|
-
|
|
547
|
-
let
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
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;
|
|
558
435
|
}
|
|
559
|
-
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);
|
|
560
437
|
}
|
|
561
438
|
roundClean() {
|
|
562
|
-
|
|
439
|
+
ct(rt, it);
|
|
563
440
|
}
|
|
564
441
|
destroy() {
|
|
565
|
-
|
|
442
|
+
ct(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
566
443
|
}
|
|
567
444
|
}
|
|
568
|
-
const
|
|
569
|
-
var j = {}, K = {},
|
|
570
|
-
function
|
|
571
|
-
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;
|
|
572
449
|
}
|
|
573
|
-
var
|
|
574
|
-
function
|
|
575
|
-
return
|
|
576
|
-
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 =
|
|
577
|
-
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();
|
|
578
455
|
function s(c) {
|
|
579
456
|
return c instanceof Uint8Array || ArrayBuffer.isView(c) && c.constructor.name === "Uint8Array";
|
|
580
457
|
}
|
|
581
|
-
function
|
|
458
|
+
function i(c) {
|
|
582
459
|
if (!Number.isSafeInteger(c) || c < 0)
|
|
583
460
|
throw new Error("positive integer expected, got " + c);
|
|
584
461
|
}
|
|
585
|
-
function o(c, ...
|
|
462
|
+
function o(c, ...g) {
|
|
586
463
|
if (!s(c))
|
|
587
464
|
throw new Error("Uint8Array expected");
|
|
588
|
-
if (
|
|
589
|
-
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);
|
|
590
467
|
}
|
|
591
468
|
function r(c) {
|
|
592
469
|
if (typeof c != "function" || typeof c.create != "function")
|
|
593
470
|
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
594
|
-
|
|
471
|
+
i(c.outputLen), i(c.blockLen);
|
|
595
472
|
}
|
|
596
|
-
function
|
|
473
|
+
function n(c, g = !0) {
|
|
597
474
|
if (c.destroyed)
|
|
598
475
|
throw new Error("Hash instance has been destroyed");
|
|
599
|
-
if (
|
|
476
|
+
if (g && c.finished)
|
|
600
477
|
throw new Error("Hash#digest() has already been called");
|
|
601
478
|
}
|
|
602
|
-
function h(c,
|
|
479
|
+
function h(c, g) {
|
|
603
480
|
o(c);
|
|
604
|
-
const
|
|
605
|
-
if (c.length <
|
|
606
|
-
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 " + _);
|
|
607
484
|
}
|
|
608
|
-
function
|
|
485
|
+
function b(c) {
|
|
609
486
|
return new Uint8Array(c.buffer, c.byteOffset, c.byteLength);
|
|
610
487
|
}
|
|
611
|
-
function
|
|
488
|
+
function x(c) {
|
|
612
489
|
return new Uint32Array(c.buffer, c.byteOffset, Math.floor(c.byteLength / 4));
|
|
613
490
|
}
|
|
614
|
-
function
|
|
615
|
-
for (let
|
|
616
|
-
c[
|
|
491
|
+
function H(...c) {
|
|
492
|
+
for (let g = 0; g < c.length; g++)
|
|
493
|
+
c[g].fill(0);
|
|
617
494
|
}
|
|
618
|
-
function
|
|
495
|
+
function u(c) {
|
|
619
496
|
return new DataView(c.buffer, c.byteOffset, c.byteLength);
|
|
620
497
|
}
|
|
621
|
-
function A(c,
|
|
622
|
-
return c << 32 -
|
|
498
|
+
function A(c, g) {
|
|
499
|
+
return c << 32 - g | c >>> g;
|
|
623
500
|
}
|
|
624
|
-
function
|
|
625
|
-
return c <<
|
|
501
|
+
function m(c, g) {
|
|
502
|
+
return c << g | c >>> 32 - g >>> 0;
|
|
626
503
|
}
|
|
627
504
|
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
628
|
-
function
|
|
505
|
+
function w(c) {
|
|
629
506
|
return c << 24 & 4278190080 | c << 8 & 16711680 | c >>> 8 & 65280 | c >>> 24 & 255;
|
|
630
507
|
}
|
|
631
|
-
t.swap8IfBE = t.isLE ? (c) => c : (c) =>
|
|
632
|
-
function
|
|
633
|
-
for (let
|
|
634
|
-
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]);
|
|
635
512
|
return c;
|
|
636
513
|
}
|
|
637
|
-
t.swap32IfBE = t.isLE ? (c) => c :
|
|
638
|
-
const
|
|
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"));
|
|
639
516
|
function M(c) {
|
|
640
|
-
if (o(c),
|
|
517
|
+
if (o(c), C)
|
|
641
518
|
return c.toHex();
|
|
642
|
-
let
|
|
643
|
-
for (let
|
|
644
|
-
|
|
645
|
-
return
|
|
519
|
+
let g = "";
|
|
520
|
+
for (let _ = 0; _ < c.length; _++)
|
|
521
|
+
g += R[c[_]];
|
|
522
|
+
return g;
|
|
646
523
|
}
|
|
647
|
-
const
|
|
648
|
-
function
|
|
649
|
-
if (c >=
|
|
650
|
-
return c -
|
|
651
|
-
if (c >=
|
|
652
|
-
return c - (
|
|
653
|
-
if (c >=
|
|
654
|
-
return c - (
|
|
655
|
-
}
|
|
656
|
-
function
|
|
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) {
|
|
657
534
|
if (typeof c != "string")
|
|
658
535
|
throw new Error("hex string expected, got " + typeof c);
|
|
659
|
-
if (
|
|
536
|
+
if (C)
|
|
660
537
|
return Uint8Array.fromHex(c);
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
663
|
-
throw new Error("hex string expected, got unpadded hex of length " +
|
|
664
|
-
const T = new Uint8Array(
|
|
665
|
-
for (let G = 0, P = 0; G <
|
|
666
|
-
const
|
|
667
|
-
if (
|
|
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) {
|
|
668
545
|
const J = c[P] + c[P + 1];
|
|
669
546
|
throw new Error('hex string expected, got non-hex character "' + J + '" at index ' + P);
|
|
670
547
|
}
|
|
671
|
-
T[G] =
|
|
548
|
+
T[G] = tt * 16 + X;
|
|
672
549
|
}
|
|
673
550
|
return T;
|
|
674
551
|
}
|
|
675
|
-
const
|
|
552
|
+
const E = async () => {
|
|
676
553
|
};
|
|
677
|
-
t.nextTick =
|
|
678
|
-
async function D(c,
|
|
554
|
+
t.nextTick = E;
|
|
555
|
+
async function D(c, g, _) {
|
|
679
556
|
let T = Date.now();
|
|
680
557
|
for (let G = 0; G < c; G++) {
|
|
681
|
-
|
|
558
|
+
_(G);
|
|
682
559
|
const P = Date.now() - T;
|
|
683
|
-
P >= 0 && P <
|
|
560
|
+
P >= 0 && P < g || (await (0, t.nextTick)(), T += P);
|
|
684
561
|
}
|
|
685
562
|
}
|
|
686
563
|
function B(c) {
|
|
@@ -691,118 +568,118 @@ function gt() {
|
|
|
691
568
|
function a(c) {
|
|
692
569
|
return new TextDecoder().decode(c);
|
|
693
570
|
}
|
|
694
|
-
function
|
|
571
|
+
function d(c) {
|
|
695
572
|
return typeof c == "string" && (c = B(c)), o(c), c;
|
|
696
573
|
}
|
|
697
574
|
function f(c) {
|
|
698
575
|
return typeof c == "string" && (c = B(c)), o(c), c;
|
|
699
576
|
}
|
|
700
|
-
function
|
|
701
|
-
let
|
|
577
|
+
function p(...c) {
|
|
578
|
+
let g = 0;
|
|
702
579
|
for (let T = 0; T < c.length; T++) {
|
|
703
580
|
const G = c[T];
|
|
704
|
-
o(G),
|
|
581
|
+
o(G), g += G.length;
|
|
705
582
|
}
|
|
706
|
-
const
|
|
583
|
+
const _ = new Uint8Array(g);
|
|
707
584
|
for (let T = 0, G = 0; T < c.length; T++) {
|
|
708
585
|
const P = c[T];
|
|
709
|
-
|
|
586
|
+
_.set(P, G), G += P.length;
|
|
710
587
|
}
|
|
711
|
-
return
|
|
588
|
+
return _;
|
|
712
589
|
}
|
|
713
|
-
function
|
|
714
|
-
if (
|
|
590
|
+
function l(c, g) {
|
|
591
|
+
if (g !== void 0 && {}.toString.call(g) !== "[object Object]")
|
|
715
592
|
throw new Error("options should be object or undefined");
|
|
716
|
-
return Object.assign(c,
|
|
593
|
+
return Object.assign(c, g);
|
|
717
594
|
}
|
|
718
|
-
class
|
|
595
|
+
class S {
|
|
719
596
|
}
|
|
720
|
-
t.Hash =
|
|
721
|
-
function
|
|
722
|
-
const
|
|
723
|
-
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;
|
|
724
601
|
}
|
|
725
602
|
function k(c) {
|
|
726
|
-
const
|
|
727
|
-
return
|
|
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;
|
|
728
605
|
}
|
|
729
|
-
function
|
|
730
|
-
const
|
|
731
|
-
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;
|
|
732
609
|
}
|
|
733
|
-
t.wrapConstructor =
|
|
734
|
-
function
|
|
610
|
+
t.wrapConstructor = U, t.wrapConstructorWithOpts = k, t.wrapXOFConstructorWithOpts = F;
|
|
611
|
+
function v(c = 32) {
|
|
735
612
|
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
736
613
|
return e.crypto.getRandomValues(new Uint8Array(c));
|
|
737
614
|
if (e.crypto && typeof e.crypto.randomBytes == "function")
|
|
738
615
|
return Uint8Array.from(e.crypto.randomBytes(c));
|
|
739
616
|
throw new Error("crypto.getRandomValues must be defined");
|
|
740
617
|
}
|
|
741
|
-
})(
|
|
618
|
+
})(Bt)), Bt;
|
|
742
619
|
}
|
|
743
|
-
var
|
|
744
|
-
function
|
|
745
|
-
if (
|
|
746
|
-
|
|
747
|
-
const t = /* @__PURE__ */
|
|
748
|
-
function e(r,
|
|
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) {
|
|
749
626
|
if (typeof r.setBigUint64 == "function")
|
|
750
|
-
return r.setBigUint64(
|
|
751
|
-
const
|
|
752
|
-
r.setUint32(
|
|
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);
|
|
753
630
|
}
|
|
754
|
-
function s(r,
|
|
755
|
-
return r &
|
|
631
|
+
function s(r, n, h) {
|
|
632
|
+
return r & n ^ ~r & h;
|
|
756
633
|
}
|
|
757
|
-
function
|
|
758
|
-
return r &
|
|
634
|
+
function i(r, n, h) {
|
|
635
|
+
return r & n ^ r & h ^ n & h;
|
|
759
636
|
}
|
|
760
637
|
class o extends t.Hash {
|
|
761
|
-
constructor(
|
|
762
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen =
|
|
763
|
-
}
|
|
764
|
-
update(
|
|
765
|
-
(0, t.aexists)(this),
|
|
766
|
-
const { view: h, buffer:
|
|
767
|
-
for (let
|
|
768
|
-
const A = Math.min(
|
|
769
|
-
if (A ===
|
|
770
|
-
const
|
|
771
|
-
for (;
|
|
772
|
-
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);
|
|
773
650
|
continue;
|
|
774
651
|
}
|
|
775
|
-
|
|
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);
|
|
776
653
|
}
|
|
777
|
-
return this.length +=
|
|
778
|
-
}
|
|
779
|
-
digestInto(
|
|
780
|
-
(0, t.aexists)(this), (0, t.aoutput)(
|
|
781
|
-
const { buffer: h, view:
|
|
782
|
-
let { pos:
|
|
783
|
-
h[
|
|
784
|
-
for (let
|
|
785
|
-
h[
|
|
786
|
-
e(
|
|
787
|
-
const A = (0, t.createView)(
|
|
788
|
-
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)
|
|
789
666
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
667
|
+
const w = m / 4, I = this.get();
|
|
668
|
+
if (w > I.length)
|
|
792
669
|
throw new Error("_sha2: outputLen bigger than state");
|
|
793
|
-
for (let
|
|
794
|
-
A.setUint32(4 *
|
|
670
|
+
for (let C = 0; C < w; C++)
|
|
671
|
+
A.setUint32(4 * C, I[C], H);
|
|
795
672
|
}
|
|
796
673
|
digest() {
|
|
797
|
-
const { buffer:
|
|
798
|
-
this.digestInto(
|
|
799
|
-
const
|
|
800
|
-
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;
|
|
801
678
|
}
|
|
802
|
-
_cloneInto(
|
|
803
|
-
|
|
804
|
-
const { blockLen: h, buffer:
|
|
805
|
-
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;
|
|
806
683
|
}
|
|
807
684
|
clone() {
|
|
808
685
|
return this._cloneInto();
|
|
@@ -862,96 +739,96 @@ function Ae() {
|
|
|
862
739
|
327033209
|
|
863
740
|
]), K;
|
|
864
741
|
}
|
|
865
|
-
var
|
|
866
|
-
function
|
|
867
|
-
if (
|
|
868
|
-
|
|
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;
|
|
869
746
|
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
870
|
-
function s(a,
|
|
871
|
-
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 };
|
|
872
749
|
}
|
|
873
|
-
function
|
|
750
|
+
function i(a, d = !1) {
|
|
874
751
|
const f = a.length;
|
|
875
|
-
let
|
|
876
|
-
for (let
|
|
877
|
-
const { h:
|
|
878
|
-
[
|
|
879
|
-
}
|
|
880
|
-
return [
|
|
881
|
-
}
|
|
882
|
-
const o = (a,
|
|
883
|
-
|
|
884
|
-
const r = (a,
|
|
885
|
-
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
const h = (a,
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
const A = (a,
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
function
|
|
909
|
-
const
|
|
910
|
-
return { h: a + f + (
|
|
911
|
-
}
|
|
912
|
-
const M = (a,
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
const D = (a,
|
|
923
|
-
|
|
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);
|
|
787
|
+
return { h: a + f + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
788
|
+
}
|
|
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;
|
|
924
801
|
const B = {
|
|
925
802
|
fromBig: s,
|
|
926
|
-
split:
|
|
803
|
+
split: i,
|
|
927
804
|
toBig: o,
|
|
928
805
|
shrSH: r,
|
|
929
|
-
shrSL:
|
|
806
|
+
shrSL: n,
|
|
930
807
|
rotrSH: h,
|
|
931
|
-
rotrSL:
|
|
932
|
-
rotrBH:
|
|
933
|
-
rotrBL:
|
|
934
|
-
rotr32H:
|
|
808
|
+
rotrSL: b,
|
|
809
|
+
rotrBH: x,
|
|
810
|
+
rotrBL: H,
|
|
811
|
+
rotr32H: u,
|
|
935
812
|
rotr32L: A,
|
|
936
|
-
rotlSH:
|
|
937
|
-
rotlSL:
|
|
938
|
-
rotlBH:
|
|
939
|
-
rotlBL:
|
|
940
|
-
add:
|
|
813
|
+
rotlSH: m,
|
|
814
|
+
rotlSL: w,
|
|
815
|
+
rotlBH: I,
|
|
816
|
+
rotlBL: C,
|
|
817
|
+
add: R,
|
|
941
818
|
add3L: M,
|
|
942
|
-
add3H:
|
|
943
|
-
add4L:
|
|
944
|
-
add4H:
|
|
819
|
+
add3H: y,
|
|
820
|
+
add4L: O,
|
|
821
|
+
add4H: L,
|
|
945
822
|
add5H: D,
|
|
946
|
-
add5L:
|
|
823
|
+
add5L: E
|
|
947
824
|
};
|
|
948
|
-
return
|
|
825
|
+
return V.default = B, V;
|
|
949
826
|
}
|
|
950
|
-
var
|
|
951
|
-
function
|
|
952
|
-
if (
|
|
953
|
-
|
|
954
|
-
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([
|
|
955
832
|
1116352408,
|
|
956
833
|
1899447441,
|
|
957
834
|
3049323471,
|
|
@@ -1018,30 +895,30 @@ function ye() {
|
|
|
1018
895
|
3329325298
|
|
1019
896
|
]), o = /* @__PURE__ */ new Uint32Array(64);
|
|
1020
897
|
class r extends t.HashMD {
|
|
1021
|
-
constructor(
|
|
1022
|
-
super(64,
|
|
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;
|
|
1023
900
|
}
|
|
1024
901
|
get() {
|
|
1025
|
-
const { A:
|
|
1026
|
-
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];
|
|
1027
904
|
}
|
|
1028
905
|
// prettier-ignore
|
|
1029
|
-
set(
|
|
1030
|
-
this.A =
|
|
1031
|
-
}
|
|
1032
|
-
process(
|
|
1033
|
-
for (let
|
|
1034
|
-
o[
|
|
1035
|
-
for (let
|
|
1036
|
-
const
|
|
1037
|
-
o[
|
|
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;
|
|
908
|
+
}
|
|
909
|
+
process(y, O) {
|
|
910
|
+
for (let l = 0; l < 16; l++, O += 4)
|
|
911
|
+
o[l] = y.getUint32(O, !1);
|
|
912
|
+
for (let l = 16; l < 64; 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;
|
|
1038
915
|
}
|
|
1039
|
-
let { A:
|
|
1040
|
-
for (let
|
|
1041
|
-
const
|
|
1042
|
-
|
|
916
|
+
let { A: L, B: E, C: D, D: B, E: a, F: d, G: f, H: p } = this;
|
|
917
|
+
for (let l = 0; l < 64; l++) {
|
|
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;
|
|
1043
920
|
}
|
|
1044
|
-
|
|
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);
|
|
1045
922
|
}
|
|
1046
923
|
roundClean() {
|
|
1047
924
|
(0, s.clean)(o);
|
|
@@ -1051,12 +928,12 @@ function ye() {
|
|
|
1051
928
|
}
|
|
1052
929
|
}
|
|
1053
930
|
j.SHA256 = r;
|
|
1054
|
-
class
|
|
931
|
+
class n extends r {
|
|
1055
932
|
constructor() {
|
|
1056
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;
|
|
1057
934
|
}
|
|
1058
935
|
}
|
|
1059
|
-
j.SHA224 =
|
|
936
|
+
j.SHA224 = n;
|
|
1060
937
|
const h = e.split([
|
|
1061
938
|
"0x428a2f98d728ae22",
|
|
1062
939
|
"0x7137449123ef65cd",
|
|
@@ -1138,51 +1015,51 @@ function ye() {
|
|
|
1138
1015
|
"0x597f299cfc657e2a",
|
|
1139
1016
|
"0x5fcb6fab3ad6faec",
|
|
1140
1017
|
"0x6c44198c4a475817"
|
|
1141
|
-
].map((M) => BigInt(M))),
|
|
1018
|
+
].map((M) => BigInt(M))), b = h[0], x = h[1], H = /* @__PURE__ */ new Uint32Array(80), u = /* @__PURE__ */ new Uint32Array(80);
|
|
1142
1019
|
class A extends t.HashMD {
|
|
1143
|
-
constructor(
|
|
1144
|
-
super(128,
|
|
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;
|
|
1145
1022
|
}
|
|
1146
1023
|
// prettier-ignore
|
|
1147
1024
|
get() {
|
|
1148
|
-
const { Ah:
|
|
1149
|
-
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];
|
|
1150
1027
|
}
|
|
1151
1028
|
// prettier-ignore
|
|
1152
|
-
set(
|
|
1153
|
-
this.Ah =
|
|
1154
|
-
}
|
|
1155
|
-
process(
|
|
1156
|
-
for (let
|
|
1157
|
-
|
|
1158
|
-
for (let
|
|
1159
|
-
const T =
|
|
1160
|
-
|
|
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;
|
|
1161
1038
|
}
|
|
1162
|
-
let { Ah:
|
|
1163
|
-
for (let
|
|
1164
|
-
const T = e.rotrSH(
|
|
1165
|
-
c =
|
|
1166
|
-
const
|
|
1167
|
-
|
|
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;
|
|
1168
1045
|
}
|
|
1169
|
-
({ 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);
|
|
1170
1047
|
}
|
|
1171
1048
|
roundClean() {
|
|
1172
|
-
(0, s.clean)(
|
|
1049
|
+
(0, s.clean)(H, u);
|
|
1173
1050
|
}
|
|
1174
1051
|
destroy() {
|
|
1175
1052
|
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1176
1053
|
}
|
|
1177
1054
|
}
|
|
1178
1055
|
j.SHA512 = A;
|
|
1179
|
-
class
|
|
1056
|
+
class m extends A {
|
|
1180
1057
|
constructor() {
|
|
1181
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;
|
|
1182
1059
|
}
|
|
1183
1060
|
}
|
|
1184
|
-
j.SHA384 =
|
|
1185
|
-
const
|
|
1061
|
+
j.SHA384 = m;
|
|
1062
|
+
const w = /* @__PURE__ */ Uint32Array.from([
|
|
1186
1063
|
2352822216,
|
|
1187
1064
|
424955298,
|
|
1188
1065
|
1944164710,
|
|
@@ -1199,7 +1076,7 @@ function ye() {
|
|
|
1199
1076
|
1780299464,
|
|
1200
1077
|
286451373,
|
|
1201
1078
|
2446758561
|
|
1202
|
-
]),
|
|
1079
|
+
]), I = /* @__PURE__ */ Uint32Array.from([
|
|
1203
1080
|
573645204,
|
|
1204
1081
|
4230739756,
|
|
1205
1082
|
2673172387,
|
|
@@ -1217,39 +1094,39 @@ function ye() {
|
|
|
1217
1094
|
246885852,
|
|
1218
1095
|
2177182882
|
|
1219
1096
|
]);
|
|
1220
|
-
class
|
|
1097
|
+
class C extends A {
|
|
1221
1098
|
constructor() {
|
|
1222
|
-
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;
|
|
1223
1100
|
}
|
|
1224
1101
|
}
|
|
1225
|
-
j.SHA512_224 =
|
|
1226
|
-
class
|
|
1102
|
+
j.SHA512_224 = C;
|
|
1103
|
+
class R extends A {
|
|
1227
1104
|
constructor() {
|
|
1228
|
-
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;
|
|
1229
1106
|
}
|
|
1230
1107
|
}
|
|
1231
|
-
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;
|
|
1232
1109
|
}
|
|
1233
|
-
var
|
|
1234
|
-
function
|
|
1235
|
-
return
|
|
1110
|
+
var mt = {}, jt;
|
|
1111
|
+
function Pe() {
|
|
1112
|
+
return jt || (jt = 1, (function(t) {
|
|
1236
1113
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
|
|
1237
|
-
const e = /* @__PURE__ */
|
|
1114
|
+
const e = /* @__PURE__ */ pt();
|
|
1238
1115
|
class s extends e.Hash {
|
|
1239
|
-
constructor(r,
|
|
1116
|
+
constructor(r, n) {
|
|
1240
1117
|
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(r);
|
|
1241
|
-
const h = (0, e.toBytes)(
|
|
1118
|
+
const h = (0, e.toBytes)(n);
|
|
1242
1119
|
if (this.iHash = r.create(), typeof this.iHash.update != "function")
|
|
1243
1120
|
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1244
1121
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
for (let
|
|
1248
|
-
|
|
1249
|
-
this.iHash.update(
|
|
1250
|
-
for (let
|
|
1251
|
-
|
|
1252
|
-
this.oHash.update(
|
|
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;
|
|
1129
|
+
this.oHash.update(x), (0, e.clean)(x);
|
|
1253
1130
|
}
|
|
1254
1131
|
update(r) {
|
|
1255
1132
|
return (0, e.aexists)(this), this.iHash.update(r), this;
|
|
@@ -1263,8 +1140,8 @@ function hs() {
|
|
|
1263
1140
|
}
|
|
1264
1141
|
_cloneInto(r) {
|
|
1265
1142
|
r || (r = Object.create(Object.getPrototypeOf(this), {}));
|
|
1266
|
-
const { oHash:
|
|
1267
|
-
return r = r, r.finished =
|
|
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;
|
|
1268
1145
|
}
|
|
1269
1146
|
clone() {
|
|
1270
1147
|
return this._cloneInto();
|
|
@@ -1274,85 +1151,85 @@ function hs() {
|
|
|
1274
1151
|
}
|
|
1275
1152
|
}
|
|
1276
1153
|
t.HMAC = s;
|
|
1277
|
-
const
|
|
1278
|
-
t.hmac =
|
|
1279
|
-
})(
|
|
1280
|
-
}
|
|
1281
|
-
var
|
|
1282
|
-
function
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1285
|
-
const t = /* @__PURE__ */
|
|
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;
|
|
1157
|
+
}
|
|
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([
|
|
1286
1163
|
1732584193,
|
|
1287
1164
|
4023233417,
|
|
1288
1165
|
2562383102,
|
|
1289
1166
|
271733878,
|
|
1290
1167
|
3285377520
|
|
1291
|
-
]),
|
|
1168
|
+
]), i = /* @__PURE__ */ new Uint32Array(80);
|
|
1292
1169
|
class o extends t.HashMD {
|
|
1293
1170
|
constructor() {
|
|
1294
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;
|
|
1295
1172
|
}
|
|
1296
1173
|
get() {
|
|
1297
|
-
const { A: a, B:
|
|
1298
|
-
return [a,
|
|
1174
|
+
const { A: a, B: d, C: f, D: p, E: l } = this;
|
|
1175
|
+
return [a, d, f, p, l];
|
|
1299
1176
|
}
|
|
1300
|
-
set(a,
|
|
1301
|
-
this.A = a | 0, this.B =
|
|
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;
|
|
1302
1179
|
}
|
|
1303
|
-
process(a,
|
|
1304
|
-
for (let k = 0; k < 16; k++,
|
|
1305
|
-
|
|
1180
|
+
process(a, d) {
|
|
1181
|
+
for (let k = 0; k < 16; k++, d += 4)
|
|
1182
|
+
i[k] = a.getUint32(d, !1);
|
|
1306
1183
|
for (let k = 16; k < 80; k++)
|
|
1307
|
-
|
|
1308
|
-
let { A: f, B:
|
|
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;
|
|
1309
1186
|
for (let k = 0; k < 80; k++) {
|
|
1310
|
-
let
|
|
1311
|
-
k < 20 ? (
|
|
1312
|
-
const c = (0, e.rotl)(f, 5) +
|
|
1313
|
-
|
|
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;
|
|
1314
1191
|
}
|
|
1315
|
-
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);
|
|
1316
1193
|
}
|
|
1317
1194
|
roundClean() {
|
|
1318
|
-
(0, e.clean)(
|
|
1195
|
+
(0, e.clean)(i);
|
|
1319
1196
|
}
|
|
1320
1197
|
destroy() {
|
|
1321
1198
|
this.set(0, 0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1322
1199
|
}
|
|
1323
1200
|
}
|
|
1324
1201
|
N.SHA1 = o, N.sha1 = (0, e.createHasher)(() => new o());
|
|
1325
|
-
const r = /* @__PURE__ */ Math.pow(2, 32),
|
|
1326
|
-
class
|
|
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);
|
|
1203
|
+
class x extends t.HashMD {
|
|
1327
1204
|
constructor() {
|
|
1328
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;
|
|
1329
1206
|
}
|
|
1330
1207
|
get() {
|
|
1331
|
-
const { A: a, B:
|
|
1332
|
-
return [a,
|
|
1333
|
-
}
|
|
1334
|
-
set(a,
|
|
1335
|
-
this.A = a | 0, this.B =
|
|
1336
|
-
}
|
|
1337
|
-
process(a,
|
|
1338
|
-
for (let
|
|
1339
|
-
|
|
1340
|
-
let { A: f, B:
|
|
1341
|
-
for (let
|
|
1342
|
-
let k,
|
|
1343
|
-
|
|
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]);
|
|
1344
1221
|
}
|
|
1345
|
-
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);
|
|
1346
1223
|
}
|
|
1347
1224
|
roundClean() {
|
|
1348
|
-
(0, e.clean)(
|
|
1225
|
+
(0, e.clean)(b);
|
|
1349
1226
|
}
|
|
1350
1227
|
destroy() {
|
|
1351
1228
|
this.set(0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1352
1229
|
}
|
|
1353
1230
|
}
|
|
1354
|
-
N.MD5 =
|
|
1355
|
-
const
|
|
1231
|
+
N.MD5 = x, N.md5 = (0, e.createHasher)(() => new x());
|
|
1232
|
+
const H = /* @__PURE__ */ Uint8Array.from([
|
|
1356
1233
|
7,
|
|
1357
1234
|
4,
|
|
1358
1235
|
13,
|
|
@@ -1369,65 +1246,65 @@ function as() {
|
|
|
1369
1246
|
14,
|
|
1370
1247
|
11,
|
|
1371
1248
|
8
|
|
1372
|
-
]),
|
|
1373
|
-
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]];
|
|
1374
1251
|
for (let f = 0; f < 4; f++)
|
|
1375
|
-
for (let
|
|
1376
|
-
|
|
1377
|
-
return
|
|
1378
|
-
})(),
|
|
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__ */ [
|
|
1379
1256
|
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
1380
1257
|
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
1381
1258
|
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
1382
1259
|
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
1383
1260
|
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
1384
|
-
].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([
|
|
1385
1262
|
0,
|
|
1386
1263
|
1518500249,
|
|
1387
1264
|
1859775393,
|
|
1388
1265
|
2400959708,
|
|
1389
1266
|
2840853838
|
|
1390
|
-
]),
|
|
1267
|
+
]), O = /* @__PURE__ */ Uint32Array.from([
|
|
1391
1268
|
1352829926,
|
|
1392
1269
|
1548603684,
|
|
1393
1270
|
1836072691,
|
|
1394
1271
|
2053994217,
|
|
1395
1272
|
0
|
|
1396
1273
|
]);
|
|
1397
|
-
function
|
|
1398
|
-
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);
|
|
1399
1276
|
}
|
|
1400
|
-
const
|
|
1277
|
+
const E = /* @__PURE__ */ new Uint32Array(16);
|
|
1401
1278
|
class D extends t.HashMD {
|
|
1402
1279
|
constructor() {
|
|
1403
1280
|
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
1404
1281
|
}
|
|
1405
1282
|
get() {
|
|
1406
|
-
const { h0: a, h1:
|
|
1407
|
-
return [a,
|
|
1408
|
-
}
|
|
1409
|
-
set(a,
|
|
1410
|
-
this.h0 = a | 0, this.h1 =
|
|
1411
|
-
}
|
|
1412
|
-
process(a,
|
|
1413
|
-
for (let
|
|
1414
|
-
|
|
1415
|
-
let f = this.h0 | 0,
|
|
1416
|
-
for (let
|
|
1417
|
-
const T = 4 -
|
|
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[_];
|
|
1418
1295
|
for (let Q = 0; Q < 16; Q++) {
|
|
1419
|
-
const
|
|
1420
|
-
f = c, c =
|
|
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;
|
|
1421
1298
|
}
|
|
1422
1299
|
for (let Q = 0; Q < 16; Q++) {
|
|
1423
|
-
const
|
|
1424
|
-
|
|
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;
|
|
1425
1302
|
}
|
|
1426
1303
|
}
|
|
1427
|
-
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);
|
|
1428
1305
|
}
|
|
1429
1306
|
roundClean() {
|
|
1430
|
-
(0, e.clean)(
|
|
1307
|
+
(0, e.clean)(E);
|
|
1431
1308
|
}
|
|
1432
1309
|
destroy() {
|
|
1433
1310
|
this.destroyed = !0, (0, e.clean)(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
@@ -1435,146 +1312,146 @@ function as() {
|
|
|
1435
1312
|
}
|
|
1436
1313
|
return N.RIPEMD160 = D, N.ripemd160 = (0, e.createHasher)(() => new D()), N;
|
|
1437
1314
|
}
|
|
1438
|
-
var
|
|
1439
|
-
function
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1442
|
-
const t = /* @__PURE__ */
|
|
1443
|
-
return
|
|
1444
|
-
}
|
|
1445
|
-
var Y = {},
|
|
1446
|
-
function
|
|
1447
|
-
if (
|
|
1448
|
-
|
|
1449
|
-
const t = /* @__PURE__ */
|
|
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;
|
|
1321
|
+
}
|
|
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();
|
|
1450
1327
|
return Y.SHA256 = t.SHA256, Y.sha256 = t.sha256, Y.SHA224 = t.SHA224, Y.sha224 = t.sha224, Y;
|
|
1451
1328
|
}
|
|
1452
|
-
var W = {},
|
|
1453
|
-
function
|
|
1454
|
-
if (
|
|
1455
|
-
|
|
1456
|
-
const t = /* @__PURE__ */
|
|
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();
|
|
1457
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;
|
|
1458
1335
|
}
|
|
1459
|
-
function
|
|
1336
|
+
function qe(t) {
|
|
1460
1337
|
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1461
1338
|
}
|
|
1462
|
-
function
|
|
1339
|
+
function Nt(t, e = "") {
|
|
1463
1340
|
if (!Number.isSafeInteger(t) || t < 0) {
|
|
1464
1341
|
const s = e && `"${e}" `;
|
|
1465
1342
|
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
1466
1343
|
}
|
|
1467
1344
|
}
|
|
1468
|
-
function
|
|
1469
|
-
const
|
|
1470
|
-
if (!
|
|
1471
|
-
const
|
|
1472
|
-
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);
|
|
1473
1350
|
}
|
|
1474
1351
|
return t;
|
|
1475
1352
|
}
|
|
1476
|
-
function
|
|
1353
|
+
function Xt(t, e = !0) {
|
|
1477
1354
|
if (t.destroyed)
|
|
1478
1355
|
throw new Error("Hash instance has been destroyed");
|
|
1479
1356
|
if (e && t.finished)
|
|
1480
1357
|
throw new Error("Hash#digest() has already been called");
|
|
1481
1358
|
}
|
|
1482
|
-
function
|
|
1483
|
-
|
|
1359
|
+
function Ke(t, e) {
|
|
1360
|
+
It(t, void 0, "digestInto() output");
|
|
1484
1361
|
const s = e.outputLen;
|
|
1485
1362
|
if (t.length < s)
|
|
1486
1363
|
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
1487
1364
|
}
|
|
1488
|
-
function
|
|
1365
|
+
function Ne(t) {
|
|
1489
1366
|
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
1490
1367
|
}
|
|
1491
|
-
function
|
|
1368
|
+
function he(...t) {
|
|
1492
1369
|
for (let e = 0; e < t.length; e++)
|
|
1493
1370
|
t[e].fill(0);
|
|
1494
1371
|
}
|
|
1495
|
-
const
|
|
1496
|
-
function
|
|
1372
|
+
const Xe = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1373
|
+
function Je(t) {
|
|
1497
1374
|
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
1498
1375
|
}
|
|
1499
|
-
function
|
|
1376
|
+
function Qe(t) {
|
|
1500
1377
|
for (let e = 0; e < t.length; e++)
|
|
1501
|
-
t[e] =
|
|
1378
|
+
t[e] = Je(t[e]);
|
|
1502
1379
|
return t;
|
|
1503
1380
|
}
|
|
1504
|
-
const
|
|
1505
|
-
function
|
|
1381
|
+
const Jt = Xe ? (t) => t : Qe;
|
|
1382
|
+
function _s(...t) {
|
|
1506
1383
|
let e = 0;
|
|
1507
|
-
for (let
|
|
1508
|
-
const o = t[
|
|
1509
|
-
|
|
1384
|
+
for (let i = 0; i < t.length; i++) {
|
|
1385
|
+
const o = t[i];
|
|
1386
|
+
It(o), e += o.length;
|
|
1510
1387
|
}
|
|
1511
1388
|
const s = new Uint8Array(e);
|
|
1512
|
-
for (let
|
|
1513
|
-
const r = t[
|
|
1389
|
+
for (let i = 0, o = 0; i < t.length; i++) {
|
|
1390
|
+
const r = t[i];
|
|
1514
1391
|
s.set(r, o), o += r.length;
|
|
1515
1392
|
}
|
|
1516
1393
|
return s;
|
|
1517
1394
|
}
|
|
1518
|
-
function
|
|
1519
|
-
const s = (o, r) => t(r).update(o).digest(),
|
|
1520
|
-
return s.outputLen =
|
|
1395
|
+
function Ye(t, e = {}) {
|
|
1396
|
+
const s = (o, r) => t(r).update(o).digest(), i = t(void 0);
|
|
1397
|
+
return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (o) => t(o), Object.assign(s, e), Object.freeze(s);
|
|
1521
1398
|
}
|
|
1522
|
-
function
|
|
1399
|
+
function ws(t = 32) {
|
|
1523
1400
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
1524
1401
|
if (typeof e?.getRandomValues != "function")
|
|
1525
1402
|
throw new Error("crypto.getRandomValues must be defined");
|
|
1526
1403
|
return e.getRandomValues(new Uint8Array(t));
|
|
1527
1404
|
}
|
|
1528
|
-
const
|
|
1405
|
+
const ae = (t) => ({
|
|
1529
1406
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
1530
|
-
}),
|
|
1531
|
-
function
|
|
1532
|
-
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 };
|
|
1533
1410
|
}
|
|
1534
|
-
function
|
|
1411
|
+
function ze(t, e = !1) {
|
|
1535
1412
|
const s = t.length;
|
|
1536
|
-
let
|
|
1413
|
+
let i = new Uint32Array(s), o = new Uint32Array(s);
|
|
1537
1414
|
for (let r = 0; r < s; r++) {
|
|
1538
|
-
const { h:
|
|
1539
|
-
[
|
|
1415
|
+
const { h: n, l: h } = Ze(t[r], e);
|
|
1416
|
+
[i[r], o[r]] = [n, h];
|
|
1540
1417
|
}
|
|
1541
|
-
return [
|
|
1418
|
+
return [i, o];
|
|
1542
1419
|
}
|
|
1543
|
-
const
|
|
1544
|
-
for (let t = 0, e =
|
|
1545
|
-
[s,
|
|
1546
|
-
let o =
|
|
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;
|
|
1547
1424
|
for (let r = 0; r < 7; r++)
|
|
1548
|
-
e = (e <<
|
|
1549
|
-
|
|
1425
|
+
e = (e << bt ^ (e >> is) * cs) % os, e & rs && (o ^= bt << (bt << BigInt(r)) - bt);
|
|
1426
|
+
ue.push(o);
|
|
1550
1427
|
}
|
|
1551
|
-
const
|
|
1552
|
-
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) {
|
|
1553
1430
|
const s = new Uint32Array(10);
|
|
1554
|
-
for (let
|
|
1555
|
-
for (let
|
|
1556
|
-
s[
|
|
1557
|
-
for (let
|
|
1558
|
-
const h = (
|
|
1559
|
-
for (let
|
|
1560
|
-
t[
|
|
1431
|
+
for (let i = 24 - e; i < 24; i++) {
|
|
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;
|
|
1561
1438
|
}
|
|
1562
1439
|
let o = t[2], r = t[3];
|
|
1563
|
-
for (let
|
|
1564
|
-
const h =
|
|
1565
|
-
o = t[
|
|
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;
|
|
1566
1443
|
}
|
|
1567
|
-
for (let
|
|
1444
|
+
for (let n = 0; n < 50; n += 10) {
|
|
1568
1445
|
for (let h = 0; h < 10; h++)
|
|
1569
|
-
s[h] = t[
|
|
1446
|
+
s[h] = t[n + h];
|
|
1570
1447
|
for (let h = 0; h < 10; h++)
|
|
1571
|
-
t[
|
|
1448
|
+
t[n + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
1572
1449
|
}
|
|
1573
|
-
t[0] ^=
|
|
1450
|
+
t[0] ^= hs[i], t[1] ^= as[i];
|
|
1574
1451
|
}
|
|
1575
|
-
|
|
1452
|
+
he(s);
|
|
1576
1453
|
}
|
|
1577
|
-
class
|
|
1454
|
+
class Et {
|
|
1578
1455
|
state;
|
|
1579
1456
|
pos = 0;
|
|
1580
1457
|
posOut = 0;
|
|
@@ -1587,24 +1464,24 @@ class Ot {
|
|
|
1587
1464
|
enableXOF = !1;
|
|
1588
1465
|
rounds;
|
|
1589
1466
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1590
|
-
constructor(e, s,
|
|
1591
|
-
if (this.blockLen = e, this.suffix = s, this.outputLen =
|
|
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))
|
|
1592
1469
|
throw new Error("only keccak-f1600 function is supported");
|
|
1593
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
1470
|
+
this.state = new Uint8Array(200), this.state32 = Ne(this.state);
|
|
1594
1471
|
}
|
|
1595
1472
|
clone() {
|
|
1596
1473
|
return this._cloneInto();
|
|
1597
1474
|
}
|
|
1598
1475
|
keccak() {
|
|
1599
|
-
|
|
1476
|
+
Jt(this.state32), fs(this.state32, this.rounds), Jt(this.state32), this.posOut = 0, this.pos = 0;
|
|
1600
1477
|
}
|
|
1601
1478
|
update(e) {
|
|
1602
|
-
|
|
1603
|
-
const { blockLen: s, state:
|
|
1479
|
+
Xt(this), It(e);
|
|
1480
|
+
const { blockLen: s, state: i } = this, o = e.length;
|
|
1604
1481
|
for (let r = 0; r < o; ) {
|
|
1605
|
-
const
|
|
1606
|
-
for (let h = 0; h <
|
|
1607
|
-
|
|
1482
|
+
const n = Math.min(s - this.pos, o - r);
|
|
1483
|
+
for (let h = 0; h < n; h++)
|
|
1484
|
+
i[this.pos++] ^= e[r++];
|
|
1608
1485
|
this.pos === s && this.keccak();
|
|
1609
1486
|
}
|
|
1610
1487
|
return this;
|
|
@@ -1613,16 +1490,16 @@ class Ot {
|
|
|
1613
1490
|
if (this.finished)
|
|
1614
1491
|
return;
|
|
1615
1492
|
this.finished = !0;
|
|
1616
|
-
const { state: e, suffix: s, pos:
|
|
1617
|
-
e[
|
|
1493
|
+
const { state: e, suffix: s, pos: i, blockLen: o } = this;
|
|
1494
|
+
e[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
|
|
1618
1495
|
}
|
|
1619
1496
|
writeInto(e) {
|
|
1620
|
-
|
|
1621
|
-
const s = this.state, { blockLen:
|
|
1497
|
+
Xt(this, !1), It(e), this.finish();
|
|
1498
|
+
const s = this.state, { blockLen: i } = this;
|
|
1622
1499
|
for (let o = 0, r = e.length; o < r; ) {
|
|
1623
|
-
this.posOut >=
|
|
1624
|
-
const
|
|
1625
|
-
e.set(s.subarray(this.posOut, this.posOut +
|
|
1500
|
+
this.posOut >= i && this.keccak();
|
|
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;
|
|
1626
1503
|
}
|
|
1627
1504
|
return e;
|
|
1628
1505
|
}
|
|
@@ -1632,10 +1509,10 @@ class Ot {
|
|
|
1632
1509
|
return this.writeInto(e);
|
|
1633
1510
|
}
|
|
1634
1511
|
xof(e) {
|
|
1635
|
-
return
|
|
1512
|
+
return Nt(e), this.xofInto(new Uint8Array(e));
|
|
1636
1513
|
}
|
|
1637
1514
|
digestInto(e) {
|
|
1638
|
-
if (
|
|
1515
|
+
if (Ke(e, this), this.finished)
|
|
1639
1516
|
throw new Error("digest() was already called");
|
|
1640
1517
|
return this.writeInto(e), this.destroy(), e;
|
|
1641
1518
|
}
|
|
@@ -1643,35 +1520,35 @@ class Ot {
|
|
|
1643
1520
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1644
1521
|
}
|
|
1645
1522
|
destroy() {
|
|
1646
|
-
this.destroyed = !0,
|
|
1523
|
+
this.destroyed = !0, he(this.state);
|
|
1647
1524
|
}
|
|
1648
1525
|
_cloneInto(e) {
|
|
1649
|
-
const { blockLen: s, suffix:
|
|
1650
|
-
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;
|
|
1651
1528
|
}
|
|
1652
1529
|
}
|
|
1653
|
-
const
|
|
1654
|
-
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 {
|
|
1655
1532
|
constructor(e, s) {
|
|
1656
|
-
super(), this.finished = !1, this.destroyed = !1,
|
|
1657
|
-
const
|
|
1533
|
+
super(), this.finished = !1, this.destroyed = !1, $t(e);
|
|
1534
|
+
const i = Ut(s);
|
|
1658
1535
|
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
1659
1536
|
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1660
1537
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1661
1538
|
const o = this.blockLen, r = new Uint8Array(o);
|
|
1662
|
-
r.set(
|
|
1663
|
-
for (let
|
|
1664
|
-
r[
|
|
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;
|
|
1665
1542
|
this.iHash.update(r), this.oHash = e.create();
|
|
1666
|
-
for (let
|
|
1667
|
-
r[
|
|
1668
|
-
this.oHash.update(r),
|
|
1543
|
+
for (let n = 0; n < r.length; n++)
|
|
1544
|
+
r[n] ^= 106;
|
|
1545
|
+
this.oHash.update(r), ct(r);
|
|
1669
1546
|
}
|
|
1670
1547
|
update(e) {
|
|
1671
|
-
return
|
|
1548
|
+
return St(this), this.iHash.update(e), this;
|
|
1672
1549
|
}
|
|
1673
1550
|
digestInto(e) {
|
|
1674
|
-
|
|
1551
|
+
St(this), ht(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
1675
1552
|
}
|
|
1676
1553
|
digest() {
|
|
1677
1554
|
const e = new Uint8Array(this.oHash.outputLen);
|
|
@@ -1679,8 +1556,8 @@ class Be extends ae {
|
|
|
1679
1556
|
}
|
|
1680
1557
|
_cloneInto(e) {
|
|
1681
1558
|
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
1682
|
-
const { oHash: s, iHash:
|
|
1683
|
-
return e = e, e.finished = o, e.destroyed = r, e.blockLen =
|
|
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;
|
|
1684
1561
|
}
|
|
1685
1562
|
clone() {
|
|
1686
1563
|
return this._cloneInto();
|
|
@@ -1689,110 +1566,108 @@ class Be extends ae {
|
|
|
1689
1566
|
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
1690
1567
|
}
|
|
1691
1568
|
}
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1696
|
-
const o =
|
|
1697
|
-
if (
|
|
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)
|
|
1698
1575
|
throw new Error("iterations (c) should be >= 1");
|
|
1699
|
-
const
|
|
1700
|
-
return { c: r, dkLen:
|
|
1701
|
-
}
|
|
1702
|
-
function
|
|
1703
|
-
return t.destroy(), e.destroy(),
|
|
1704
|
-
}
|
|
1705
|
-
function
|
|
1706
|
-
const { c: o, dkLen: r, DK:
|
|
1707
|
-
let
|
|
1708
|
-
const
|
|
1709
|
-
for (let
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
for (let
|
|
1713
|
-
h._cloneInto(
|
|
1714
|
-
for (let
|
|
1715
|
-
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
return
|
|
1719
|
-
}
|
|
1720
|
-
const
|
|
1721
|
-
var
|
|
1722
|
-
function
|
|
1723
|
-
if (
|
|
1724
|
-
|
|
1725
|
-
const t = /* @__PURE__ */
|
|
1726
|
-
function s(
|
|
1727
|
-
(0, e.ahash)(
|
|
1728
|
-
const
|
|
1729
|
-
if ((0, e.anumber)(
|
|
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)
|
|
1730
1607
|
throw new Error("iterations (c) should be >= 1");
|
|
1731
|
-
const
|
|
1732
|
-
return { c:
|
|
1733
|
-
}
|
|
1734
|
-
function n
|
|
1735
|
-
return
|
|
1736
|
-
}
|
|
1737
|
-
function o(
|
|
1738
|
-
const { c:
|
|
1739
|
-
let
|
|
1740
|
-
const
|
|
1741
|
-
for (let
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1744
|
-
for (let
|
|
1745
|
-
|
|
1746
|
-
for (let D = 0; D <
|
|
1747
|
-
|
|
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];
|
|
1748
1625
|
}
|
|
1749
1626
|
}
|
|
1750
|
-
return
|
|
1751
|
-
}
|
|
1752
|
-
async function r(
|
|
1753
|
-
const { c:
|
|
1754
|
-
let
|
|
1755
|
-
const
|
|
1756
|
-
for (let
|
|
1757
|
-
const
|
|
1758
|
-
M.setInt32(0,
|
|
1759
|
-
|
|
1760
|
-
for (let D = 0; D <
|
|
1761
|
-
|
|
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];
|
|
1762
1639
|
});
|
|
1763
1640
|
}
|
|
1764
|
-
return
|
|
1641
|
+
return i(w, I, m, C, y);
|
|
1765
1642
|
}
|
|
1766
|
-
return
|
|
1643
|
+
return xt;
|
|
1767
1644
|
}
|
|
1768
1645
|
export {
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
Ns as y,
|
|
1797
|
-
Js as z
|
|
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,
|
|
1658
|
+
ps as l,
|
|
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
|
|
1798
1673
|
};
|