module-develop-kit 1.4.2 → 1.4.3

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.
Files changed (39) hide show
  1. package/dist/commonjs-virtual-dir/browser.js +5 -2
  2. package/dist/commonjs-virtual-dir/browser2.js +2 -5
  3. package/dist/commonjs-virtual-dir/index.js +3 -5
  4. package/dist/commonjs-virtual-dir/index2.js +7 -2
  5. package/dist/commonjs-virtual-dir/index3.js +3 -2
  6. package/dist/commonjs-virtual-dir/index4.js +2 -4
  7. package/dist/commonjs-virtual-dir/index5.js +4 -0
  8. package/dist/commonjs-virtual-dir/index6.js +4 -0
  9. package/dist/commonjs-virtual-dir/index7.js +4 -0
  10. package/dist/commonjs-virtual-dir/index8.js +4 -0
  11. package/dist/main.d.ts +48 -8
  12. package/dist/main.js +44 -40
  13. package/dist/src/outside-call/utils.js +1 -1
  14. package/dist/src/shield/crypto/const.js +4 -0
  15. package/dist/src/shield/crypto/index.js +53 -0
  16. package/dist/src/shield/crypto/sm2.js +7 -0
  17. package/dist/src/shield/crypto/sm4.js +15 -0
  18. package/dist/src/shield/crypto/util.js +29 -0
  19. package/dist/src/shield/gcm-crypto/axios-adapter.js +20 -20
  20. package/dist/src/shield/gcm-crypto/index.js +11 -11
  21. package/dist/vendor/@tokenizer/inflate/lib/ZipHandler.js +1 -1
  22. package/dist/vendor/base64-js/index.js +52 -0
  23. package/dist/vendor/debug/src/browser.js +1 -1
  24. package/dist/vendor/gm-crypt/index.js +10 -0
  25. package/dist/vendor/gm-crypt/src/crypt.js +60 -0
  26. package/dist/vendor/gm-crypt/src/sm4.js +513 -0
  27. package/dist/vendor/ieee754/index.js +1 -1
  28. package/dist/vendor/jsbn/index.js +714 -0
  29. package/dist/vendor/sdp-transform/lib/index.js +1 -1
  30. package/dist/vendor/sm-crypto/src/index.js +14 -0
  31. package/dist/vendor/sm-crypto/src/sm2/asn1.js +86 -0
  32. package/dist/vendor/sm-crypto/src/sm2/ec.js +205 -0
  33. package/dist/vendor/sm-crypto/src/sm2/index.js +114 -0
  34. package/dist/vendor/sm-crypto/src/sm2/sm3.js +71 -0
  35. package/dist/vendor/sm-crypto/src/sm2/utils.js +95 -0
  36. package/dist/vendor/sm-crypto/src/sm3/index.js +50 -0
  37. package/dist/vendor/sm-crypto/src/sm4/index.js +408 -0
  38. package/dist/vendor/token-types/lib/index.js +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,408 @@
