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