@toon-protocol/client-mcp 0.26.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/LICENSE +190 -0
- package/README.md +261 -0
- package/dist/anon-proxy-6N362VEV-M7AX2QD7.js +24 -0
- package/dist/anon-proxy-6N362VEV-M7AX2QD7.js.map +1 -0
- package/dist/chunk-245J23EB.js +278 -0
- package/dist/chunk-245J23EB.js.map +1 -0
- package/dist/chunk-2SGZPDGE.js +625 -0
- package/dist/chunk-2SGZPDGE.js.map +1 -0
- package/dist/chunk-32QD72IL.js +83 -0
- package/dist/chunk-32QD72IL.js.map +1 -0
- package/dist/chunk-5YIZ2JQO.js +205 -0
- package/dist/chunk-5YIZ2JQO.js.map +1 -0
- package/dist/chunk-LR7W2ISE.js +657 -0
- package/dist/chunk-LR7W2ISE.js.map +1 -0
- package/dist/chunk-QTDCFXPF.js +2802 -0
- package/dist/chunk-QTDCFXPF.js.map +1 -0
- package/dist/chunk-VA7XC4FD.js +185 -0
- package/dist/chunk-VA7XC4FD.js.map +1 -0
- package/dist/chunk-WMYY5I3H.js +10818 -0
- package/dist/chunk-WMYY5I3H.js.map +1 -0
- package/dist/daemon.d.ts +1 -0
- package/dist/daemon.js +137 -0
- package/dist/daemon.js.map +1 -0
- package/dist/ed25519-OFFWPWRE.js +26 -0
- package/dist/ed25519-OFFWPWRE.js.map +1 -0
- package/dist/gateway-QOK47RKS-HB65KIKC.js +15 -0
- package/dist/gateway-QOK47RKS-HB65KIKC.js.map +1 -0
- package/dist/hmac-7WSXTWW4.js +11 -0
- package/dist/hmac-7WSXTWW4.js.map +1 -0
- package/dist/index.d.ts +642 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +80 -0
- package/dist/mcp.js.map +1 -0
- package/dist/sha512-LMOIUNFJ.js +33 -0
- package/dist/sha512-LMOIUNFJ.js.map +1 -0
- package/dist/socks5-WTJBYGME-IXWLQDE7.js +138 -0
- package/dist/socks5-WTJBYGME-IXWLQDE7.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Hash,
|
|
4
|
+
abytes,
|
|
5
|
+
aexists,
|
|
6
|
+
aoutput,
|
|
7
|
+
clean,
|
|
8
|
+
createHasher,
|
|
9
|
+
createView,
|
|
10
|
+
rotr,
|
|
11
|
+
toBytes
|
|
12
|
+
} from "./chunk-VA7XC4FD.js";
|
|
13
|
+
|
|
14
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
15
|
+
function setBigUint64(view, byteOffset, value, isLE) {
|
|
16
|
+
if (typeof view.setBigUint64 === "function")
|
|
17
|
+
return view.setBigUint64(byteOffset, value, isLE);
|
|
18
|
+
const _32n2 = BigInt(32);
|
|
19
|
+
const _u32_max = BigInt(4294967295);
|
|
20
|
+
const wh = Number(value >> _32n2 & _u32_max);
|
|
21
|
+
const wl = Number(value & _u32_max);
|
|
22
|
+
const h = isLE ? 4 : 0;
|
|
23
|
+
const l = isLE ? 0 : 4;
|
|
24
|
+
view.setUint32(byteOffset + h, wh, isLE);
|
|
25
|
+
view.setUint32(byteOffset + l, wl, isLE);
|
|
26
|
+
}
|
|
27
|
+
function Chi(a, b, c) {
|
|
28
|
+
return a & b ^ ~a & c;
|
|
29
|
+
}
|
|
30
|
+
function Maj(a, b, c) {
|
|
31
|
+
return a & b ^ a & c ^ b & c;
|
|
32
|
+
}
|
|
33
|
+
var HashMD = class extends Hash {
|
|
34
|
+
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
35
|
+
super();
|
|
36
|
+
this.finished = false;
|
|
37
|
+
this.length = 0;
|
|
38
|
+
this.pos = 0;
|
|
39
|
+
this.destroyed = false;
|
|
40
|
+
this.blockLen = blockLen;
|
|
41
|
+
this.outputLen = outputLen;
|
|
42
|
+
this.padOffset = padOffset;
|
|
43
|
+
this.isLE = isLE;
|
|
44
|
+
this.buffer = new Uint8Array(blockLen);
|
|
45
|
+
this.view = createView(this.buffer);
|
|
46
|
+
}
|
|
47
|
+
update(data) {
|
|
48
|
+
aexists(this);
|
|
49
|
+
data = toBytes(data);
|
|
50
|
+
abytes(data);
|
|
51
|
+
const { view, buffer, blockLen } = this;
|
|
52
|
+
const len = data.length;
|
|
53
|
+
for (let pos = 0; pos < len; ) {
|
|
54
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
55
|
+
if (take === blockLen) {
|
|
56
|
+
const dataView = createView(data);
|
|
57
|
+
for (; blockLen <= len - pos; pos += blockLen)
|
|
58
|
+
this.process(dataView, pos);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
62
|
+
this.pos += take;
|
|
63
|
+
pos += take;
|
|
64
|
+
if (this.pos === blockLen) {
|
|
65
|
+
this.process(view, 0);
|
|
66
|
+
this.pos = 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
this.length += data.length;
|
|
70
|
+
this.roundClean();
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
digestInto(out) {
|
|
74
|
+
aexists(this);
|
|
75
|
+
aoutput(out, this);
|
|
76
|
+
this.finished = true;
|
|
77
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
78
|
+
let { pos } = this;
|
|
79
|
+
buffer[pos++] = 128;
|
|
80
|
+
clean(this.buffer.subarray(pos));
|
|
81
|
+
if (this.padOffset > blockLen - pos) {
|
|
82
|
+
this.process(view, 0);
|
|
83
|
+
pos = 0;
|
|
84
|
+
}
|
|
85
|
+
for (let i = pos; i < blockLen; i++)
|
|
86
|
+
buffer[i] = 0;
|
|
87
|
+
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
88
|
+
this.process(view, 0);
|
|
89
|
+
const oview = createView(out);
|
|
90
|
+
const len = this.outputLen;
|
|
91
|
+
if (len % 4)
|
|
92
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
93
|
+
const outLen = len / 4;
|
|
94
|
+
const state = this.get();
|
|
95
|
+
if (outLen > state.length)
|
|
96
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
97
|
+
for (let i = 0; i < outLen; i++)
|
|
98
|
+
oview.setUint32(4 * i, state[i], isLE);
|
|
99
|
+
}
|
|
100
|
+
digest() {
|
|
101
|
+
const { buffer, outputLen } = this;
|
|
102
|
+
this.digestInto(buffer);
|
|
103
|
+
const res = buffer.slice(0, outputLen);
|
|
104
|
+
this.destroy();
|
|
105
|
+
return res;
|
|
106
|
+
}
|
|
107
|
+
_cloneInto(to) {
|
|
108
|
+
to || (to = new this.constructor());
|
|
109
|
+
to.set(...this.get());
|
|
110
|
+
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
111
|
+
to.destroyed = destroyed;
|
|
112
|
+
to.finished = finished;
|
|
113
|
+
to.length = length;
|
|
114
|
+
to.pos = pos;
|
|
115
|
+
if (length % blockLen)
|
|
116
|
+
to.buffer.set(buffer);
|
|
117
|
+
return to;
|
|
118
|
+
}
|
|
119
|
+
clone() {
|
|
120
|
+
return this._cloneInto();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
124
|
+
1779033703,
|
|
125
|
+
3144134277,
|
|
126
|
+
1013904242,
|
|
127
|
+
2773480762,
|
|
128
|
+
1359893119,
|
|
129
|
+
2600822924,
|
|
130
|
+
528734635,
|
|
131
|
+
1541459225
|
|
132
|
+
]);
|
|
133
|
+
var SHA384_IV = /* @__PURE__ */ Uint32Array.from([
|
|
134
|
+
3418070365,
|
|
135
|
+
3238371032,
|
|
136
|
+
1654270250,
|
|
137
|
+
914150663,
|
|
138
|
+
2438529370,
|
|
139
|
+
812702999,
|
|
140
|
+
355462360,
|
|
141
|
+
4144912697,
|
|
142
|
+
1731405415,
|
|
143
|
+
4290775857,
|
|
144
|
+
2394180231,
|
|
145
|
+
1750603025,
|
|
146
|
+
3675008525,
|
|
147
|
+
1694076839,
|
|
148
|
+
1203062813,
|
|
149
|
+
3204075428
|
|
150
|
+
]);
|
|
151
|
+
var SHA512_IV = /* @__PURE__ */ Uint32Array.from([
|
|
152
|
+
1779033703,
|
|
153
|
+
4089235720,
|
|
154
|
+
3144134277,
|
|
155
|
+
2227873595,
|
|
156
|
+
1013904242,
|
|
157
|
+
4271175723,
|
|
158
|
+
2773480762,
|
|
159
|
+
1595750129,
|
|
160
|
+
1359893119,
|
|
161
|
+
2917565137,
|
|
162
|
+
2600822924,
|
|
163
|
+
725511199,
|
|
164
|
+
528734635,
|
|
165
|
+
4215389547,
|
|
166
|
+
1541459225,
|
|
167
|
+
327033209
|
|
168
|
+
]);
|
|
169
|
+
|
|
170
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
|
|
171
|
+
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
172
|
+
var _32n = /* @__PURE__ */ BigInt(32);
|
|
173
|
+
function fromBig(n, le = false) {
|
|
174
|
+
if (le)
|
|
175
|
+
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
176
|
+
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
177
|
+
}
|
|
178
|
+
function split(lst, le = false) {
|
|
179
|
+
const len = lst.length;
|
|
180
|
+
let Ah = new Uint32Array(len);
|
|
181
|
+
let Al = new Uint32Array(len);
|
|
182
|
+
for (let i = 0; i < len; i++) {
|
|
183
|
+
const { h, l } = fromBig(lst[i], le);
|
|
184
|
+
[Ah[i], Al[i]] = [h, l];
|
|
185
|
+
}
|
|
186
|
+
return [Ah, Al];
|
|
187
|
+
}
|
|
188
|
+
var shrSH = (h, _l, s) => h >>> s;
|
|
189
|
+
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
190
|
+
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
191
|
+
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
192
|
+
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
193
|
+
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
194
|
+
function add(Ah, Al, Bh, Bl) {
|
|
195
|
+
const l = (Al >>> 0) + (Bl >>> 0);
|
|
196
|
+
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
197
|
+
}
|
|
198
|
+
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
199
|
+
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
200
|
+
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
201
|
+
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
202
|
+
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
203
|
+
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
204
|
+
|
|
205
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
|
|
206
|
+
var SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
207
|
+
1116352408,
|
|
208
|
+
1899447441,
|
|
209
|
+
3049323471,
|
|
210
|
+
3921009573,
|
|
211
|
+
961987163,
|
|
212
|
+
1508970993,
|
|
213
|
+
2453635748,
|
|
214
|
+
2870763221,
|
|
215
|
+
3624381080,
|
|
216
|
+
310598401,
|
|
217
|
+
607225278,
|
|
218
|
+
1426881987,
|
|
219
|
+
1925078388,
|
|
220
|
+
2162078206,
|
|
221
|
+
2614888103,
|
|
222
|
+
3248222580,
|
|
223
|
+
3835390401,
|
|
224
|
+
4022224774,
|
|
225
|
+
264347078,
|
|
226
|
+
604807628,
|
|
227
|
+
770255983,
|
|
228
|
+
1249150122,
|
|
229
|
+
1555081692,
|
|
230
|
+
1996064986,
|
|
231
|
+
2554220882,
|
|
232
|
+
2821834349,
|
|
233
|
+
2952996808,
|
|
234
|
+
3210313671,
|
|
235
|
+
3336571891,
|
|
236
|
+
3584528711,
|
|
237
|
+
113926993,
|
|
238
|
+
338241895,
|
|
239
|
+
666307205,
|
|
240
|
+
773529912,
|
|
241
|
+
1294757372,
|
|
242
|
+
1396182291,
|
|
243
|
+
1695183700,
|
|
244
|
+
1986661051,
|
|
245
|
+
2177026350,
|
|
246
|
+
2456956037,
|
|
247
|
+
2730485921,
|
|
248
|
+
2820302411,
|
|
249
|
+
3259730800,
|
|
250
|
+
3345764771,
|
|
251
|
+
3516065817,
|
|
252
|
+
3600352804,
|
|
253
|
+
4094571909,
|
|
254
|
+
275423344,
|
|
255
|
+
430227734,
|
|
256
|
+
506948616,
|
|
257
|
+
659060556,
|
|
258
|
+
883997877,
|
|
259
|
+
958139571,
|
|
260
|
+
1322822218,
|
|
261
|
+
1537002063,
|
|
262
|
+
1747873779,
|
|
263
|
+
1955562222,
|
|
264
|
+
2024104815,
|
|
265
|
+
2227730452,
|
|
266
|
+
2361852424,
|
|
267
|
+
2428436474,
|
|
268
|
+
2756734187,
|
|
269
|
+
3204031479,
|
|
270
|
+
3329325298
|
|
271
|
+
]);
|
|
272
|
+
var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
273
|
+
var SHA256 = class extends HashMD {
|
|
274
|
+
constructor(outputLen = 32) {
|
|
275
|
+
super(64, outputLen, 8, false);
|
|
276
|
+
this.A = SHA256_IV[0] | 0;
|
|
277
|
+
this.B = SHA256_IV[1] | 0;
|
|
278
|
+
this.C = SHA256_IV[2] | 0;
|
|
279
|
+
this.D = SHA256_IV[3] | 0;
|
|
280
|
+
this.E = SHA256_IV[4] | 0;
|
|
281
|
+
this.F = SHA256_IV[5] | 0;
|
|
282
|
+
this.G = SHA256_IV[6] | 0;
|
|
283
|
+
this.H = SHA256_IV[7] | 0;
|
|
284
|
+
}
|
|
285
|
+
get() {
|
|
286
|
+
const { A, B, C, D, E, F, G, H } = this;
|
|
287
|
+
return [A, B, C, D, E, F, G, H];
|
|
288
|
+
}
|
|
289
|
+
// prettier-ignore
|
|
290
|
+
set(A, B, C, D, E, F, G, H) {
|
|
291
|
+
this.A = A | 0;
|
|
292
|
+
this.B = B | 0;
|
|
293
|
+
this.C = C | 0;
|
|
294
|
+
this.D = D | 0;
|
|
295
|
+
this.E = E | 0;
|
|
296
|
+
this.F = F | 0;
|
|
297
|
+
this.G = G | 0;
|
|
298
|
+
this.H = H | 0;
|
|
299
|
+
}
|
|
300
|
+
process(view, offset) {
|
|
301
|
+
for (let i = 0; i < 16; i++, offset += 4)
|
|
302
|
+
SHA256_W[i] = view.getUint32(offset, false);
|
|
303
|
+
for (let i = 16; i < 64; i++) {
|
|
304
|
+
const W15 = SHA256_W[i - 15];
|
|
305
|
+
const W2 = SHA256_W[i - 2];
|
|
306
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
307
|
+
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
308
|
+
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
309
|
+
}
|
|
310
|
+
let { A, B, C, D, E, F, G, H } = this;
|
|
311
|
+
for (let i = 0; i < 64; i++) {
|
|
312
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
313
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
314
|
+
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
|
315
|
+
const T2 = sigma0 + Maj(A, B, C) | 0;
|
|
316
|
+
H = G;
|
|
317
|
+
G = F;
|
|
318
|
+
F = E;
|
|
319
|
+
E = D + T1 | 0;
|
|
320
|
+
D = C;
|
|
321
|
+
C = B;
|
|
322
|
+
B = A;
|
|
323
|
+
A = T1 + T2 | 0;
|
|
324
|
+
}
|
|
325
|
+
A = A + this.A | 0;
|
|
326
|
+
B = B + this.B | 0;
|
|
327
|
+
C = C + this.C | 0;
|
|
328
|
+
D = D + this.D | 0;
|
|
329
|
+
E = E + this.E | 0;
|
|
330
|
+
F = F + this.F | 0;
|
|
331
|
+
G = G + this.G | 0;
|
|
332
|
+
H = H + this.H | 0;
|
|
333
|
+
this.set(A, B, C, D, E, F, G, H);
|
|
334
|
+
}
|
|
335
|
+
roundClean() {
|
|
336
|
+
clean(SHA256_W);
|
|
337
|
+
}
|
|
338
|
+
destroy() {
|
|
339
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
340
|
+
clean(this.buffer);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
var K512 = /* @__PURE__ */ (() => split([
|
|
344
|
+
"0x428a2f98d728ae22",
|
|
345
|
+
"0x7137449123ef65cd",
|
|
346
|
+
"0xb5c0fbcfec4d3b2f",
|
|
347
|
+
"0xe9b5dba58189dbbc",
|
|
348
|
+
"0x3956c25bf348b538",
|
|
349
|
+
"0x59f111f1b605d019",
|
|
350
|
+
"0x923f82a4af194f9b",
|
|
351
|
+
"0xab1c5ed5da6d8118",
|
|
352
|
+
"0xd807aa98a3030242",
|
|
353
|
+
"0x12835b0145706fbe",
|
|
354
|
+
"0x243185be4ee4b28c",
|
|
355
|
+
"0x550c7dc3d5ffb4e2",
|
|
356
|
+
"0x72be5d74f27b896f",
|
|
357
|
+
"0x80deb1fe3b1696b1",
|
|
358
|
+
"0x9bdc06a725c71235",
|
|
359
|
+
"0xc19bf174cf692694",
|
|
360
|
+
"0xe49b69c19ef14ad2",
|
|
361
|
+
"0xefbe4786384f25e3",
|
|
362
|
+
"0x0fc19dc68b8cd5b5",
|
|
363
|
+
"0x240ca1cc77ac9c65",
|
|
364
|
+
"0x2de92c6f592b0275",
|
|
365
|
+
"0x4a7484aa6ea6e483",
|
|
366
|
+
"0x5cb0a9dcbd41fbd4",
|
|
367
|
+
"0x76f988da831153b5",
|
|
368
|
+
"0x983e5152ee66dfab",
|
|
369
|
+
"0xa831c66d2db43210",
|
|
370
|
+
"0xb00327c898fb213f",
|
|
371
|
+
"0xbf597fc7beef0ee4",
|
|
372
|
+
"0xc6e00bf33da88fc2",
|
|
373
|
+
"0xd5a79147930aa725",
|
|
374
|
+
"0x06ca6351e003826f",
|
|
375
|
+
"0x142929670a0e6e70",
|
|
376
|
+
"0x27b70a8546d22ffc",
|
|
377
|
+
"0x2e1b21385c26c926",
|
|
378
|
+
"0x4d2c6dfc5ac42aed",
|
|
379
|
+
"0x53380d139d95b3df",
|
|
380
|
+
"0x650a73548baf63de",
|
|
381
|
+
"0x766a0abb3c77b2a8",
|
|
382
|
+
"0x81c2c92e47edaee6",
|
|
383
|
+
"0x92722c851482353b",
|
|
384
|
+
"0xa2bfe8a14cf10364",
|
|
385
|
+
"0xa81a664bbc423001",
|
|
386
|
+
"0xc24b8b70d0f89791",
|
|
387
|
+
"0xc76c51a30654be30",
|
|
388
|
+
"0xd192e819d6ef5218",
|
|
389
|
+
"0xd69906245565a910",
|
|
390
|
+
"0xf40e35855771202a",
|
|
391
|
+
"0x106aa07032bbd1b8",
|
|
392
|
+
"0x19a4c116b8d2d0c8",
|
|
393
|
+
"0x1e376c085141ab53",
|
|
394
|
+
"0x2748774cdf8eeb99",
|
|
395
|
+
"0x34b0bcb5e19b48a8",
|
|
396
|
+
"0x391c0cb3c5c95a63",
|
|
397
|
+
"0x4ed8aa4ae3418acb",
|
|
398
|
+
"0x5b9cca4f7763e373",
|
|
399
|
+
"0x682e6ff3d6b2b8a3",
|
|
400
|
+
"0x748f82ee5defb2fc",
|
|
401
|
+
"0x78a5636f43172f60",
|
|
402
|
+
"0x84c87814a1f0ab72",
|
|
403
|
+
"0x8cc702081a6439ec",
|
|
404
|
+
"0x90befffa23631e28",
|
|
405
|
+
"0xa4506cebde82bde9",
|
|
406
|
+
"0xbef9a3f7b2c67915",
|
|
407
|
+
"0xc67178f2e372532b",
|
|
408
|
+
"0xca273eceea26619c",
|
|
409
|
+
"0xd186b8c721c0c207",
|
|
410
|
+
"0xeada7dd6cde0eb1e",
|
|
411
|
+
"0xf57d4f7fee6ed178",
|
|
412
|
+
"0x06f067aa72176fba",
|
|
413
|
+
"0x0a637dc5a2c898a6",
|
|
414
|
+
"0x113f9804bef90dae",
|
|
415
|
+
"0x1b710b35131c471b",
|
|
416
|
+
"0x28db77f523047d84",
|
|
417
|
+
"0x32caab7b40c72493",
|
|
418
|
+
"0x3c9ebe0a15c9bebc",
|
|
419
|
+
"0x431d67c49c100d4c",
|
|
420
|
+
"0x4cc5d4becb3e42b6",
|
|
421
|
+
"0x597f299cfc657e2a",
|
|
422
|
+
"0x5fcb6fab3ad6faec",
|
|
423
|
+
"0x6c44198c4a475817"
|
|
424
|
+
].map((n) => BigInt(n))))();
|
|
425
|
+
var SHA512_Kh = /* @__PURE__ */ (() => K512[0])();
|
|
426
|
+
var SHA512_Kl = /* @__PURE__ */ (() => K512[1])();
|
|
427
|
+
var SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);
|
|
428
|
+
var SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);
|
|
429
|
+
var SHA512 = class extends HashMD {
|
|
430
|
+
constructor(outputLen = 64) {
|
|
431
|
+
super(128, outputLen, 16, false);
|
|
432
|
+
this.Ah = SHA512_IV[0] | 0;
|
|
433
|
+
this.Al = SHA512_IV[1] | 0;
|
|
434
|
+
this.Bh = SHA512_IV[2] | 0;
|
|
435
|
+
this.Bl = SHA512_IV[3] | 0;
|
|
436
|
+
this.Ch = SHA512_IV[4] | 0;
|
|
437
|
+
this.Cl = SHA512_IV[5] | 0;
|
|
438
|
+
this.Dh = SHA512_IV[6] | 0;
|
|
439
|
+
this.Dl = SHA512_IV[7] | 0;
|
|
440
|
+
this.Eh = SHA512_IV[8] | 0;
|
|
441
|
+
this.El = SHA512_IV[9] | 0;
|
|
442
|
+
this.Fh = SHA512_IV[10] | 0;
|
|
443
|
+
this.Fl = SHA512_IV[11] | 0;
|
|
444
|
+
this.Gh = SHA512_IV[12] | 0;
|
|
445
|
+
this.Gl = SHA512_IV[13] | 0;
|
|
446
|
+
this.Hh = SHA512_IV[14] | 0;
|
|
447
|
+
this.Hl = SHA512_IV[15] | 0;
|
|
448
|
+
}
|
|
449
|
+
// prettier-ignore
|
|
450
|
+
get() {
|
|
451
|
+
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
452
|
+
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
|
|
453
|
+
}
|
|
454
|
+
// prettier-ignore
|
|
455
|
+
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
|
456
|
+
this.Ah = Ah | 0;
|
|
457
|
+
this.Al = Al | 0;
|
|
458
|
+
this.Bh = Bh | 0;
|
|
459
|
+
this.Bl = Bl | 0;
|
|
460
|
+
this.Ch = Ch | 0;
|
|
461
|
+
this.Cl = Cl | 0;
|
|
462
|
+
this.Dh = Dh | 0;
|
|
463
|
+
this.Dl = Dl | 0;
|
|
464
|
+
this.Eh = Eh | 0;
|
|
465
|
+
this.El = El | 0;
|
|
466
|
+
this.Fh = Fh | 0;
|
|
467
|
+
this.Fl = Fl | 0;
|
|
468
|
+
this.Gh = Gh | 0;
|
|
469
|
+
this.Gl = Gl | 0;
|
|
470
|
+
this.Hh = Hh | 0;
|
|
471
|
+
this.Hl = Hl | 0;
|
|
472
|
+
}
|
|
473
|
+
process(view, offset) {
|
|
474
|
+
for (let i = 0; i < 16; i++, offset += 4) {
|
|
475
|
+
SHA512_W_H[i] = view.getUint32(offset);
|
|
476
|
+
SHA512_W_L[i] = view.getUint32(offset += 4);
|
|
477
|
+
}
|
|
478
|
+
for (let i = 16; i < 80; i++) {
|
|
479
|
+
const W15h = SHA512_W_H[i - 15] | 0;
|
|
480
|
+
const W15l = SHA512_W_L[i - 15] | 0;
|
|
481
|
+
const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);
|
|
482
|
+
const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);
|
|
483
|
+
const W2h = SHA512_W_H[i - 2] | 0;
|
|
484
|
+
const W2l = SHA512_W_L[i - 2] | 0;
|
|
485
|
+
const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);
|
|
486
|
+
const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);
|
|
487
|
+
const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
|
488
|
+
const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
|
489
|
+
SHA512_W_H[i] = SUMh | 0;
|
|
490
|
+
SHA512_W_L[i] = SUMl | 0;
|
|
491
|
+
}
|
|
492
|
+
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
493
|
+
for (let i = 0; i < 80; i++) {
|
|
494
|
+
const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);
|
|
495
|
+
const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);
|
|
496
|
+
const CHIh = Eh & Fh ^ ~Eh & Gh;
|
|
497
|
+
const CHIl = El & Fl ^ ~El & Gl;
|
|
498
|
+
const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
|
499
|
+
const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
|
500
|
+
const T1l = T1ll | 0;
|
|
501
|
+
const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);
|
|
502
|
+
const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);
|
|
503
|
+
const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
|
|
504
|
+
const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
|
|
505
|
+
Hh = Gh | 0;
|
|
506
|
+
Hl = Gl | 0;
|
|
507
|
+
Gh = Fh | 0;
|
|
508
|
+
Gl = Fl | 0;
|
|
509
|
+
Fh = Eh | 0;
|
|
510
|
+
Fl = El | 0;
|
|
511
|
+
({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
|
512
|
+
Dh = Ch | 0;
|
|
513
|
+
Dl = Cl | 0;
|
|
514
|
+
Ch = Bh | 0;
|
|
515
|
+
Cl = Bl | 0;
|
|
516
|
+
Bh = Ah | 0;
|
|
517
|
+
Bl = Al | 0;
|
|
518
|
+
const All = add3L(T1l, sigma0l, MAJl);
|
|
519
|
+
Ah = add3H(All, T1h, sigma0h, MAJh);
|
|
520
|
+
Al = All | 0;
|
|
521
|
+
}
|
|
522
|
+
({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
|
523
|
+
({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
|
524
|
+
({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
|
525
|
+
({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
|
526
|
+
({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
|
527
|
+
({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
|
528
|
+
({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
|
529
|
+
({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
|
530
|
+
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
|
531
|
+
}
|
|
532
|
+
roundClean() {
|
|
533
|
+
clean(SHA512_W_H, SHA512_W_L);
|
|
534
|
+
}
|
|
535
|
+
destroy() {
|
|
536
|
+
clean(this.buffer);
|
|
537
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
var SHA384 = class extends SHA512 {
|
|
541
|
+
constructor() {
|
|
542
|
+
super(48);
|
|
543
|
+
this.Ah = SHA384_IV[0] | 0;
|
|
544
|
+
this.Al = SHA384_IV[1] | 0;
|
|
545
|
+
this.Bh = SHA384_IV[2] | 0;
|
|
546
|
+
this.Bl = SHA384_IV[3] | 0;
|
|
547
|
+
this.Ch = SHA384_IV[4] | 0;
|
|
548
|
+
this.Cl = SHA384_IV[5] | 0;
|
|
549
|
+
this.Dh = SHA384_IV[6] | 0;
|
|
550
|
+
this.Dl = SHA384_IV[7] | 0;
|
|
551
|
+
this.Eh = SHA384_IV[8] | 0;
|
|
552
|
+
this.El = SHA384_IV[9] | 0;
|
|
553
|
+
this.Fh = SHA384_IV[10] | 0;
|
|
554
|
+
this.Fl = SHA384_IV[11] | 0;
|
|
555
|
+
this.Gh = SHA384_IV[12] | 0;
|
|
556
|
+
this.Gl = SHA384_IV[13] | 0;
|
|
557
|
+
this.Hh = SHA384_IV[14] | 0;
|
|
558
|
+
this.Hl = SHA384_IV[15] | 0;
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
var T224_IV = /* @__PURE__ */ Uint32Array.from([
|
|
562
|
+
2352822216,
|
|
563
|
+
424955298,
|
|
564
|
+
1944164710,
|
|
565
|
+
2312950998,
|
|
566
|
+
502970286,
|
|
567
|
+
855612546,
|
|
568
|
+
1738396948,
|
|
569
|
+
1479516111,
|
|
570
|
+
258812777,
|
|
571
|
+
2077511080,
|
|
572
|
+
2011393907,
|
|
573
|
+
79989058,
|
|
574
|
+
1067287976,
|
|
575
|
+
1780299464,
|
|
576
|
+
286451373,
|
|
577
|
+
2446758561
|
|
578
|
+
]);
|
|
579
|
+
var T256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
580
|
+
573645204,
|
|
581
|
+
4230739756,
|
|
582
|
+
2673172387,
|
|
583
|
+
3360449730,
|
|
584
|
+
596883563,
|
|
585
|
+
1867755857,
|
|
586
|
+
2520282905,
|
|
587
|
+
1497426621,
|
|
588
|
+
2519219938,
|
|
589
|
+
2827943907,
|
|
590
|
+
3193839141,
|
|
591
|
+
1401305490,
|
|
592
|
+
721525244,
|
|
593
|
+
746961066,
|
|
594
|
+
246885852,
|
|
595
|
+
2177182882
|
|
596
|
+
]);
|
|
597
|
+
var SHA512_224 = class extends SHA512 {
|
|
598
|
+
constructor() {
|
|
599
|
+
super(28);
|
|
600
|
+
this.Ah = T224_IV[0] | 0;
|
|
601
|
+
this.Al = T224_IV[1] | 0;
|
|
602
|
+
this.Bh = T224_IV[2] | 0;
|
|
603
|
+
this.Bl = T224_IV[3] | 0;
|
|
604
|
+
this.Ch = T224_IV[4] | 0;
|
|
605
|
+
this.Cl = T224_IV[5] | 0;
|
|
606
|
+
this.Dh = T224_IV[6] | 0;
|
|
607
|
+
this.Dl = T224_IV[7] | 0;
|
|
608
|
+
this.Eh = T224_IV[8] | 0;
|
|
609
|
+
this.El = T224_IV[9] | 0;
|
|
610
|
+
this.Fh = T224_IV[10] | 0;
|
|
611
|
+
this.Fl = T224_IV[11] | 0;
|
|
612
|
+
this.Gh = T224_IV[12] | 0;
|
|
613
|
+
this.Gl = T224_IV[13] | 0;
|
|
614
|
+
this.Hh = T224_IV[14] | 0;
|
|
615
|
+
this.Hl = T224_IV[15] | 0;
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
var SHA512_256 = class extends SHA512 {
|
|
619
|
+
constructor() {
|
|
620
|
+
super(32);
|
|
621
|
+
this.Ah = T256_IV[0] | 0;
|
|
622
|
+
this.Al = T256_IV[1] | 0;
|
|
623
|
+
this.Bh = T256_IV[2] | 0;
|
|
624
|
+
this.Bl = T256_IV[3] | 0;
|
|
625
|
+
this.Ch = T256_IV[4] | 0;
|
|
626
|
+
this.Cl = T256_IV[5] | 0;
|
|
627
|
+
this.Dh = T256_IV[6] | 0;
|
|
628
|
+
this.Dl = T256_IV[7] | 0;
|
|
629
|
+
this.Eh = T256_IV[8] | 0;
|
|
630
|
+
this.El = T256_IV[9] | 0;
|
|
631
|
+
this.Fh = T256_IV[10] | 0;
|
|
632
|
+
this.Fl = T256_IV[11] | 0;
|
|
633
|
+
this.Gh = T256_IV[12] | 0;
|
|
634
|
+
this.Gl = T256_IV[13] | 0;
|
|
635
|
+
this.Hh = T256_IV[14] | 0;
|
|
636
|
+
this.Hl = T256_IV[15] | 0;
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
640
|
+
var sha512 = /* @__PURE__ */ createHasher(() => new SHA512());
|
|
641
|
+
var sha384 = /* @__PURE__ */ createHasher(() => new SHA384());
|
|
642
|
+
var sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256());
|
|
643
|
+
var sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224());
|
|
644
|
+
|
|
645
|
+
export {
|
|
646
|
+
HashMD,
|
|
647
|
+
SHA512,
|
|
648
|
+
SHA384,
|
|
649
|
+
SHA512_224,
|
|
650
|
+
SHA512_256,
|
|
651
|
+
sha256,
|
|
652
|
+
sha512,
|
|
653
|
+
sha384,
|
|
654
|
+
sha512_256,
|
|
655
|
+
sha512_224
|
|
656
|
+
};
|
|
657
|
+
//# sourceMappingURL=chunk-LR7W2ISE.js.map
|