1
+ var S, j;
2
+ function O() {
3
+ if (j) return S;
4
+ j = 1;
5
+ const d = 0, q = 32, a = 16, h = [
6
+ 214,
7
+ 144,
8
+ 233,
9
+ 254,
10
+ 204,
11
+ 225,
12
+ 61,
13
+ 183,
14
+ 22,
15
+ 182,
16
+ 20,
17
+ 194,
18
+ 40,
19
+ 251,
20
+ 44,
21
+ 5,
22
+ 43,
23
+ 103,
24
+ 154,
25
+ 118,
26
+ 42,
27
+ 190,
28
+ 4,
29
+ 195,
30
+ 170,
31
+ 68,
32
+ 19,
33
+ 38,
34
+ 73,
35
+ 134,
36
+ 6,
37
+ 153,
38
+ 156,
39
+ 66,
40
+ 80,
41
+ 244,
42
+ 145,
43
+ 239,
44
+ 152,
45
+ 122,
46
+ 51,
47
+ 84,
48
+ 11,
49
+ 67,
50
+ 237,
51
+ 207,
52
+ 172,
53
+ 98,
54
+ 228,
55
+ 179,
56
+ 28,
57
+ 169,
58
+ 201,
59
+ 8,
60
+ 232,
61
+ 149,
62
+ 128,
63
+ 223,
64
+ 148,
65
+ 250,
66
+ 117,
67
+ 143,
68
+ 63,
69
+ 166,
70
+ 71,
71
+ 7,
72
+ 167,
73
+ 252,
74
+ 243,
75
+ 115,
76
+ 23,
77
+ 186,
78
+ 131,
79
+ 89,
80
+ 60,
81
+ 25,
82
+ 230,
83
+ 133,
84
+ 79,
85
+ 168,
86
+ 104,
87
+ 107,
88
+ 129,
89
+ 178,
90
+ 113,
91
+ 100,
92
+ 218,
93
+ 139,
94
+ 248,
95
+ 235,
96
+ 15,
97
+ 75,
98
+ 112,
99
+ 86,
100
+ 157,
101
+ 53,
102
+ 30,
103
+ 36,
104
+ 14,
105
+ 94,
106
+ 99,
107
+ 88,
108
+ 209,
109
+ 162,
110
+ 37,
111
+ 34,
112
+ 124,
113
+ 59,
114
+ 1,
115
+ 33,
116
+ 120,
117
+ 135,
118
+ 212,
119
+ 0,
120
+ 70,
121
+ 87,
122
+ 159,
123
+ 211,
124
+ 39,
125
+ 82,
126
+ 76,
127
+ 54,
128
+ 2,
129
+ 231,
130
+ 160,
131
+ 196,
132
+ 200,
133
+ 158,
134
+ 234,
135
+ 191,
136
+ 138,
137
+ 210,
138
+ 64,
139
+ 199,
140
+ 56,
141
+ 181,
142
+ 163,
143
+ 247,
144
+ 242,
145
+ 206,
146
+ 249,
147
+ 97,
148
+ 21,
149
+ 161,
150
+ 224,
151
+ 174,
152
+ 93,
153
+ 164,
154
+ 155,
155
+ 52,
156
+ 26,
157
+ 85,
158
+ 173,
159
+ 147,
160
+ 50,
161
+ 48,
162
+ 245,
163
+ 140,
164
+ 177,
165
+ 227,
166
+ 29,
167
+ 246,
168
+ 226,
169
+ 46,
170
+ 130,
171
+ 102,
172
+ 202,
173
+ 96,
174
+ 192,
175
+ 41,
176
+ 35,
177
+ 171,
178
+ 13,
179
+ 83,
180
+ 78,
181
+ 111,
182
+ 213,
183
+ 219,
184
+ 55,
185
+ 69,
186
+ 222,
187
+ 253,
188
+ 142,
189
+ 47,
190
+ 3,
191
+ 255,
192
+ 106,
193
+ 114,
194
+ 109,
195
+ 108,
196
+ 91,
197
+ 81,
198
+ 141,
199
+ 27,
200
+ 175,
201
+ 146,
202
+ 187,
203
+ 221,
204
+ 188,
205
+ 127,
206
+ 17,
207
+ 217,
208
+ 92,
209
+ 65,
210
+ 31,
211
+ 16,
212
+ 90,
213
+ 216,
214
+ 10,
215
+ 193,
216
+ 49,
217
+ 136,
218
+ 165,
219
+ 205,
220
+ 123,
221
+ 189,
222
+ 45,
223
+ 116,
224
+ 208,
225
+ 18,
226
+ 184,
227
+ 229,
228
+ 180,
229
+ 176,
230
+ 137,
231
+ 105,
232
+ 151,
233
+ 74,
234
+ 12,
235
+ 150,
236
+ 119,
237
+ 126,
238
+ 101,
239
+ 185,
240
+ 241,
241
+ 9,
242
+ 197,
243
+ 110,
244
+ 198,
245
+ 132,
246
+ 24,
247
+ 240,
248
+ 125,
249
+ 236,
250
+ 58,
251
+ 220,
252
+ 77,
253
+ 32,
254
+ 121,
255
+ 238,
256
+ 95,
257
+ 62,
258
+ 215,
259
+ 203,
260
+ 57,
261
+ 72
262
+ ], p = [
263
+ 462357,
264
+ 472066609,
265
+ 943670861,
266
+ 1415275113,
267
+ 1886879365,
268
+ 2358483617,
269
+ 2830087869,
270
+ 3301692121,
271
+ 3773296373,
272
+ 4228057617,
273
+ 404694573,
274
+ 876298825,
275
+ 1347903077,
276
+ 1819507329,
277
+ 2291111581,
278
+ 2762715833,
279
+ 3234320085,
280
+ 3705924337,
281
+ 4177462797,
282
+ 337322537,
283
+ 808926789,
284
+ 1280531041,
285
+ 1752135293,
286
+ 2223739545,
287
+ 2695343797,
288
+ 3166948049,
289
+ 3638552301,
290
+ 4110090761,
291
+ 269950501,
292
+ 741554753,
293
+ 1213159005,
294
+ 1684763257
295
+ ];
296
+ function m(x) {
297
+ const t = [];
298
+ for (let c = 0, e = x.length; c < e; c += 2)
299
+ t.push(parseInt(x.substr(c, 2), 16));
300
+ return t;
301
+ }
302
+ function D(x) {
303
+ return x.map((t) => (t = t.toString(16), t.length === 1 ? "0" + t : t)).join("");
304
+ }
305
+ function R(x) {
306
+ const t = [];
307
+ for (let c = 0, e = x.length; c < e; c++) {
308
+ const n = x.codePointAt(c);
309
+ if (n <= 127)
310
+ t.push(n);
311
+ else if (n <= 2047)
312
+ t.push(192 | n >>> 6), t.push(128 | n & 63);
313
+ else if (n <= 55295 || n >= 57344 && n <= 65535)
314
+ t.push(224 | n >>> 12), t.push(128 | n >>> 6 & 63), t.push(128 | n & 63);
315
+ else if (n >= 65536 && n <= 1114111)
316
+ c++, t.push(240 | n >>> 18 & 28), t.push(128 | n >>> 12 & 63), t.push(128 | n >>> 6 & 63), t.push(128 | n & 63);
317
+ else
318
+ throw t.push(n), new Error("input is not supported");
319
+ }
320
+ return t;
321
+ }
322
+ function _(x) {
323
+ const t = [];
324
+ for (let c = 0, e = x.length; c < e; c++)
325
+ x[c] >= 240 && x[c] <= 247 ? (t.push(String.fromCodePoint(((x[c] & 7) << 18) + ((x[c + 1] & 63) << 12) + ((x[c + 2] & 63) << 6) + (x[c + 3] & 63))), c += 3) : x[c] >= 224 && x[c] <= 239 ? (t.push(String.fromCodePoint(((x[c] & 15) << 12) + ((x[c + 1] & 63) << 6) + (x[c + 2] & 63))), c += 2) : x[c] >= 192 && x[c] <= 223 ? (t.push(String.fromCodePoint(((x[c] & 31) << 6) + (x[c + 1] & 63))), c++) : t.push(String.fromCodePoint(x[c]));
326
+ return t.join("");
327
+ }
328
+ function u(x, t) {
329
+ const c = t & 31;
330
+ return x << c | x >>> 32 - c;
331
+ }
332
+ function b(x) {
333
+ return (h[x >>> 24 & 255] & 255) << 24 | (h[x >>> 16 & 255] & 255) << 16 | (h[x >>> 8 & 255] & 255) << 8 | h[x & 255] & 255;
334
+ }
335
+ function F(x) {
336
+ return x ^ u(x, 2) ^ u(x, 10) ^ u(x, 18) ^ u(x, 24);
337
+ }
338
+ function w(x) {
339
+ return x ^ u(x, 13) ^ u(x, 23);
340
+ }
341
+ function v(x, t, c) {
342
+ const e = new Array(4), n = new Array(4);
343
+ for (let f = 0; f < 4; f++)
344
+ n[0] = x[4 * f] & 255, n[1] = x[4 * f + 1] & 255, n[2] = x[4 * f + 2] & 255, n[3] = x[4 * f + 3] & 255, e[f] = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3];
345
+ for (let f = 0, s; f < 32; f += 4)
346
+ s = e[1] ^ e[2] ^ e[3] ^ c[f + 0], e[0] ^= F(b(s)), s = e[2] ^ e[3] ^ e[0] ^ c[f + 1], e[1] ^= F(b(s)), s = e[3] ^ e[0] ^ e[1] ^ c[f + 2], e[2] ^= F(b(s)), s = e[0] ^ e[1] ^ e[2] ^ c[f + 3], e[3] ^= F(b(s));
347
+ for (let f = 0; f < 16; f += 4)
348
+ t[f] = e[3 - f / 4] >>> 24 & 255, t[f + 1] = e[3 - f / 4] >>> 16 & 255, t[f + 2] = e[3 - f / 4] >>> 8 & 255, t[f + 3] = e[3 - f / 4] & 255;
349
+ }
350
+ function L(x, t, c) {
351
+ const e = new Array(4), n = new Array(4);
352
+ for (let f = 0; f < 4; f++)
353
+ n[0] = x[0 + 4 * f] & 255, n[1] = x[1 + 4 * f] & 255, n[2] = x[2 + 4 * f] & 255, n[3] = x[3 + 4 * f] & 255, e[f] = n[0] << 24 | n[1] << 16 | n[2] << 8 | n[3];
354
+ e[0] ^= 2746333894, e[1] ^= 1453994832, e[2] ^= 1736282519, e[3] ^= 2993693404;
355
+ for (let f = 0, s; f < 32; f += 4)
356
+ s = e[1] ^ e[2] ^ e[3] ^ p[f + 0], t[f + 0] = e[0] ^= w(b(s)), s = e[2] ^ e[3] ^ e[0] ^ p[f + 1], t[f + 1] = e[1] ^= w(b(s)), s = e[3] ^ e[0] ^ e[1] ^ p[f + 2], t[f + 2] = e[2] ^= w(b(s)), s = e[0] ^ e[1] ^ e[2] ^ p[f + 3], t[f + 3] = e[3] ^= w(b(s));
357
+ if (c === d)
358
+ for (let f = 0, s; f < 16; f++)
359
+ s = t[f], t[f] = t[31 - f], t[31 - f] = s;
360
+ }
361
+ function E(x, t, c, {
362
+ padding: e = "pkcs#7",
363
+ mode: n,
364
+ iv: f = [],
365
+ output: s = "string"
366
+ } = {}) {
367
+ if (n === "cbc" && (typeof f == "string" && (f = m(f)), f.length !== 128 / 8))
368
+ throw new Error("iv is invalid");
369
+ if (typeof t == "string" && (t = m(t)), t.length !== 128 / 8)
370
+ throw new Error("key is invalid");
371
+ if (typeof x == "string" ? c !== d ? x = R(x) : x = m(x) : x = [...x], (e === "pkcs#5" || e === "pkcs#7") && c !== d) {
372
+ const r = a - x.length % a;
373
+ for (let i = 0; i < r; i++) x.push(r);
374
+ }
375
+ const P = new Array(q);
376
+ L(t, P, c);
377
+ const l = [];
378
+ let g = f, T = x.length, C = 0;
379
+ for (; T >= a; ) {
380
+ const r = x.slice(C, C + 16), i = new Array(16);
381
+ if (n === "cbc")
382
+ for (let o = 0; o < a; o++)
383
+ c !== d && (r[o] ^= g[o]);
384
+ v(r, i, P);
385
+ for (let o = 0; o < a; o++)
386
+ n === "cbc" && c === d && (i[o] ^= g[o]), l[C + o] = i[o];
387
+ n === "cbc" && (c !== d ? g = i : g = r), T -= a, C += a;
388
+ }
389
+ if ((e === "pkcs#5" || e === "pkcs#7") && c === d) {
390
+ const r = l.length, i = l[r - 1];
391
+ for (let o = 1; o <= i; o++)
392
+ if (l[r - o] !== i) throw new Error("padding is invalid");
393
+ l.splice(r - i, i);
394
+ }
395
+ return s !== "array" ? c !== d ? D(l) : _(l) : l;
396
+ }
397
+ return S = {
398
+ encrypt(x, t, c) {
399
+ return E(x, t, 1, c);
400
+ },
401
+ decrypt(x, t, c) {
402
+ return E(x, t, 0, c);
403
+ }
404
+ }, S;
405
+ }
406
+ export {
407
+ O as __require
408
+ };
@@ -1,4 +1,4 @@
1
- import "../../../commonjs-virtual-dir/index2.js";
1
+ import "../../../commonjs-virtual-dir/index4.js";
2
2
  import { textDecode as i } from "../../@borewit/text-codec/lib/index.js";
3
3
  function r(e) {
4
4
  return new DataView(e.buffer, e.byteOffset);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "module-develop-kit",
3
3
  "author": "Front-End team",
4
- "version": "1.4.2",
4
+ "version": "1.4.3",
5
5
  "type": "module",
6
6
  "description": "前端项目通用工具包",
7
7
  "module": "dist/main.js",