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