yc-project-template 1.0.0
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/README.md +48 -0
- package/dist/AppManage-yJ4SOsDj.js +77 -0
- package/dist/DeptTree-BJ-YyoZO.js +88 -0
- package/dist/DictionaryModal-jyoOTJD4.js +157 -0
- package/dist/DictionaryValueModal-D6wJ04-c.js +173 -0
- package/dist/Login-CorWfiLZ.js +169 -0
- package/dist/NotFound-B_crl8rg.js +21 -0
- package/dist/OrgModal-DgTQN71P.js +114 -0
- package/dist/PageTemplate-BXwP32sO.js +149 -0
- package/dist/RoleModal-QaUkdPyy.js +126 -0
- package/dist/UserModal-MQeOVpvt.js +200 -0
- package/dist/YcSearchForm-BWweEnqG.js +326 -0
- package/dist/YcTree-COox_XNx.js +124 -0
- package/dist/el-col-B8XtMrKy.js +135 -0
- package/dist/el-dropdown-item-zXcF1C0U.js +862 -0
- package/dist/el-form-item-DGYKf4A6.js +1178 -0
- package/dist/favicon.ico +0 -0
- package/dist/globalComponents-NGC1jMmM.js +112761 -0
- package/dist/index-CMXoxgLU.js +1062 -0
- package/dist/index-Cc-Qq-qP.js +17 -0
- package/dist/index-DBq96lnF.js +393 -0
- package/dist/index-zZ1bb-CY.js +278 -0
- package/dist/rsaCrypto-B9Iz2FB1.js +2084 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/useMenu-CCb03now.js +18 -0
- package/dist/yc-project-template.css +1 -0
- package/dist/yc-project-template.es.js +5 -0
- package/dist/yc-project-template.umd.js +746 -0
- package/package.json +123 -0
|
@@ -0,0 +1,2084 @@
|
|
|
1
|
+
var Ot = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
2
|
+
function O(r) {
|
|
3
|
+
return Ot.charAt(r);
|
|
4
|
+
}
|
|
5
|
+
function Vt(r, t) {
|
|
6
|
+
return r & t;
|
|
7
|
+
}
|
|
8
|
+
function Q(r, t) {
|
|
9
|
+
return r | t;
|
|
10
|
+
}
|
|
11
|
+
function pt(r, t) {
|
|
12
|
+
return r ^ t;
|
|
13
|
+
}
|
|
14
|
+
function vt(r, t) {
|
|
15
|
+
return r & ~t;
|
|
16
|
+
}
|
|
17
|
+
function Nt(r) {
|
|
18
|
+
if (r == 0)
|
|
19
|
+
return -1;
|
|
20
|
+
var t = 0;
|
|
21
|
+
return (r & 65535) == 0 && (r >>= 16, t += 16), (r & 255) == 0 && (r >>= 8, t += 8), (r & 15) == 0 && (r >>= 4, t += 4), (r & 3) == 0 && (r >>= 2, t += 2), (r & 1) == 0 && ++t, t;
|
|
22
|
+
}
|
|
23
|
+
function Pt(r) {
|
|
24
|
+
for (var t = 0; r != 0; )
|
|
25
|
+
r &= r - 1, ++t;
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
var K = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", xt = "=";
|
|
29
|
+
function Z(r) {
|
|
30
|
+
var t, e, i = "";
|
|
31
|
+
for (t = 0; t + 3 <= r.length; t += 3)
|
|
32
|
+
e = parseInt(r.substring(t, t + 3), 16), i += K.charAt(e >> 6) + K.charAt(e & 63);
|
|
33
|
+
for (t + 1 == r.length ? (e = parseInt(r.substring(t, t + 1), 16), i += K.charAt(e << 2)) : t + 2 == r.length && (e = parseInt(r.substring(t, t + 2), 16), i += K.charAt(e >> 2) + K.charAt((e & 3) << 4)); (i.length & 3) > 0; )
|
|
34
|
+
i += xt;
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
function gt(r) {
|
|
38
|
+
var t = "", e, i = 0, n = 0;
|
|
39
|
+
for (e = 0; e < r.length && r.charAt(e) != xt; ++e) {
|
|
40
|
+
var s = K.indexOf(r.charAt(e));
|
|
41
|
+
s < 0 || (i == 0 ? (t += O(s >> 2), n = s & 3, i = 1) : i == 1 ? (t += O(n << 2 | s >> 4), n = s & 15, i = 2) : i == 2 ? (t += O(n), t += O(s >> 2), n = s & 3, i = 3) : (t += O(n << 2 | s >> 4), t += O(s & 15), i = 0));
|
|
42
|
+
}
|
|
43
|
+
return i == 1 && (t += O(n << 2)), t;
|
|
44
|
+
}
|
|
45
|
+
var H, Ct = {
|
|
46
|
+
decode: function(r) {
|
|
47
|
+
var t;
|
|
48
|
+
if (H === void 0) {
|
|
49
|
+
var e = "0123456789ABCDEF", i = ` \f
|
|
50
|
+
\r \u2028\u2029`;
|
|
51
|
+
for (H = {}, t = 0; t < 16; ++t)
|
|
52
|
+
H[e.charAt(t)] = t;
|
|
53
|
+
for (e = e.toLowerCase(), t = 10; t < 16; ++t)
|
|
54
|
+
H[e.charAt(t)] = t;
|
|
55
|
+
for (t = 0; t < i.length; ++t)
|
|
56
|
+
H[i.charAt(t)] = -1;
|
|
57
|
+
}
|
|
58
|
+
var n = [], s = 0, o = 0;
|
|
59
|
+
for (t = 0; t < r.length; ++t) {
|
|
60
|
+
var h = r.charAt(t);
|
|
61
|
+
if (h == "=")
|
|
62
|
+
break;
|
|
63
|
+
if (h = H[h], h != -1) {
|
|
64
|
+
if (h === void 0)
|
|
65
|
+
throw new Error("Illegal character at offset " + t);
|
|
66
|
+
s |= h, ++o >= 2 ? (n[n.length] = s, s = 0, o = 0) : s <<= 4;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (o)
|
|
70
|
+
throw new Error("Hex encoding incomplete: 4 bits missing");
|
|
71
|
+
return n;
|
|
72
|
+
}
|
|
73
|
+
}, _, at = {
|
|
74
|
+
decode: function(r) {
|
|
75
|
+
var t;
|
|
76
|
+
if (_ === void 0) {
|
|
77
|
+
var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = `= \f
|
|
78
|
+
\r \u2028\u2029`;
|
|
79
|
+
for (_ = /* @__PURE__ */ Object.create(null), t = 0; t < 64; ++t)
|
|
80
|
+
_[e.charAt(t)] = t;
|
|
81
|
+
for (_["-"] = 62, _._ = 63, t = 0; t < i.length; ++t)
|
|
82
|
+
_[i.charAt(t)] = -1;
|
|
83
|
+
}
|
|
84
|
+
var n = [], s = 0, o = 0;
|
|
85
|
+
for (t = 0; t < r.length; ++t) {
|
|
86
|
+
var h = r.charAt(t);
|
|
87
|
+
if (h == "=")
|
|
88
|
+
break;
|
|
89
|
+
if (h = _[h], h != -1) {
|
|
90
|
+
if (h === void 0)
|
|
91
|
+
throw new Error("Illegal character at offset " + t);
|
|
92
|
+
s |= h, ++o >= 4 ? (n[n.length] = s >> 16, n[n.length] = s >> 8 & 255, n[n.length] = s & 255, s = 0, o = 0) : s <<= 6;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
switch (o) {
|
|
96
|
+
case 1:
|
|
97
|
+
throw new Error("Base64 encoding incomplete: at least 2 bits missing");
|
|
98
|
+
case 2:
|
|
99
|
+
n[n.length] = s >> 10;
|
|
100
|
+
break;
|
|
101
|
+
case 3:
|
|
102
|
+
n[n.length] = s >> 16, n[n.length] = s >> 8 & 255;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
return n;
|
|
106
|
+
},
|
|
107
|
+
re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
|
|
108
|
+
unarmor: function(r) {
|
|
109
|
+
var t = at.re.exec(r);
|
|
110
|
+
if (t)
|
|
111
|
+
if (t[1])
|
|
112
|
+
r = t[1];
|
|
113
|
+
else if (t[2])
|
|
114
|
+
r = t[2];
|
|
115
|
+
else
|
|
116
|
+
throw new Error("RegExp out of sync");
|
|
117
|
+
return at.decode(r);
|
|
118
|
+
}
|
|
119
|
+
}, F = 1e13, G = (
|
|
120
|
+
/** @class */
|
|
121
|
+
(function() {
|
|
122
|
+
function r(t) {
|
|
123
|
+
this.buf = [+t || 0];
|
|
124
|
+
}
|
|
125
|
+
return r.prototype.mulAdd = function(t, e) {
|
|
126
|
+
var i = this.buf, n = i.length, s, o;
|
|
127
|
+
for (s = 0; s < n; ++s)
|
|
128
|
+
o = i[s] * t + e, o < F ? e = 0 : (e = 0 | o / F, o -= e * F), i[s] = o;
|
|
129
|
+
e > 0 && (i[s] = e);
|
|
130
|
+
}, r.prototype.sub = function(t) {
|
|
131
|
+
var e = this.buf, i = e.length, n, s;
|
|
132
|
+
for (n = 0; n < i; ++n)
|
|
133
|
+
s = e[n] - t, s < 0 ? (s += F, t = 1) : t = 0, e[n] = s;
|
|
134
|
+
for (; e[e.length - 1] === 0; )
|
|
135
|
+
e.pop();
|
|
136
|
+
}, r.prototype.toString = function(t) {
|
|
137
|
+
if ((t || 10) != 10)
|
|
138
|
+
throw new Error("only base 10 is supported");
|
|
139
|
+
for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n)
|
|
140
|
+
i += (F + e[n]).toString().substring(1);
|
|
141
|
+
return i;
|
|
142
|
+
}, r.prototype.valueOf = function() {
|
|
143
|
+
for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i)
|
|
144
|
+
e = e * F + t[i];
|
|
145
|
+
return e;
|
|
146
|
+
}, r.prototype.simplify = function() {
|
|
147
|
+
var t = this.buf;
|
|
148
|
+
return t.length == 1 ? t[0] : this;
|
|
149
|
+
}, r;
|
|
150
|
+
})()
|
|
151
|
+
), Rt = "…", _t = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, Mt = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
|
|
152
|
+
function L(r, t) {
|
|
153
|
+
return r.length > t && (r = r.substring(0, t) + Rt), r;
|
|
154
|
+
}
|
|
155
|
+
var ot = (
|
|
156
|
+
/** @class */
|
|
157
|
+
(function() {
|
|
158
|
+
function r(t, e) {
|
|
159
|
+
this.hexDigits = "0123456789ABCDEF", t instanceof r ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = e);
|
|
160
|
+
}
|
|
161
|
+
return r.prototype.get = function(t) {
|
|
162
|
+
if (t === void 0 && (t = this.pos++), t >= this.enc.length)
|
|
163
|
+
throw new Error("Requesting byte offset ".concat(t, " on a stream of length ").concat(this.enc.length));
|
|
164
|
+
return typeof this.enc == "string" ? this.enc.charCodeAt(t) : this.enc[t];
|
|
165
|
+
}, r.prototype.hexByte = function(t) {
|
|
166
|
+
return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(t & 15);
|
|
167
|
+
}, r.prototype.hexDump = function(t, e, i) {
|
|
168
|
+
for (var n = "", s = t; s < e; ++s)
|
|
169
|
+
if (n += this.hexByte(this.get(s)), i !== !0)
|
|
170
|
+
switch (s & 15) {
|
|
171
|
+
case 7:
|
|
172
|
+
n += " ";
|
|
173
|
+
break;
|
|
174
|
+
case 15:
|
|
175
|
+
n += `
|
|
176
|
+
`;
|
|
177
|
+
break;
|
|
178
|
+
default:
|
|
179
|
+
n += " ";
|
|
180
|
+
}
|
|
181
|
+
return n;
|
|
182
|
+
}, r.prototype.isASCII = function(t, e) {
|
|
183
|
+
for (var i = t; i < e; ++i) {
|
|
184
|
+
var n = this.get(i);
|
|
185
|
+
if (n < 32 || n > 176)
|
|
186
|
+
return !1;
|
|
187
|
+
}
|
|
188
|
+
return !0;
|
|
189
|
+
}, r.prototype.parseStringISO = function(t, e) {
|
|
190
|
+
for (var i = "", n = t; n < e; ++n)
|
|
191
|
+
i += String.fromCharCode(this.get(n));
|
|
192
|
+
return i;
|
|
193
|
+
}, r.prototype.parseStringUTF = function(t, e) {
|
|
194
|
+
for (var i = "", n = t; n < e; ) {
|
|
195
|
+
var s = this.get(n++);
|
|
196
|
+
s < 128 ? i += String.fromCharCode(s) : s > 191 && s < 224 ? i += String.fromCharCode((s & 31) << 6 | this.get(n++) & 63) : i += String.fromCharCode((s & 15) << 12 | (this.get(n++) & 63) << 6 | this.get(n++) & 63);
|
|
197
|
+
}
|
|
198
|
+
return i;
|
|
199
|
+
}, r.prototype.parseStringBMP = function(t, e) {
|
|
200
|
+
for (var i = "", n, s, o = t; o < e; )
|
|
201
|
+
n = this.get(o++), s = this.get(o++), i += String.fromCharCode(n << 8 | s);
|
|
202
|
+
return i;
|
|
203
|
+
}, r.prototype.parseTime = function(t, e, i) {
|
|
204
|
+
var n = this.parseStringISO(t, e), s = (i ? _t : Mt).exec(n);
|
|
205
|
+
return s ? (i && (s[1] = +s[1], s[1] += +s[1] < 70 ? 2e3 : 1900), n = s[1] + "-" + s[2] + "-" + s[3] + " " + s[4], s[5] && (n += ":" + s[5], s[6] && (n += ":" + s[6], s[7] && (n += "." + s[7]))), s[8] && (n += " UTC", s[8] != "Z" && (n += s[8], s[9] && (n += ":" + s[9]))), n) : "Unrecognized time: " + n;
|
|
206
|
+
}, r.prototype.parseInteger = function(t, e) {
|
|
207
|
+
for (var i = this.get(t), n = i > 127, s = n ? 255 : 0, o, h = ""; i == s && ++t < e; )
|
|
208
|
+
i = this.get(t);
|
|
209
|
+
if (o = e - t, o === 0)
|
|
210
|
+
return n ? -1 : 0;
|
|
211
|
+
if (o > 4) {
|
|
212
|
+
for (h = i, o <<= 3; ((+h ^ s) & 128) == 0; )
|
|
213
|
+
h = +h << 1, --o;
|
|
214
|
+
h = "(" + o + ` bit)
|
|
215
|
+
`;
|
|
216
|
+
}
|
|
217
|
+
n && (i = i - 256);
|
|
218
|
+
for (var f = new G(i), u = t + 1; u < e; ++u)
|
|
219
|
+
f.mulAdd(256, this.get(u));
|
|
220
|
+
return h + f.toString();
|
|
221
|
+
}, r.prototype.parseBitString = function(t, e, i) {
|
|
222
|
+
for (var n = this.get(t), s = (e - t - 1 << 3) - n, o = "(" + s + ` bit)
|
|
223
|
+
`, h = "", f = t + 1; f < e; ++f) {
|
|
224
|
+
for (var u = this.get(f), l = f == e - 1 ? n : 0, c = 7; c >= l; --c)
|
|
225
|
+
h += u >> c & 1 ? "1" : "0";
|
|
226
|
+
if (h.length > i)
|
|
227
|
+
return o + L(h, i);
|
|
228
|
+
}
|
|
229
|
+
return o + h;
|
|
230
|
+
}, r.prototype.parseOctetString = function(t, e, i) {
|
|
231
|
+
if (this.isASCII(t, e))
|
|
232
|
+
return L(this.parseStringISO(t, e), i);
|
|
233
|
+
var n = e - t, s = "(" + n + ` byte)
|
|
234
|
+
`;
|
|
235
|
+
i /= 2, n > i && (e = t + i);
|
|
236
|
+
for (var o = t; o < e; ++o)
|
|
237
|
+
s += this.hexByte(this.get(o));
|
|
238
|
+
return n > i && (s += Rt), s;
|
|
239
|
+
}, r.prototype.parseOID = function(t, e, i) {
|
|
240
|
+
for (var n = "", s = new G(), o = 0, h = t; h < e; ++h) {
|
|
241
|
+
var f = this.get(h);
|
|
242
|
+
if (s.mulAdd(128, f & 127), o += 7, !(f & 128)) {
|
|
243
|
+
if (n === "")
|
|
244
|
+
if (s = s.simplify(), s instanceof G)
|
|
245
|
+
s.sub(80), n = "2." + s.toString();
|
|
246
|
+
else {
|
|
247
|
+
var u = s < 80 ? s < 40 ? 0 : 1 : 2;
|
|
248
|
+
n = u + "." + (s - u * 40);
|
|
249
|
+
}
|
|
250
|
+
else
|
|
251
|
+
n += "." + s.toString();
|
|
252
|
+
if (n.length > i)
|
|
253
|
+
return L(n, i);
|
|
254
|
+
s = new G(), o = 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return o > 0 && (n += ".incomplete"), n;
|
|
258
|
+
}, r;
|
|
259
|
+
})()
|
|
260
|
+
), qt = (
|
|
261
|
+
/** @class */
|
|
262
|
+
(function() {
|
|
263
|
+
function r(t, e, i, n, s) {
|
|
264
|
+
if (!(n instanceof dt))
|
|
265
|
+
throw new Error("Invalid tag value.");
|
|
266
|
+
this.stream = t, this.header = e, this.length = i, this.tag = n, this.sub = s;
|
|
267
|
+
}
|
|
268
|
+
return r.prototype.typeName = function() {
|
|
269
|
+
switch (this.tag.tagClass) {
|
|
270
|
+
case 0:
|
|
271
|
+
switch (this.tag.tagNumber) {
|
|
272
|
+
case 0:
|
|
273
|
+
return "EOC";
|
|
274
|
+
case 1:
|
|
275
|
+
return "BOOLEAN";
|
|
276
|
+
case 2:
|
|
277
|
+
return "INTEGER";
|
|
278
|
+
case 3:
|
|
279
|
+
return "BIT_STRING";
|
|
280
|
+
case 4:
|
|
281
|
+
return "OCTET_STRING";
|
|
282
|
+
case 5:
|
|
283
|
+
return "NULL";
|
|
284
|
+
case 6:
|
|
285
|
+
return "OBJECT_IDENTIFIER";
|
|
286
|
+
case 7:
|
|
287
|
+
return "ObjectDescriptor";
|
|
288
|
+
case 8:
|
|
289
|
+
return "EXTERNAL";
|
|
290
|
+
case 9:
|
|
291
|
+
return "REAL";
|
|
292
|
+
case 10:
|
|
293
|
+
return "ENUMERATED";
|
|
294
|
+
case 11:
|
|
295
|
+
return "EMBEDDED_PDV";
|
|
296
|
+
case 12:
|
|
297
|
+
return "UTF8String";
|
|
298
|
+
case 16:
|
|
299
|
+
return "SEQUENCE";
|
|
300
|
+
case 17:
|
|
301
|
+
return "SET";
|
|
302
|
+
case 18:
|
|
303
|
+
return "NumericString";
|
|
304
|
+
case 19:
|
|
305
|
+
return "PrintableString";
|
|
306
|
+
// ASCII subset
|
|
307
|
+
case 20:
|
|
308
|
+
return "TeletexString";
|
|
309
|
+
// aka T61String
|
|
310
|
+
case 21:
|
|
311
|
+
return "VideotexString";
|
|
312
|
+
case 22:
|
|
313
|
+
return "IA5String";
|
|
314
|
+
// ASCII
|
|
315
|
+
case 23:
|
|
316
|
+
return "UTCTime";
|
|
317
|
+
case 24:
|
|
318
|
+
return "GeneralizedTime";
|
|
319
|
+
case 25:
|
|
320
|
+
return "GraphicString";
|
|
321
|
+
case 26:
|
|
322
|
+
return "VisibleString";
|
|
323
|
+
// ASCII subset
|
|
324
|
+
case 27:
|
|
325
|
+
return "GeneralString";
|
|
326
|
+
case 28:
|
|
327
|
+
return "UniversalString";
|
|
328
|
+
case 30:
|
|
329
|
+
return "BMPString";
|
|
330
|
+
}
|
|
331
|
+
return "Universal_" + this.tag.tagNumber.toString();
|
|
332
|
+
case 1:
|
|
333
|
+
return "Application_" + this.tag.tagNumber.toString();
|
|
334
|
+
case 2:
|
|
335
|
+
return "[" + this.tag.tagNumber.toString() + "]";
|
|
336
|
+
// Context
|
|
337
|
+
case 3:
|
|
338
|
+
return "Private_" + this.tag.tagNumber.toString();
|
|
339
|
+
}
|
|
340
|
+
}, r.prototype.content = function(t) {
|
|
341
|
+
if (this.tag === void 0)
|
|
342
|
+
return null;
|
|
343
|
+
t === void 0 && (t = 1 / 0);
|
|
344
|
+
var e = this.posContent(), i = Math.abs(this.length);
|
|
345
|
+
if (!this.tag.isUniversal())
|
|
346
|
+
return this.sub !== null ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
|
|
347
|
+
switch (this.tag.tagNumber) {
|
|
348
|
+
case 1:
|
|
349
|
+
return this.stream.get(e) === 0 ? "false" : "true";
|
|
350
|
+
case 2:
|
|
351
|
+
return this.stream.parseInteger(e, e + i);
|
|
352
|
+
case 3:
|
|
353
|
+
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + i, t);
|
|
354
|
+
case 4:
|
|
355
|
+
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + i, t);
|
|
356
|
+
// case 0x05: // NULL
|
|
357
|
+
case 6:
|
|
358
|
+
return this.stream.parseOID(e, e + i, t);
|
|
359
|
+
// case 0x07: // ObjectDescriptor
|
|
360
|
+
// case 0x08: // EXTERNAL
|
|
361
|
+
// case 0x09: // REAL
|
|
362
|
+
// case 0x0A: // ENUMERATED
|
|
363
|
+
// case 0x0B: // EMBEDDED_PDV
|
|
364
|
+
case 16:
|
|
365
|
+
// SEQUENCE
|
|
366
|
+
case 17:
|
|
367
|
+
return this.sub !== null ? "(" + this.sub.length + " elem)" : "(no elem)";
|
|
368
|
+
case 12:
|
|
369
|
+
return L(this.stream.parseStringUTF(e, e + i), t);
|
|
370
|
+
case 18:
|
|
371
|
+
// NumericString
|
|
372
|
+
case 19:
|
|
373
|
+
// PrintableString
|
|
374
|
+
case 20:
|
|
375
|
+
// TeletexString
|
|
376
|
+
case 21:
|
|
377
|
+
// VideotexString
|
|
378
|
+
case 22:
|
|
379
|
+
// IA5String
|
|
380
|
+
// case 0x19: // GraphicString
|
|
381
|
+
case 26:
|
|
382
|
+
return L(this.stream.parseStringISO(e, e + i), t);
|
|
383
|
+
case 30:
|
|
384
|
+
return L(this.stream.parseStringBMP(e, e + i), t);
|
|
385
|
+
case 23:
|
|
386
|
+
// UTCTime
|
|
387
|
+
case 24:
|
|
388
|
+
return this.stream.parseTime(e, e + i, this.tag.tagNumber == 23);
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
}, r.prototype.toString = function() {
|
|
392
|
+
return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (this.sub === null ? "null" : this.sub.length) + "]";
|
|
393
|
+
}, r.prototype.toPrettyString = function(t) {
|
|
394
|
+
t === void 0 && (t = "");
|
|
395
|
+
var e = t + this.typeName() + " @" + this.stream.pos;
|
|
396
|
+
if (this.length >= 0 && (e += "+"), e += this.length, this.tag.tagConstructed ? e += " (constructed)" : this.tag.isUniversal() && (this.tag.tagNumber == 3 || this.tag.tagNumber == 4) && this.sub !== null && (e += " (encapsulates)"), e += `
|
|
397
|
+
`, this.sub !== null) {
|
|
398
|
+
t += " ";
|
|
399
|
+
for (var i = 0, n = this.sub.length; i < n; ++i)
|
|
400
|
+
e += this.sub[i].toPrettyString(t);
|
|
401
|
+
}
|
|
402
|
+
return e;
|
|
403
|
+
}, r.prototype.posStart = function() {
|
|
404
|
+
return this.stream.pos;
|
|
405
|
+
}, r.prototype.posContent = function() {
|
|
406
|
+
return this.stream.pos + this.header;
|
|
407
|
+
}, r.prototype.posEnd = function() {
|
|
408
|
+
return this.stream.pos + this.header + Math.abs(this.length);
|
|
409
|
+
}, r.prototype.toHexString = function() {
|
|
410
|
+
return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
|
|
411
|
+
}, r.decodeLength = function(t) {
|
|
412
|
+
var e = t.get(), i = e & 127;
|
|
413
|
+
if (i == e)
|
|
414
|
+
return i;
|
|
415
|
+
if (i > 6)
|
|
416
|
+
throw new Error("Length over 48 bits not supported at position " + (t.pos - 1));
|
|
417
|
+
if (i === 0)
|
|
418
|
+
return null;
|
|
419
|
+
e = 0;
|
|
420
|
+
for (var n = 0; n < i; ++n)
|
|
421
|
+
e = e * 256 + t.get();
|
|
422
|
+
return e;
|
|
423
|
+
}, r.prototype.getHexStringValue = function() {
|
|
424
|
+
var t = this.toHexString(), e = this.header * 2, i = this.length * 2;
|
|
425
|
+
return t.substring(e, e + i);
|
|
426
|
+
}, r.decode = function(t) {
|
|
427
|
+
var e;
|
|
428
|
+
t instanceof ot ? e = t : e = new ot(t, 0);
|
|
429
|
+
var i = new ot(e), n = new dt(e), s = r.decodeLength(e), o = e.pos, h = o - i.pos, f = null, u = function() {
|
|
430
|
+
var c = [];
|
|
431
|
+
if (s !== null) {
|
|
432
|
+
for (var g = o + s; e.pos < g; )
|
|
433
|
+
c[c.length] = r.decode(e);
|
|
434
|
+
if (e.pos != g)
|
|
435
|
+
throw new Error("Content size is not correct for container starting at offset " + o);
|
|
436
|
+
} else
|
|
437
|
+
try {
|
|
438
|
+
for (; ; ) {
|
|
439
|
+
var p = r.decode(e);
|
|
440
|
+
if (p.tag.isEOC())
|
|
441
|
+
break;
|
|
442
|
+
c[c.length] = p;
|
|
443
|
+
}
|
|
444
|
+
s = o - e.pos;
|
|
445
|
+
} catch (S) {
|
|
446
|
+
throw new Error("Exception while decoding undefined length content: " + S);
|
|
447
|
+
}
|
|
448
|
+
return c;
|
|
449
|
+
};
|
|
450
|
+
if (n.tagConstructed)
|
|
451
|
+
f = u();
|
|
452
|
+
else if (n.isUniversal() && (n.tagNumber == 3 || n.tagNumber == 4))
|
|
453
|
+
try {
|
|
454
|
+
if (n.tagNumber == 3 && e.get() != 0)
|
|
455
|
+
throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
|
|
456
|
+
f = u();
|
|
457
|
+
for (var l = 0; l < f.length; ++l)
|
|
458
|
+
if (f[l].tag.isEOC())
|
|
459
|
+
throw new Error("EOC is not supposed to be actual content.");
|
|
460
|
+
} catch {
|
|
461
|
+
f = null;
|
|
462
|
+
}
|
|
463
|
+
if (f === null) {
|
|
464
|
+
if (s === null)
|
|
465
|
+
throw new Error("We can't skip over an invalid tag with undefined length at offset " + o);
|
|
466
|
+
e.pos = o + Math.abs(s);
|
|
467
|
+
}
|
|
468
|
+
return new r(i, h, s, n, f);
|
|
469
|
+
}, r;
|
|
470
|
+
})()
|
|
471
|
+
), dt = (
|
|
472
|
+
/** @class */
|
|
473
|
+
(function() {
|
|
474
|
+
function r(t) {
|
|
475
|
+
var e = t.get();
|
|
476
|
+
if (this.tagClass = e >> 6, this.tagConstructed = (e & 32) !== 0, this.tagNumber = e & 31, this.tagNumber == 31) {
|
|
477
|
+
var i = new G();
|
|
478
|
+
do
|
|
479
|
+
e = t.get(), i.mulAdd(128, e & 127);
|
|
480
|
+
while (e & 128);
|
|
481
|
+
this.tagNumber = i.simplify();
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return r.prototype.isUniversal = function() {
|
|
485
|
+
return this.tagClass === 0;
|
|
486
|
+
}, r.prototype.isEOC = function() {
|
|
487
|
+
return this.tagClass === 0 && this.tagNumber === 0;
|
|
488
|
+
}, r;
|
|
489
|
+
})()
|
|
490
|
+
), P, Ht = 244837814094590, yt = (Ht & 16777215) == 15715070, w = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], Ft = (1 << 26) / w[w.length - 1], v = (
|
|
491
|
+
/** @class */
|
|
492
|
+
(function() {
|
|
493
|
+
function r(t, e, i) {
|
|
494
|
+
t != null && (typeof t == "number" ? this.fromNumber(t, e, i) : e == null && typeof t != "string" ? this.fromString(t, 256) : this.fromString(t, e));
|
|
495
|
+
}
|
|
496
|
+
return r.prototype.toString = function(t) {
|
|
497
|
+
if (this.s < 0)
|
|
498
|
+
return "-" + this.negate().toString(t);
|
|
499
|
+
var e;
|
|
500
|
+
if (t == 16)
|
|
501
|
+
e = 4;
|
|
502
|
+
else if (t == 8)
|
|
503
|
+
e = 3;
|
|
504
|
+
else if (t == 2)
|
|
505
|
+
e = 1;
|
|
506
|
+
else if (t == 32)
|
|
507
|
+
e = 5;
|
|
508
|
+
else if (t == 4)
|
|
509
|
+
e = 2;
|
|
510
|
+
else
|
|
511
|
+
return this.toRadix(t);
|
|
512
|
+
var i = (1 << e) - 1, n, s = !1, o = "", h = this.t, f = this.DB - h * this.DB % e;
|
|
513
|
+
if (h-- > 0)
|
|
514
|
+
for (f < this.DB && (n = this[h] >> f) > 0 && (s = !0, o = O(n)); h >= 0; )
|
|
515
|
+
f < e ? (n = (this[h] & (1 << f) - 1) << e - f, n |= this[--h] >> (f += this.DB - e)) : (n = this[h] >> (f -= e) & i, f <= 0 && (f += this.DB, --h)), n > 0 && (s = !0), s && (o += O(n));
|
|
516
|
+
return s ? o : "0";
|
|
517
|
+
}, r.prototype.negate = function() {
|
|
518
|
+
var t = d();
|
|
519
|
+
return r.ZERO.subTo(this, t), t;
|
|
520
|
+
}, r.prototype.abs = function() {
|
|
521
|
+
return this.s < 0 ? this.negate() : this;
|
|
522
|
+
}, r.prototype.compareTo = function(t) {
|
|
523
|
+
var e = this.s - t.s;
|
|
524
|
+
if (e != 0)
|
|
525
|
+
return e;
|
|
526
|
+
var i = this.t;
|
|
527
|
+
if (e = i - t.t, e != 0)
|
|
528
|
+
return this.s < 0 ? -e : e;
|
|
529
|
+
for (; --i >= 0; )
|
|
530
|
+
if ((e = this[i] - t[i]) != 0)
|
|
531
|
+
return e;
|
|
532
|
+
return 0;
|
|
533
|
+
}, r.prototype.bitLength = function() {
|
|
534
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + X(this[this.t - 1] ^ this.s & this.DM);
|
|
535
|
+
}, r.prototype.mod = function(t) {
|
|
536
|
+
var e = d();
|
|
537
|
+
return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(r.ZERO) > 0 && t.subTo(e, e), e;
|
|
538
|
+
}, r.prototype.modPowInt = function(t, e) {
|
|
539
|
+
var i;
|
|
540
|
+
return t < 256 || e.isEven() ? i = new St(e) : i = new mt(e), this.exp(t, i);
|
|
541
|
+
}, r.prototype.clone = function() {
|
|
542
|
+
var t = d();
|
|
543
|
+
return this.copyTo(t), t;
|
|
544
|
+
}, r.prototype.intValue = function() {
|
|
545
|
+
if (this.s < 0) {
|
|
546
|
+
if (this.t == 1)
|
|
547
|
+
return this[0] - this.DV;
|
|
548
|
+
if (this.t == 0)
|
|
549
|
+
return -1;
|
|
550
|
+
} else {
|
|
551
|
+
if (this.t == 1)
|
|
552
|
+
return this[0];
|
|
553
|
+
if (this.t == 0)
|
|
554
|
+
return 0;
|
|
555
|
+
}
|
|
556
|
+
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
|
|
557
|
+
}, r.prototype.byteValue = function() {
|
|
558
|
+
return this.t == 0 ? this.s : this[0] << 24 >> 24;
|
|
559
|
+
}, r.prototype.shortValue = function() {
|
|
560
|
+
return this.t == 0 ? this.s : this[0] << 16 >> 16;
|
|
561
|
+
}, r.prototype.signum = function() {
|
|
562
|
+
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
|
|
563
|
+
}, r.prototype.toByteArray = function() {
|
|
564
|
+
var t = this.t, e = [];
|
|
565
|
+
e[0] = this.s;
|
|
566
|
+
var i = this.DB - t * this.DB % 8, n, s = 0;
|
|
567
|
+
if (t-- > 0)
|
|
568
|
+
for (i < this.DB && (n = this[t] >> i) != (this.s & this.DM) >> i && (e[s++] = n | this.s << this.DB - i); t >= 0; )
|
|
569
|
+
i < 8 ? (n = (this[t] & (1 << i) - 1) << 8 - i, n |= this[--t] >> (i += this.DB - 8)) : (n = this[t] >> (i -= 8) & 255, i <= 0 && (i += this.DB, --t)), (n & 128) != 0 && (n |= -256), s == 0 && (this.s & 128) != (n & 128) && ++s, (s > 0 || n != this.s) && (e[s++] = n);
|
|
570
|
+
return e;
|
|
571
|
+
}, r.prototype.equals = function(t) {
|
|
572
|
+
return this.compareTo(t) == 0;
|
|
573
|
+
}, r.prototype.min = function(t) {
|
|
574
|
+
return this.compareTo(t) < 0 ? this : t;
|
|
575
|
+
}, r.prototype.max = function(t) {
|
|
576
|
+
return this.compareTo(t) > 0 ? this : t;
|
|
577
|
+
}, r.prototype.and = function(t) {
|
|
578
|
+
var e = d();
|
|
579
|
+
return this.bitwiseTo(t, Vt, e), e;
|
|
580
|
+
}, r.prototype.or = function(t) {
|
|
581
|
+
var e = d();
|
|
582
|
+
return this.bitwiseTo(t, Q, e), e;
|
|
583
|
+
}, r.prototype.xor = function(t) {
|
|
584
|
+
var e = d();
|
|
585
|
+
return this.bitwiseTo(t, pt, e), e;
|
|
586
|
+
}, r.prototype.andNot = function(t) {
|
|
587
|
+
var e = d();
|
|
588
|
+
return this.bitwiseTo(t, vt, e), e;
|
|
589
|
+
}, r.prototype.not = function() {
|
|
590
|
+
for (var t = d(), e = 0; e < this.t; ++e)
|
|
591
|
+
t[e] = this.DM & ~this[e];
|
|
592
|
+
return t.t = this.t, t.s = ~this.s, t;
|
|
593
|
+
}, r.prototype.shiftLeft = function(t) {
|
|
594
|
+
var e = d();
|
|
595
|
+
return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e;
|
|
596
|
+
}, r.prototype.shiftRight = function(t) {
|
|
597
|
+
var e = d();
|
|
598
|
+
return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e;
|
|
599
|
+
}, r.prototype.getLowestSetBit = function() {
|
|
600
|
+
for (var t = 0; t < this.t; ++t)
|
|
601
|
+
if (this[t] != 0)
|
|
602
|
+
return t * this.DB + Nt(this[t]);
|
|
603
|
+
return this.s < 0 ? this.t * this.DB : -1;
|
|
604
|
+
}, r.prototype.bitCount = function() {
|
|
605
|
+
for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i)
|
|
606
|
+
t += Pt(this[i] ^ e);
|
|
607
|
+
return t;
|
|
608
|
+
}, r.prototype.testBit = function(t) {
|
|
609
|
+
var e = Math.floor(t / this.DB);
|
|
610
|
+
return e >= this.t ? this.s != 0 : (this[e] & 1 << t % this.DB) != 0;
|
|
611
|
+
}, r.prototype.setBit = function(t) {
|
|
612
|
+
return this.changeBit(t, Q);
|
|
613
|
+
}, r.prototype.clearBit = function(t) {
|
|
614
|
+
return this.changeBit(t, vt);
|
|
615
|
+
}, r.prototype.flipBit = function(t) {
|
|
616
|
+
return this.changeBit(t, pt);
|
|
617
|
+
}, r.prototype.add = function(t) {
|
|
618
|
+
var e = d();
|
|
619
|
+
return this.addTo(t, e), e;
|
|
620
|
+
}, r.prototype.subtract = function(t) {
|
|
621
|
+
var e = d();
|
|
622
|
+
return this.subTo(t, e), e;
|
|
623
|
+
}, r.prototype.multiply = function(t) {
|
|
624
|
+
var e = d();
|
|
625
|
+
return this.multiplyTo(t, e), e;
|
|
626
|
+
}, r.prototype.divide = function(t) {
|
|
627
|
+
var e = d();
|
|
628
|
+
return this.divRemTo(t, e, null), e;
|
|
629
|
+
}, r.prototype.remainder = function(t) {
|
|
630
|
+
var e = d();
|
|
631
|
+
return this.divRemTo(t, null, e), e;
|
|
632
|
+
}, r.prototype.divideAndRemainder = function(t) {
|
|
633
|
+
var e = d(), i = d();
|
|
634
|
+
return this.divRemTo(t, e, i), [e, i];
|
|
635
|
+
}, r.prototype.modPow = function(t, e) {
|
|
636
|
+
var i = t.bitLength(), n, s = V(1), o;
|
|
637
|
+
if (i <= 0)
|
|
638
|
+
return s;
|
|
639
|
+
i < 18 ? n = 1 : i < 48 ? n = 3 : i < 144 ? n = 4 : i < 768 ? n = 5 : n = 6, i < 8 ? o = new St(e) : e.isEven() ? o = new Ut(e) : o = new mt(e);
|
|
640
|
+
var h = [], f = 3, u = n - 1, l = (1 << n) - 1;
|
|
641
|
+
if (h[1] = o.convert(this), n > 1) {
|
|
642
|
+
var c = d();
|
|
643
|
+
for (o.sqrTo(h[1], c); f <= l; )
|
|
644
|
+
h[f] = d(), o.mulTo(c, h[f - 2], h[f]), f += 2;
|
|
645
|
+
}
|
|
646
|
+
var g = t.t - 1, p, S = !0, m = d(), D;
|
|
647
|
+
for (i = X(t[g]) - 1; g >= 0; ) {
|
|
648
|
+
for (i >= u ? p = t[g] >> i - u & l : (p = (t[g] & (1 << i + 1) - 1) << u - i, g > 0 && (p |= t[g - 1] >> this.DB + i - u)), f = n; (p & 1) == 0; )
|
|
649
|
+
p >>= 1, --f;
|
|
650
|
+
if ((i -= f) < 0 && (i += this.DB, --g), S)
|
|
651
|
+
h[p].copyTo(s), S = !1;
|
|
652
|
+
else {
|
|
653
|
+
for (; f > 1; )
|
|
654
|
+
o.sqrTo(s, m), o.sqrTo(m, s), f -= 2;
|
|
655
|
+
f > 0 ? o.sqrTo(s, m) : (D = s, s = m, m = D), o.mulTo(m, h[p], s);
|
|
656
|
+
}
|
|
657
|
+
for (; g >= 0 && (t[g] & 1 << i) == 0; )
|
|
658
|
+
o.sqrTo(s, m), D = s, s = m, m = D, --i < 0 && (i = this.DB - 1, --g);
|
|
659
|
+
}
|
|
660
|
+
return o.revert(s);
|
|
661
|
+
}, r.prototype.modInverse = function(t) {
|
|
662
|
+
var e = t.isEven();
|
|
663
|
+
if (this.isEven() && e || t.signum() == 0)
|
|
664
|
+
return r.ZERO;
|
|
665
|
+
for (var i = t.clone(), n = this.clone(), s = V(1), o = V(0), h = V(0), f = V(1); i.signum() != 0; ) {
|
|
666
|
+
for (; i.isEven(); )
|
|
667
|
+
i.rShiftTo(1, i), e ? ((!s.isEven() || !o.isEven()) && (s.addTo(this, s), o.subTo(t, o)), s.rShiftTo(1, s)) : o.isEven() || o.subTo(t, o), o.rShiftTo(1, o);
|
|
668
|
+
for (; n.isEven(); )
|
|
669
|
+
n.rShiftTo(1, n), e ? ((!h.isEven() || !f.isEven()) && (h.addTo(this, h), f.subTo(t, f)), h.rShiftTo(1, h)) : f.isEven() || f.subTo(t, f), f.rShiftTo(1, f);
|
|
670
|
+
i.compareTo(n) >= 0 ? (i.subTo(n, i), e && s.subTo(h, s), o.subTo(f, o)) : (n.subTo(i, n), e && h.subTo(s, h), f.subTo(o, f));
|
|
671
|
+
}
|
|
672
|
+
if (n.compareTo(r.ONE) != 0)
|
|
673
|
+
return r.ZERO;
|
|
674
|
+
if (f.compareTo(t) >= 0)
|
|
675
|
+
return f.subtract(t);
|
|
676
|
+
if (f.signum() < 0)
|
|
677
|
+
f.addTo(t, f);
|
|
678
|
+
else
|
|
679
|
+
return f;
|
|
680
|
+
return f.signum() < 0 ? f.add(t) : f;
|
|
681
|
+
}, r.prototype.pow = function(t) {
|
|
682
|
+
return this.exp(t, new Kt());
|
|
683
|
+
}, r.prototype.gcd = function(t) {
|
|
684
|
+
var e = this.s < 0 ? this.negate() : this.clone(), i = t.s < 0 ? t.negate() : t.clone();
|
|
685
|
+
if (e.compareTo(i) < 0) {
|
|
686
|
+
var n = e;
|
|
687
|
+
e = i, i = n;
|
|
688
|
+
}
|
|
689
|
+
var s = e.getLowestSetBit(), o = i.getLowestSetBit();
|
|
690
|
+
if (o < 0)
|
|
691
|
+
return e;
|
|
692
|
+
for (s < o && (o = s), o > 0 && (e.rShiftTo(o, e), i.rShiftTo(o, i)); e.signum() > 0; )
|
|
693
|
+
(s = e.getLowestSetBit()) > 0 && e.rShiftTo(s, e), (s = i.getLowestSetBit()) > 0 && i.rShiftTo(s, i), e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
|
|
694
|
+
return o > 0 && i.lShiftTo(o, i), i;
|
|
695
|
+
}, r.prototype.isProbablePrime = function(t) {
|
|
696
|
+
var e, i = this.abs();
|
|
697
|
+
if (i.t == 1 && i[0] <= w[w.length - 1]) {
|
|
698
|
+
for (e = 0; e < w.length; ++e)
|
|
699
|
+
if (i[0] == w[e])
|
|
700
|
+
return !0;
|
|
701
|
+
return !1;
|
|
702
|
+
}
|
|
703
|
+
if (i.isEven())
|
|
704
|
+
return !1;
|
|
705
|
+
for (e = 1; e < w.length; ) {
|
|
706
|
+
for (var n = w[e], s = e + 1; s < w.length && n < Ft; )
|
|
707
|
+
n *= w[s++];
|
|
708
|
+
for (n = i.modInt(n); e < s; )
|
|
709
|
+
if (n % w[e++] == 0)
|
|
710
|
+
return !1;
|
|
711
|
+
}
|
|
712
|
+
return i.millerRabin(t);
|
|
713
|
+
}, r.prototype.copyTo = function(t) {
|
|
714
|
+
for (var e = this.t - 1; e >= 0; --e)
|
|
715
|
+
t[e] = this[e];
|
|
716
|
+
t.t = this.t, t.s = this.s;
|
|
717
|
+
}, r.prototype.fromInt = function(t) {
|
|
718
|
+
this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0;
|
|
719
|
+
}, r.prototype.fromString = function(t, e) {
|
|
720
|
+
var i;
|
|
721
|
+
if (e == 16)
|
|
722
|
+
i = 4;
|
|
723
|
+
else if (e == 8)
|
|
724
|
+
i = 3;
|
|
725
|
+
else if (e == 256)
|
|
726
|
+
i = 8;
|
|
727
|
+
else if (e == 2)
|
|
728
|
+
i = 1;
|
|
729
|
+
else if (e == 32)
|
|
730
|
+
i = 5;
|
|
731
|
+
else if (e == 4)
|
|
732
|
+
i = 2;
|
|
733
|
+
else {
|
|
734
|
+
this.fromRadix(t, e);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
this.t = 0, this.s = 0;
|
|
738
|
+
for (var n = t.length, s = !1, o = 0; --n >= 0; ) {
|
|
739
|
+
var h = i == 8 ? +t[n] & 255 : Tt(t, n);
|
|
740
|
+
if (h < 0) {
|
|
741
|
+
t.charAt(n) == "-" && (s = !0);
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
s = !1, o == 0 ? this[this.t++] = h : o + i > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - o) - 1) << o, this[this.t++] = h >> this.DB - o) : this[this.t - 1] |= h << o, o += i, o >= this.DB && (o -= this.DB);
|
|
745
|
+
}
|
|
746
|
+
i == 8 && (+t[0] & 128) != 0 && (this.s = -1, o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o)), this.clamp(), s && r.ZERO.subTo(this, this);
|
|
747
|
+
}, r.prototype.clamp = function() {
|
|
748
|
+
for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; )
|
|
749
|
+
--this.t;
|
|
750
|
+
}, r.prototype.dlShiftTo = function(t, e) {
|
|
751
|
+
var i;
|
|
752
|
+
for (i = this.t - 1; i >= 0; --i)
|
|
753
|
+
e[i + t] = this[i];
|
|
754
|
+
for (i = t - 1; i >= 0; --i)
|
|
755
|
+
e[i] = 0;
|
|
756
|
+
e.t = this.t + t, e.s = this.s;
|
|
757
|
+
}, r.prototype.drShiftTo = function(t, e) {
|
|
758
|
+
for (var i = t; i < this.t; ++i)
|
|
759
|
+
e[i - t] = this[i];
|
|
760
|
+
e.t = Math.max(this.t - t, 0), e.s = this.s;
|
|
761
|
+
}, r.prototype.lShiftTo = function(t, e) {
|
|
762
|
+
for (var i = t % this.DB, n = this.DB - i, s = (1 << n) - 1, o = Math.floor(t / this.DB), h = this.s << i & this.DM, f = this.t - 1; f >= 0; --f)
|
|
763
|
+
e[f + o + 1] = this[f] >> n | h, h = (this[f] & s) << i;
|
|
764
|
+
for (var f = o - 1; f >= 0; --f)
|
|
765
|
+
e[f] = 0;
|
|
766
|
+
e[o] = h, e.t = this.t + o + 1, e.s = this.s, e.clamp();
|
|
767
|
+
}, r.prototype.rShiftTo = function(t, e) {
|
|
768
|
+
e.s = this.s;
|
|
769
|
+
var i = Math.floor(t / this.DB);
|
|
770
|
+
if (i >= this.t) {
|
|
771
|
+
e.t = 0;
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
var n = t % this.DB, s = this.DB - n, o = (1 << n) - 1;
|
|
775
|
+
e[0] = this[i] >> n;
|
|
776
|
+
for (var h = i + 1; h < this.t; ++h)
|
|
777
|
+
e[h - i - 1] |= (this[h] & o) << s, e[h - i] = this[h] >> n;
|
|
778
|
+
n > 0 && (e[this.t - i - 1] |= (this.s & o) << s), e.t = this.t - i, e.clamp();
|
|
779
|
+
}, r.prototype.subTo = function(t, e) {
|
|
780
|
+
for (var i = 0, n = 0, s = Math.min(t.t, this.t); i < s; )
|
|
781
|
+
n += this[i] - t[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
782
|
+
if (t.t < this.t) {
|
|
783
|
+
for (n -= t.s; i < this.t; )
|
|
784
|
+
n += this[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
785
|
+
n += this.s;
|
|
786
|
+
} else {
|
|
787
|
+
for (n += this.s; i < t.t; )
|
|
788
|
+
n -= t[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
789
|
+
n -= t.s;
|
|
790
|
+
}
|
|
791
|
+
e.s = n < 0 ? -1 : 0, n < -1 ? e[i++] = this.DV + n : n > 0 && (e[i++] = n), e.t = i, e.clamp();
|
|
792
|
+
}, r.prototype.multiplyTo = function(t, e) {
|
|
793
|
+
var i = this.abs(), n = t.abs(), s = i.t;
|
|
794
|
+
for (e.t = s + n.t; --s >= 0; )
|
|
795
|
+
e[s] = 0;
|
|
796
|
+
for (s = 0; s < n.t; ++s)
|
|
797
|
+
e[s + i.t] = i.am(0, n[s], e, s, 0, i.t);
|
|
798
|
+
e.s = 0, e.clamp(), this.s != t.s && r.ZERO.subTo(e, e);
|
|
799
|
+
}, r.prototype.squareTo = function(t) {
|
|
800
|
+
for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0; )
|
|
801
|
+
t[i] = 0;
|
|
802
|
+
for (i = 0; i < e.t - 1; ++i) {
|
|
803
|
+
var n = e.am(i, e[i], t, 2 * i, 0, 1);
|
|
804
|
+
(t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, n, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1);
|
|
805
|
+
}
|
|
806
|
+
t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)), t.s = 0, t.clamp();
|
|
807
|
+
}, r.prototype.divRemTo = function(t, e, i) {
|
|
808
|
+
var n = t.abs();
|
|
809
|
+
if (!(n.t <= 0)) {
|
|
810
|
+
var s = this.abs();
|
|
811
|
+
if (s.t < n.t) {
|
|
812
|
+
e?.fromInt(0), i != null && this.copyTo(i);
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
i == null && (i = d());
|
|
816
|
+
var o = d(), h = this.s, f = t.s, u = this.DB - X(n[n.t - 1]);
|
|
817
|
+
u > 0 ? (n.lShiftTo(u, o), s.lShiftTo(u, i)) : (n.copyTo(o), s.copyTo(i));
|
|
818
|
+
var l = o.t, c = o[l - 1];
|
|
819
|
+
if (c != 0) {
|
|
820
|
+
var g = c * (1 << this.F1) + (l > 1 ? o[l - 2] >> this.F2 : 0), p = this.FV / g, S = (1 << this.F1) / g, m = 1 << this.F2, D = i.t, M = D - l, B = e ?? d();
|
|
821
|
+
for (o.dlShiftTo(M, B), i.compareTo(B) >= 0 && (i[i.t++] = 1, i.subTo(B, i)), r.ONE.dlShiftTo(l, B), B.subTo(o, o); o.t < l; )
|
|
822
|
+
o[o.t++] = 0;
|
|
823
|
+
for (; --M >= 0; ) {
|
|
824
|
+
var q = i[--D] == c ? this.DM : Math.floor(i[D] * p + (i[D - 1] + m) * S);
|
|
825
|
+
if ((i[D] += o.am(0, q, i, M, 0, l)) < q)
|
|
826
|
+
for (o.dlShiftTo(M, B), i.subTo(B, i); i[D] < --q; )
|
|
827
|
+
i.subTo(B, i);
|
|
828
|
+
}
|
|
829
|
+
e != null && (i.drShiftTo(l, e), h != f && r.ZERO.subTo(e, e)), i.t = l, i.clamp(), u > 0 && i.rShiftTo(u, i), h < 0 && r.ZERO.subTo(i, i);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}, r.prototype.invDigit = function() {
|
|
833
|
+
if (this.t < 1)
|
|
834
|
+
return 0;
|
|
835
|
+
var t = this[0];
|
|
836
|
+
if ((t & 1) == 0)
|
|
837
|
+
return 0;
|
|
838
|
+
var e = t & 3;
|
|
839
|
+
return e = e * (2 - (t & 15) * e) & 15, e = e * (2 - (t & 255) * e) & 255, e = e * (2 - ((t & 65535) * e & 65535)) & 65535, e = e * (2 - t * e % this.DV) % this.DV, e > 0 ? this.DV - e : -e;
|
|
840
|
+
}, r.prototype.isEven = function() {
|
|
841
|
+
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
842
|
+
}, r.prototype.exp = function(t, e) {
|
|
843
|
+
if (t > 4294967295 || t < 1)
|
|
844
|
+
return r.ONE;
|
|
845
|
+
var i = d(), n = d(), s = e.convert(this), o = X(t) - 1;
|
|
846
|
+
for (s.copyTo(i); --o >= 0; )
|
|
847
|
+
if (e.sqrTo(i, n), (t & 1 << o) > 0)
|
|
848
|
+
e.mulTo(n, s, i);
|
|
849
|
+
else {
|
|
850
|
+
var h = i;
|
|
851
|
+
i = n, n = h;
|
|
852
|
+
}
|
|
853
|
+
return e.revert(i);
|
|
854
|
+
}, r.prototype.chunkSize = function(t) {
|
|
855
|
+
return Math.floor(Math.LN2 * this.DB / Math.log(t));
|
|
856
|
+
}, r.prototype.toRadix = function(t) {
|
|
857
|
+
if (t == null && (t = 10), this.signum() == 0 || t < 2 || t > 36)
|
|
858
|
+
return "0";
|
|
859
|
+
var e = this.chunkSize(t), i = Math.pow(t, e), n = V(i), s = d(), o = d(), h = "";
|
|
860
|
+
for (this.divRemTo(n, s, o); s.signum() > 0; )
|
|
861
|
+
h = (i + o.intValue()).toString(t).substring(1) + h, s.divRemTo(n, s, o);
|
|
862
|
+
return o.intValue().toString(t) + h;
|
|
863
|
+
}, r.prototype.fromRadix = function(t, e) {
|
|
864
|
+
this.fromInt(0), e == null && (e = 10);
|
|
865
|
+
for (var i = this.chunkSize(e), n = Math.pow(e, i), s = !1, o = 0, h = 0, f = 0; f < t.length; ++f) {
|
|
866
|
+
var u = Tt(t, f);
|
|
867
|
+
if (u < 0) {
|
|
868
|
+
t.charAt(f) == "-" && this.signum() == 0 && (s = !0);
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
h = e * h + u, ++o >= i && (this.dMultiply(n), this.dAddOffset(h, 0), o = 0, h = 0);
|
|
872
|
+
}
|
|
873
|
+
o > 0 && (this.dMultiply(Math.pow(e, o)), this.dAddOffset(h, 0)), s && r.ZERO.subTo(this, this);
|
|
874
|
+
}, r.prototype.fromNumber = function(t, e, i) {
|
|
875
|
+
if (typeof e == "number")
|
|
876
|
+
if (t < 2)
|
|
877
|
+
this.fromInt(1);
|
|
878
|
+
else
|
|
879
|
+
for (this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(r.ONE.shiftLeft(t - 1), Q, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e); )
|
|
880
|
+
this.dAddOffset(2, 0), this.bitLength() > t && this.subTo(r.ONE.shiftLeft(t - 1), this);
|
|
881
|
+
else {
|
|
882
|
+
var n = [], s = t & 7;
|
|
883
|
+
n.length = (t >> 3) + 1, e.nextBytes(n), s > 0 ? n[0] &= (1 << s) - 1 : n[0] = 0, this.fromString(n, 256);
|
|
884
|
+
}
|
|
885
|
+
}, r.prototype.bitwiseTo = function(t, e, i) {
|
|
886
|
+
var n, s, o = Math.min(t.t, this.t);
|
|
887
|
+
for (n = 0; n < o; ++n)
|
|
888
|
+
i[n] = e(this[n], t[n]);
|
|
889
|
+
if (t.t < this.t) {
|
|
890
|
+
for (s = t.s & this.DM, n = o; n < this.t; ++n)
|
|
891
|
+
i[n] = e(this[n], s);
|
|
892
|
+
i.t = this.t;
|
|
893
|
+
} else {
|
|
894
|
+
for (s = this.s & this.DM, n = o; n < t.t; ++n)
|
|
895
|
+
i[n] = e(s, t[n]);
|
|
896
|
+
i.t = t.t;
|
|
897
|
+
}
|
|
898
|
+
i.s = e(this.s, t.s), i.clamp();
|
|
899
|
+
}, r.prototype.changeBit = function(t, e) {
|
|
900
|
+
var i = r.ONE.shiftLeft(t);
|
|
901
|
+
return this.bitwiseTo(i, e, i), i;
|
|
902
|
+
}, r.prototype.addTo = function(t, e) {
|
|
903
|
+
for (var i = 0, n = 0, s = Math.min(t.t, this.t); i < s; )
|
|
904
|
+
n += this[i] + t[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
905
|
+
if (t.t < this.t) {
|
|
906
|
+
for (n += t.s; i < this.t; )
|
|
907
|
+
n += this[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
908
|
+
n += this.s;
|
|
909
|
+
} else {
|
|
910
|
+
for (n += this.s; i < t.t; )
|
|
911
|
+
n += t[i], e[i++] = n & this.DM, n >>= this.DB;
|
|
912
|
+
n += t.s;
|
|
913
|
+
}
|
|
914
|
+
e.s = n < 0 ? -1 : 0, n > 0 ? e[i++] = n : n < -1 && (e[i++] = this.DV + n), e.t = i, e.clamp();
|
|
915
|
+
}, r.prototype.dMultiply = function(t) {
|
|
916
|
+
this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp();
|
|
917
|
+
}, r.prototype.dAddOffset = function(t, e) {
|
|
918
|
+
if (t != 0) {
|
|
919
|
+
for (; this.t <= e; )
|
|
920
|
+
this[this.t++] = 0;
|
|
921
|
+
for (this[e] += t; this[e] >= this.DV; )
|
|
922
|
+
this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e];
|
|
923
|
+
}
|
|
924
|
+
}, r.prototype.multiplyLowerTo = function(t, e, i) {
|
|
925
|
+
var n = Math.min(this.t + t.t, e);
|
|
926
|
+
for (i.s = 0, i.t = n; n > 0; )
|
|
927
|
+
i[--n] = 0;
|
|
928
|
+
for (var s = i.t - this.t; n < s; ++n)
|
|
929
|
+
i[n + this.t] = this.am(0, t[n], i, n, 0, this.t);
|
|
930
|
+
for (var s = Math.min(t.t, e); n < s; ++n)
|
|
931
|
+
this.am(0, t[n], i, n, 0, e - n);
|
|
932
|
+
i.clamp();
|
|
933
|
+
}, r.prototype.multiplyUpperTo = function(t, e, i) {
|
|
934
|
+
--e;
|
|
935
|
+
var n = i.t = this.t + t.t - e;
|
|
936
|
+
for (i.s = 0; --n >= 0; )
|
|
937
|
+
i[n] = 0;
|
|
938
|
+
for (n = Math.max(e - this.t, 0); n < t.t; ++n)
|
|
939
|
+
i[this.t + n - e] = this.am(e - n, t[n], i, 0, 0, this.t + n - e);
|
|
940
|
+
i.clamp(), i.drShiftTo(1, i);
|
|
941
|
+
}, r.prototype.modInt = function(t) {
|
|
942
|
+
if (t <= 0)
|
|
943
|
+
return 0;
|
|
944
|
+
var e = this.DV % t, i = this.s < 0 ? t - 1 : 0;
|
|
945
|
+
if (this.t > 0)
|
|
946
|
+
if (e == 0)
|
|
947
|
+
i = this[0] % t;
|
|
948
|
+
else
|
|
949
|
+
for (var n = this.t - 1; n >= 0; --n)
|
|
950
|
+
i = (e * i + this[n]) % t;
|
|
951
|
+
return i;
|
|
952
|
+
}, r.prototype.millerRabin = function(t) {
|
|
953
|
+
var e = this.subtract(r.ONE), i = e.getLowestSetBit();
|
|
954
|
+
if (i <= 0)
|
|
955
|
+
return !1;
|
|
956
|
+
var n = e.shiftRight(i);
|
|
957
|
+
t = t + 1 >> 1, t > w.length && (t = w.length);
|
|
958
|
+
for (var s = d(), o = 0; o < t; ++o) {
|
|
959
|
+
s.fromInt(w[Math.floor(Math.random() * w.length)]);
|
|
960
|
+
var h = s.modPow(n, this);
|
|
961
|
+
if (h.compareTo(r.ONE) != 0 && h.compareTo(e) != 0) {
|
|
962
|
+
for (var f = 1; f++ < i && h.compareTo(e) != 0; )
|
|
963
|
+
if (h = h.modPowInt(2, this), h.compareTo(r.ONE) == 0)
|
|
964
|
+
return !1;
|
|
965
|
+
if (h.compareTo(e) != 0)
|
|
966
|
+
return !1;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
return !0;
|
|
970
|
+
}, r.prototype.square = function() {
|
|
971
|
+
var t = d();
|
|
972
|
+
return this.squareTo(t), t;
|
|
973
|
+
}, r.prototype.gcda = function(t, e) {
|
|
974
|
+
var i = this.s < 0 ? this.negate() : this.clone(), n = t.s < 0 ? t.negate() : t.clone();
|
|
975
|
+
if (i.compareTo(n) < 0) {
|
|
976
|
+
var s = i;
|
|
977
|
+
i = n, n = s;
|
|
978
|
+
}
|
|
979
|
+
var o = i.getLowestSetBit(), h = n.getLowestSetBit();
|
|
980
|
+
if (h < 0) {
|
|
981
|
+
e(i);
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
o < h && (h = o), h > 0 && (i.rShiftTo(h, i), n.rShiftTo(h, n));
|
|
985
|
+
var f = function() {
|
|
986
|
+
(o = i.getLowestSetBit()) > 0 && i.rShiftTo(o, i), (o = n.getLowestSetBit()) > 0 && n.rShiftTo(o, n), i.compareTo(n) >= 0 ? (i.subTo(n, i), i.rShiftTo(1, i)) : (n.subTo(i, n), n.rShiftTo(1, n)), i.signum() > 0 ? setTimeout(f, 0) : (h > 0 && n.lShiftTo(h, n), setTimeout(function() {
|
|
987
|
+
e(n);
|
|
988
|
+
}, 0));
|
|
989
|
+
};
|
|
990
|
+
setTimeout(f, 10);
|
|
991
|
+
}, r.prototype.fromNumberAsync = function(t, e, i, n) {
|
|
992
|
+
if (typeof e == "number")
|
|
993
|
+
if (t < 2)
|
|
994
|
+
this.fromInt(1);
|
|
995
|
+
else {
|
|
996
|
+
this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(r.ONE.shiftLeft(t - 1), Q, this), this.isEven() && this.dAddOffset(1, 0);
|
|
997
|
+
var s = this, o = function() {
|
|
998
|
+
s.dAddOffset(2, 0), s.bitLength() > t && s.subTo(r.ONE.shiftLeft(t - 1), s), s.isProbablePrime(e) ? setTimeout(function() {
|
|
999
|
+
n();
|
|
1000
|
+
}, 0) : setTimeout(o, 0);
|
|
1001
|
+
};
|
|
1002
|
+
setTimeout(o, 0);
|
|
1003
|
+
}
|
|
1004
|
+
else {
|
|
1005
|
+
var h = [], f = t & 7;
|
|
1006
|
+
h.length = (t >> 3) + 1, e.nextBytes(h), f > 0 ? h[0] &= (1 << f) - 1 : h[0] = 0, this.fromString(h, 256);
|
|
1007
|
+
}
|
|
1008
|
+
}, r;
|
|
1009
|
+
})()
|
|
1010
|
+
), Kt = (
|
|
1011
|
+
/** @class */
|
|
1012
|
+
(function() {
|
|
1013
|
+
function r() {
|
|
1014
|
+
}
|
|
1015
|
+
return r.prototype.convert = function(t) {
|
|
1016
|
+
return t;
|
|
1017
|
+
}, r.prototype.revert = function(t) {
|
|
1018
|
+
return t;
|
|
1019
|
+
}, r.prototype.mulTo = function(t, e, i) {
|
|
1020
|
+
t.multiplyTo(e, i);
|
|
1021
|
+
}, r.prototype.sqrTo = function(t, e) {
|
|
1022
|
+
t.squareTo(e);
|
|
1023
|
+
}, r;
|
|
1024
|
+
})()
|
|
1025
|
+
), St = (
|
|
1026
|
+
/** @class */
|
|
1027
|
+
(function() {
|
|
1028
|
+
function r(t) {
|
|
1029
|
+
this.m = t;
|
|
1030
|
+
}
|
|
1031
|
+
return r.prototype.convert = function(t) {
|
|
1032
|
+
return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t;
|
|
1033
|
+
}, r.prototype.revert = function(t) {
|
|
1034
|
+
return t;
|
|
1035
|
+
}, r.prototype.reduce = function(t) {
|
|
1036
|
+
t.divRemTo(this.m, null, t);
|
|
1037
|
+
}, r.prototype.mulTo = function(t, e, i) {
|
|
1038
|
+
t.multiplyTo(e, i), this.reduce(i);
|
|
1039
|
+
}, r.prototype.sqrTo = function(t, e) {
|
|
1040
|
+
t.squareTo(e), this.reduce(e);
|
|
1041
|
+
}, r;
|
|
1042
|
+
})()
|
|
1043
|
+
), mt = (
|
|
1044
|
+
/** @class */
|
|
1045
|
+
(function() {
|
|
1046
|
+
function r(t) {
|
|
1047
|
+
this.m = t, this.mp = t.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t;
|
|
1048
|
+
}
|
|
1049
|
+
return r.prototype.convert = function(t) {
|
|
1050
|
+
var e = d();
|
|
1051
|
+
return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(v.ZERO) > 0 && this.m.subTo(e, e), e;
|
|
1052
|
+
}, r.prototype.revert = function(t) {
|
|
1053
|
+
var e = d();
|
|
1054
|
+
return t.copyTo(e), this.reduce(e), e;
|
|
1055
|
+
}, r.prototype.reduce = function(t) {
|
|
1056
|
+
for (; t.t <= this.mt2; )
|
|
1057
|
+
t[t.t++] = 0;
|
|
1058
|
+
for (var e = 0; e < this.m.t; ++e) {
|
|
1059
|
+
var i = t[e] & 32767, n = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
|
|
1060
|
+
for (i = e + this.m.t, t[i] += this.m.am(0, n, t, e, 0, this.m.t); t[i] >= t.DV; )
|
|
1061
|
+
t[i] -= t.DV, t[++i]++;
|
|
1062
|
+
}
|
|
1063
|
+
t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t);
|
|
1064
|
+
}, r.prototype.mulTo = function(t, e, i) {
|
|
1065
|
+
t.multiplyTo(e, i), this.reduce(i);
|
|
1066
|
+
}, r.prototype.sqrTo = function(t, e) {
|
|
1067
|
+
t.squareTo(e), this.reduce(e);
|
|
1068
|
+
}, r;
|
|
1069
|
+
})()
|
|
1070
|
+
), Ut = (
|
|
1071
|
+
/** @class */
|
|
1072
|
+
(function() {
|
|
1073
|
+
function r(t) {
|
|
1074
|
+
this.m = t, this.r2 = d(), this.q3 = d(), v.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t);
|
|
1075
|
+
}
|
|
1076
|
+
return r.prototype.convert = function(t) {
|
|
1077
|
+
if (t.s < 0 || t.t > 2 * this.m.t)
|
|
1078
|
+
return t.mod(this.m);
|
|
1079
|
+
if (t.compareTo(this.m) < 0)
|
|
1080
|
+
return t;
|
|
1081
|
+
var e = d();
|
|
1082
|
+
return t.copyTo(e), this.reduce(e), e;
|
|
1083
|
+
}, r.prototype.revert = function(t) {
|
|
1084
|
+
return t;
|
|
1085
|
+
}, r.prototype.reduce = function(t) {
|
|
1086
|
+
for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0; )
|
|
1087
|
+
t.dAddOffset(1, this.m.t + 1);
|
|
1088
|
+
for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0; )
|
|
1089
|
+
t.subTo(this.m, t);
|
|
1090
|
+
}, r.prototype.mulTo = function(t, e, i) {
|
|
1091
|
+
t.multiplyTo(e, i), this.reduce(i);
|
|
1092
|
+
}, r.prototype.sqrTo = function(t, e) {
|
|
1093
|
+
t.squareTo(e), this.reduce(e);
|
|
1094
|
+
}, r;
|
|
1095
|
+
})()
|
|
1096
|
+
);
|
|
1097
|
+
function d() {
|
|
1098
|
+
return new v(null);
|
|
1099
|
+
}
|
|
1100
|
+
function b(r, t) {
|
|
1101
|
+
return new v(r, t);
|
|
1102
|
+
}
|
|
1103
|
+
var bt = typeof navigator < "u";
|
|
1104
|
+
bt && yt && navigator.appName == "Microsoft Internet Explorer" ? (v.prototype.am = function(t, e, i, n, s, o) {
|
|
1105
|
+
for (var h = e & 32767, f = e >> 15; --o >= 0; ) {
|
|
1106
|
+
var u = this[t] & 32767, l = this[t++] >> 15, c = f * u + l * h;
|
|
1107
|
+
u = h * u + ((c & 32767) << 15) + i[n] + (s & 1073741823), s = (u >>> 30) + (c >>> 15) + f * l + (s >>> 30), i[n++] = u & 1073741823;
|
|
1108
|
+
}
|
|
1109
|
+
return s;
|
|
1110
|
+
}, P = 30) : bt && yt && navigator.appName != "Netscape" ? (v.prototype.am = function(t, e, i, n, s, o) {
|
|
1111
|
+
for (; --o >= 0; ) {
|
|
1112
|
+
var h = e * this[t++] + i[n] + s;
|
|
1113
|
+
s = Math.floor(h / 67108864), i[n++] = h & 67108863;
|
|
1114
|
+
}
|
|
1115
|
+
return s;
|
|
1116
|
+
}, P = 26) : (v.prototype.am = function(t, e, i, n, s, o) {
|
|
1117
|
+
for (var h = e & 16383, f = e >> 14; --o >= 0; ) {
|
|
1118
|
+
var u = this[t] & 16383, l = this[t++] >> 14, c = f * u + l * h;
|
|
1119
|
+
u = h * u + ((c & 16383) << 14) + i[n] + s, s = (u >> 28) + (c >> 14) + f * l, i[n++] = u & 268435455;
|
|
1120
|
+
}
|
|
1121
|
+
return s;
|
|
1122
|
+
}, P = 28);
|
|
1123
|
+
v.prototype.DB = P;
|
|
1124
|
+
v.prototype.DM = (1 << P) - 1;
|
|
1125
|
+
v.prototype.DV = 1 << P;
|
|
1126
|
+
var lt = 52;
|
|
1127
|
+
v.prototype.FV = Math.pow(2, lt);
|
|
1128
|
+
v.prototype.F1 = lt - P;
|
|
1129
|
+
v.prototype.F2 = 2 * P - lt;
|
|
1130
|
+
var nt = [], k, x;
|
|
1131
|
+
k = 48;
|
|
1132
|
+
for (x = 0; x <= 9; ++x)
|
|
1133
|
+
nt[k++] = x;
|
|
1134
|
+
k = 97;
|
|
1135
|
+
for (x = 10; x < 36; ++x)
|
|
1136
|
+
nt[k++] = x;
|
|
1137
|
+
k = 65;
|
|
1138
|
+
for (x = 10; x < 36; ++x)
|
|
1139
|
+
nt[k++] = x;
|
|
1140
|
+
function Tt(r, t) {
|
|
1141
|
+
var e = nt[r.charCodeAt(t)];
|
|
1142
|
+
return e ?? -1;
|
|
1143
|
+
}
|
|
1144
|
+
function V(r) {
|
|
1145
|
+
var t = d();
|
|
1146
|
+
return t.fromInt(r), t;
|
|
1147
|
+
}
|
|
1148
|
+
function X(r) {
|
|
1149
|
+
var t = 1, e;
|
|
1150
|
+
return (e = r >>> 16) != 0 && (r = e, t += 16), (e = r >> 8) != 0 && (r = e, t += 8), (e = r >> 4) != 0 && (r = e, t += 4), (e = r >> 2) != 0 && (r = e, t += 2), (e = r >> 1) != 0 && (r = e, t += 1), t;
|
|
1151
|
+
}
|
|
1152
|
+
v.ZERO = V(0);
|
|
1153
|
+
v.ONE = V(1);
|
|
1154
|
+
var Lt = (
|
|
1155
|
+
/** @class */
|
|
1156
|
+
(function() {
|
|
1157
|
+
function r() {
|
|
1158
|
+
this.i = 0, this.j = 0, this.S = [];
|
|
1159
|
+
}
|
|
1160
|
+
return r.prototype.init = function(t) {
|
|
1161
|
+
var e, i, n;
|
|
1162
|
+
for (e = 0; e < 256; ++e)
|
|
1163
|
+
this.S[e] = e;
|
|
1164
|
+
for (i = 0, e = 0; e < 256; ++e)
|
|
1165
|
+
i = i + this.S[e] + t[e % t.length] & 255, n = this.S[e], this.S[e] = this.S[i], this.S[i] = n;
|
|
1166
|
+
this.i = 0, this.j = 0;
|
|
1167
|
+
}, r.prototype.next = function() {
|
|
1168
|
+
var t;
|
|
1169
|
+
return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255];
|
|
1170
|
+
}, r;
|
|
1171
|
+
})()
|
|
1172
|
+
);
|
|
1173
|
+
function kt() {
|
|
1174
|
+
return new Lt();
|
|
1175
|
+
}
|
|
1176
|
+
var At = 256, Y, N = null, A;
|
|
1177
|
+
if (N == null) {
|
|
1178
|
+
N = [], A = 0;
|
|
1179
|
+
var W = void 0;
|
|
1180
|
+
if (typeof window < "u" && self.crypto && self.crypto.getRandomValues) {
|
|
1181
|
+
var ht = new Uint32Array(256);
|
|
1182
|
+
for (self.crypto.getRandomValues(ht), W = 0; W < ht.length; ++W)
|
|
1183
|
+
N[A++] = ht[W] & 255;
|
|
1184
|
+
}
|
|
1185
|
+
var tt = 0, et = function(r) {
|
|
1186
|
+
if (tt = tt || 0, tt >= 256 || A >= At) {
|
|
1187
|
+
self.removeEventListener ? self.removeEventListener("mousemove", et, !1) : self.detachEvent && self.detachEvent("onmousemove", et);
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
try {
|
|
1191
|
+
var t = r.x + r.y;
|
|
1192
|
+
N[A++] = t & 255, tt += 1;
|
|
1193
|
+
} catch {
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
typeof window < "u" && (self.addEventListener ? self.addEventListener("mousemove", et, !1) : self.attachEvent && self.attachEvent("onmousemove", et));
|
|
1197
|
+
}
|
|
1198
|
+
function jt() {
|
|
1199
|
+
if (Y == null) {
|
|
1200
|
+
for (Y = kt(); A < At; ) {
|
|
1201
|
+
var r = Math.floor(65536 * Math.random());
|
|
1202
|
+
N[A++] = r & 255;
|
|
1203
|
+
}
|
|
1204
|
+
for (Y.init(N), A = 0; A < N.length; ++A)
|
|
1205
|
+
N[A] = 0;
|
|
1206
|
+
A = 0;
|
|
1207
|
+
}
|
|
1208
|
+
return Y.next();
|
|
1209
|
+
}
|
|
1210
|
+
var rt = (
|
|
1211
|
+
/** @class */
|
|
1212
|
+
(function() {
|
|
1213
|
+
function r() {
|
|
1214
|
+
}
|
|
1215
|
+
return r.prototype.nextBytes = function(t) {
|
|
1216
|
+
for (var e = 0; e < t.length; ++e)
|
|
1217
|
+
t[e] = jt();
|
|
1218
|
+
}, r;
|
|
1219
|
+
})()
|
|
1220
|
+
);
|
|
1221
|
+
function ut(r) {
|
|
1222
|
+
return Gt(te(zt(r), r.length * 8));
|
|
1223
|
+
}
|
|
1224
|
+
function Et(r) {
|
|
1225
|
+
for (var t = "0123456789abcdef", e = "", i = 0; i < r.length; i++) {
|
|
1226
|
+
var n = r.charCodeAt(i);
|
|
1227
|
+
e += t.charAt(n >>> 4 & 15) + t.charAt(n & 15);
|
|
1228
|
+
}
|
|
1229
|
+
return e;
|
|
1230
|
+
}
|
|
1231
|
+
function zt(r) {
|
|
1232
|
+
for (var t = Array(r.length >> 2), e = 0; e < t.length; e++)
|
|
1233
|
+
t[e] = 0;
|
|
1234
|
+
for (var e = 0; e < r.length * 8; e += 8)
|
|
1235
|
+
t[e >> 5] |= (r.charCodeAt(e / 8) & 255) << 24 - e % 32;
|
|
1236
|
+
return t;
|
|
1237
|
+
}
|
|
1238
|
+
function Gt(r) {
|
|
1239
|
+
for (var t = "", e = 0; e < r.length * 32; e += 8)
|
|
1240
|
+
t += String.fromCharCode(r[e >> 5] >>> 24 - e % 32 & 255);
|
|
1241
|
+
return t;
|
|
1242
|
+
}
|
|
1243
|
+
function I(r, t) {
|
|
1244
|
+
return r >>> t | r << 32 - t;
|
|
1245
|
+
}
|
|
1246
|
+
function Bt(r, t) {
|
|
1247
|
+
return r >>> t;
|
|
1248
|
+
}
|
|
1249
|
+
function Zt(r, t, e) {
|
|
1250
|
+
return r & t ^ ~r & e;
|
|
1251
|
+
}
|
|
1252
|
+
function Jt(r, t, e) {
|
|
1253
|
+
return r & t ^ r & e ^ t & e;
|
|
1254
|
+
}
|
|
1255
|
+
function $t(r) {
|
|
1256
|
+
return I(r, 2) ^ I(r, 13) ^ I(r, 22);
|
|
1257
|
+
}
|
|
1258
|
+
function Qt(r) {
|
|
1259
|
+
return I(r, 6) ^ I(r, 11) ^ I(r, 25);
|
|
1260
|
+
}
|
|
1261
|
+
function Xt(r) {
|
|
1262
|
+
return I(r, 7) ^ I(r, 18) ^ Bt(r, 3);
|
|
1263
|
+
}
|
|
1264
|
+
function Yt(r) {
|
|
1265
|
+
return I(r, 17) ^ I(r, 19) ^ Bt(r, 10);
|
|
1266
|
+
}
|
|
1267
|
+
var Wt = new Array(1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998);
|
|
1268
|
+
function te(r, t) {
|
|
1269
|
+
var e = new Array(1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225), i = new Array(64), n, s, o, h, f, u, l, c, g, p, S, m;
|
|
1270
|
+
for (r[t >> 5] |= 128 << 24 - t % 32, r[(t + 64 >> 9 << 4) + 15] = t, g = 0; g < r.length; g += 16) {
|
|
1271
|
+
for (n = e[0], s = e[1], o = e[2], h = e[3], f = e[4], u = e[5], l = e[6], c = e[7], p = 0; p < 64; p++)
|
|
1272
|
+
p < 16 ? i[p] = r[p + g] : i[p] = E(E(E(Yt(i[p - 2]), i[p - 7]), Xt(i[p - 15])), i[p - 16]), S = E(E(E(E(c, Qt(f)), Zt(f, u, l)), Wt[p]), i[p]), m = E($t(n), Jt(n, s, o)), c = l, l = u, u = f, f = E(h, S), h = o, o = s, s = n, n = E(S, m);
|
|
1273
|
+
e[0] = E(n, e[0]), e[1] = E(s, e[1]), e[2] = E(o, e[2]), e[3] = E(h, e[3]), e[4] = E(f, e[4]), e[5] = E(u, e[5]), e[6] = E(l, e[6]), e[7] = E(c, e[7]);
|
|
1274
|
+
}
|
|
1275
|
+
return e;
|
|
1276
|
+
}
|
|
1277
|
+
function E(r, t) {
|
|
1278
|
+
var e = (r & 65535) + (t & 65535), i = (r >> 16) + (t >> 16) + (e >> 16);
|
|
1279
|
+
return i << 16 | e & 65535;
|
|
1280
|
+
}
|
|
1281
|
+
function ee(r, t) {
|
|
1282
|
+
if (t < r.length + 22)
|
|
1283
|
+
return null;
|
|
1284
|
+
for (var e = t - r.length - 6, i = "", n = 0; n < e; n += 2)
|
|
1285
|
+
i += "ff";
|
|
1286
|
+
var s = "0001" + i + "00" + r;
|
|
1287
|
+
return b(s, 16);
|
|
1288
|
+
}
|
|
1289
|
+
function ie(r, t) {
|
|
1290
|
+
if (t < r.length + 11)
|
|
1291
|
+
return null;
|
|
1292
|
+
for (var e = [], i = r.length - 1; i >= 0 && t > 0; ) {
|
|
1293
|
+
var n = r.charCodeAt(i--);
|
|
1294
|
+
n < 128 ? e[--t] = n : n > 127 && n < 2048 ? (e[--t] = n & 63 | 128, e[--t] = n >> 6 | 192) : (e[--t] = n & 63 | 128, e[--t] = n >> 6 & 63 | 128, e[--t] = n >> 12 | 224);
|
|
1295
|
+
}
|
|
1296
|
+
e[--t] = 0;
|
|
1297
|
+
for (var s = new rt(), o = []; t > 2; ) {
|
|
1298
|
+
for (o[0] = 0; o[0] == 0; )
|
|
1299
|
+
s.nextBytes(o);
|
|
1300
|
+
e[--t] = o[0];
|
|
1301
|
+
}
|
|
1302
|
+
return e[--t] = 2, e[--t] = 0, new v(e);
|
|
1303
|
+
}
|
|
1304
|
+
function wt(r, t, e) {
|
|
1305
|
+
for (var i = "", n = 0; i.length < t; )
|
|
1306
|
+
i += e(String.fromCharCode.apply(String, r.concat([
|
|
1307
|
+
(n & 4278190080) >> 24,
|
|
1308
|
+
(n & 16711680) >> 16,
|
|
1309
|
+
(n & 65280) >> 8,
|
|
1310
|
+
n & 255
|
|
1311
|
+
]))), n += 1;
|
|
1312
|
+
return i;
|
|
1313
|
+
}
|
|
1314
|
+
var re = 32;
|
|
1315
|
+
function ne(r, t) {
|
|
1316
|
+
var e = re, i = ut;
|
|
1317
|
+
if (r.length + 2 * e + 2 > t)
|
|
1318
|
+
throw "Message too long for RSA";
|
|
1319
|
+
var n = "", s;
|
|
1320
|
+
for (s = 0; s < t - r.length - 2 * e - 2; s += 1)
|
|
1321
|
+
n += "\0";
|
|
1322
|
+
var o = i("") + n + "" + r, h = new Array(e);
|
|
1323
|
+
new rt().nextBytes(h);
|
|
1324
|
+
var f = wt(h, o.length, i), u = [];
|
|
1325
|
+
for (s = 0; s < o.length; s += 1)
|
|
1326
|
+
u[s] = o.charCodeAt(s) ^ f.charCodeAt(s);
|
|
1327
|
+
var l = wt(u, h.length, i), c = [0];
|
|
1328
|
+
for (s = 0; s < h.length; s += 1)
|
|
1329
|
+
c[s + 1] = h[s] ^ l.charCodeAt(s);
|
|
1330
|
+
return new v(c.concat(u));
|
|
1331
|
+
}
|
|
1332
|
+
var se = (
|
|
1333
|
+
/** @class */
|
|
1334
|
+
(function() {
|
|
1335
|
+
function r() {
|
|
1336
|
+
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
|
|
1337
|
+
}
|
|
1338
|
+
return r.prototype.doPublic = function(t) {
|
|
1339
|
+
return t.modPowInt(this.e, this.n);
|
|
1340
|
+
}, r.prototype.doPrivate = function(t) {
|
|
1341
|
+
if (this.p == null || this.q == null)
|
|
1342
|
+
return t.modPow(this.d, this.n);
|
|
1343
|
+
for (var e = t.mod(this.p).modPow(this.dmp1, this.p), i = t.mod(this.q).modPow(this.dmq1, this.q); e.compareTo(i) < 0; )
|
|
1344
|
+
e = e.add(this.p);
|
|
1345
|
+
return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i);
|
|
1346
|
+
}, r.prototype.setPublic = function(t, e) {
|
|
1347
|
+
t != null && e != null && t.length > 0 && e.length > 0 && (this.n = b(t, 16), this.e = parseInt(e, 16));
|
|
1348
|
+
}, r.prototype.encrypt = function(t, e) {
|
|
1349
|
+
typeof e > "u" && (e = ie);
|
|
1350
|
+
var i = this.n.bitLength() + 7 >> 3, n = e(t, i);
|
|
1351
|
+
if (n == null)
|
|
1352
|
+
return null;
|
|
1353
|
+
var s = this.doPublic(n);
|
|
1354
|
+
if (s == null)
|
|
1355
|
+
return null;
|
|
1356
|
+
for (var o = s.toString(16), h = o.length, f = 0; f < i * 2 - h; f++)
|
|
1357
|
+
o = "0" + o;
|
|
1358
|
+
return o;
|
|
1359
|
+
}, r.prototype.setPrivate = function(t, e, i) {
|
|
1360
|
+
t != null && e != null && t.length > 0 && e.length > 0 && (this.n = b(t, 16), this.e = parseInt(e, 16), this.d = b(i, 16));
|
|
1361
|
+
}, r.prototype.setPrivateEx = function(t, e, i, n, s, o, h, f) {
|
|
1362
|
+
t != null && e != null && t.length > 0 && e.length > 0 && (this.n = b(t, 16), this.e = parseInt(e, 16), this.d = b(i, 16), this.p = b(n, 16), this.q = b(s, 16), this.dmp1 = b(o, 16), this.dmq1 = b(h, 16), this.coeff = b(f, 16));
|
|
1363
|
+
}, r.prototype.generate = function(t, e) {
|
|
1364
|
+
var i = new rt(), n = t >> 1;
|
|
1365
|
+
this.e = parseInt(e, 16);
|
|
1366
|
+
for (var s = new v(e, 16); ; ) {
|
|
1367
|
+
for (; this.p = new v(t - n, 1, i), !(this.p.subtract(v.ONE).gcd(s).compareTo(v.ONE) == 0 && this.p.isProbablePrime(10)); )
|
|
1368
|
+
;
|
|
1369
|
+
for (; this.q = new v(n, 1, i), !(this.q.subtract(v.ONE).gcd(s).compareTo(v.ONE) == 0 && this.q.isProbablePrime(10)); )
|
|
1370
|
+
;
|
|
1371
|
+
if (this.p.compareTo(this.q) <= 0) {
|
|
1372
|
+
var o = this.p;
|
|
1373
|
+
this.p = this.q, this.q = o;
|
|
1374
|
+
}
|
|
1375
|
+
var h = this.p.subtract(v.ONE), f = this.q.subtract(v.ONE), u = h.multiply(f);
|
|
1376
|
+
if (u.gcd(s).compareTo(v.ONE) == 0) {
|
|
1377
|
+
this.n = this.p.multiply(this.q), this.d = s.modInverse(u), this.dmp1 = this.d.mod(h), this.dmq1 = this.d.mod(f), this.coeff = this.q.modInverse(this.p);
|
|
1378
|
+
break;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
}, r.prototype.decrypt = function(t) {
|
|
1382
|
+
var e = b(t, 16), i = this.doPrivate(e);
|
|
1383
|
+
return i == null ? null : oe(i, this.n.bitLength() + 7 >> 3);
|
|
1384
|
+
}, r.prototype.generateAsync = function(t, e, i) {
|
|
1385
|
+
var n = new rt(), s = t >> 1;
|
|
1386
|
+
this.e = parseInt(e, 16);
|
|
1387
|
+
var o = new v(e, 16), h = this, f = function() {
|
|
1388
|
+
var u = function() {
|
|
1389
|
+
if (h.p.compareTo(h.q) <= 0) {
|
|
1390
|
+
var g = h.p;
|
|
1391
|
+
h.p = h.q, h.q = g;
|
|
1392
|
+
}
|
|
1393
|
+
var p = h.p.subtract(v.ONE), S = h.q.subtract(v.ONE), m = p.multiply(S);
|
|
1394
|
+
m.gcd(o).compareTo(v.ONE) == 0 ? (h.n = h.p.multiply(h.q), h.d = o.modInverse(m), h.dmp1 = h.d.mod(p), h.dmq1 = h.d.mod(S), h.coeff = h.q.modInverse(h.p), setTimeout(function() {
|
|
1395
|
+
i();
|
|
1396
|
+
}, 0)) : setTimeout(f, 0);
|
|
1397
|
+
}, l = function() {
|
|
1398
|
+
h.q = d(), h.q.fromNumberAsync(s, 1, n, function() {
|
|
1399
|
+
h.q.subtract(v.ONE).gcda(o, function(g) {
|
|
1400
|
+
g.compareTo(v.ONE) == 0 && h.q.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(l, 0);
|
|
1401
|
+
});
|
|
1402
|
+
});
|
|
1403
|
+
}, c = function() {
|
|
1404
|
+
h.p = d(), h.p.fromNumberAsync(t - s, 1, n, function() {
|
|
1405
|
+
h.p.subtract(v.ONE).gcda(o, function(g) {
|
|
1406
|
+
g.compareTo(v.ONE) == 0 && h.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(c, 0);
|
|
1407
|
+
});
|
|
1408
|
+
});
|
|
1409
|
+
};
|
|
1410
|
+
setTimeout(c, 0);
|
|
1411
|
+
};
|
|
1412
|
+
setTimeout(f, 0);
|
|
1413
|
+
}, r.prototype.sign = function(t, e, i) {
|
|
1414
|
+
var n = he(i), s = n + e(t).toString(), o = this.n.bitLength() / 4, h = ee(s, o);
|
|
1415
|
+
if (h == null)
|
|
1416
|
+
return null;
|
|
1417
|
+
var f = this.doPrivate(h);
|
|
1418
|
+
if (f == null)
|
|
1419
|
+
return null;
|
|
1420
|
+
for (var u = f.toString(16), l = u.length, c = 0; c < o - l; c++)
|
|
1421
|
+
u = "0" + u;
|
|
1422
|
+
return u;
|
|
1423
|
+
}, r.prototype.verify = function(t, e, i) {
|
|
1424
|
+
var n = b(e, 16), s = this.doPublic(n);
|
|
1425
|
+
if (s == null)
|
|
1426
|
+
return null;
|
|
1427
|
+
var o = s.toString(16).replace(/^1f+00/, ""), h = fe(o);
|
|
1428
|
+
return h == i(t).toString();
|
|
1429
|
+
}, r;
|
|
1430
|
+
})()
|
|
1431
|
+
);
|
|
1432
|
+
function oe(r, t) {
|
|
1433
|
+
for (var e = r.toByteArray(), i = 0; i < e.length && e[i] == 0; )
|
|
1434
|
+
++i;
|
|
1435
|
+
if (e.length - i != t - 1 || e[i] != 2)
|
|
1436
|
+
return null;
|
|
1437
|
+
for (++i; e[i] != 0; )
|
|
1438
|
+
if (++i >= e.length)
|
|
1439
|
+
return null;
|
|
1440
|
+
for (var n = ""; ++i < e.length; ) {
|
|
1441
|
+
var s = e[i] & 255;
|
|
1442
|
+
s < 128 ? n += String.fromCharCode(s) : s > 191 && s < 224 ? (n += String.fromCharCode((s & 31) << 6 | e[i + 1] & 63), ++i) : (n += String.fromCharCode((s & 15) << 12 | (e[i + 1] & 63) << 6 | e[i + 2] & 63), i += 2);
|
|
1443
|
+
}
|
|
1444
|
+
return n;
|
|
1445
|
+
}
|
|
1446
|
+
var it = {
|
|
1447
|
+
md2: "3020300c06082a864886f70d020205000410",
|
|
1448
|
+
md5: "3020300c06082a864886f70d020505000410",
|
|
1449
|
+
sha1: "3021300906052b0e03021a05000414",
|
|
1450
|
+
sha224: "302d300d06096086480165030402040500041c",
|
|
1451
|
+
sha256: "3031300d060960864801650304020105000420",
|
|
1452
|
+
sha384: "3041300d060960864801650304020205000430",
|
|
1453
|
+
sha512: "3051300d060960864801650304020305000440",
|
|
1454
|
+
ripemd160: "3021300906052b2403020105000414"
|
|
1455
|
+
};
|
|
1456
|
+
function he(r) {
|
|
1457
|
+
return it[r] || "";
|
|
1458
|
+
}
|
|
1459
|
+
function fe(r) {
|
|
1460
|
+
for (var t in it)
|
|
1461
|
+
if (it.hasOwnProperty(t)) {
|
|
1462
|
+
var e = it[t], i = e.length;
|
|
1463
|
+
if (r.substring(0, i) == e)
|
|
1464
|
+
return r.substring(i);
|
|
1465
|
+
}
|
|
1466
|
+
return r;
|
|
1467
|
+
}
|
|
1468
|
+
function T(r, t, e) {
|
|
1469
|
+
if (!t || !r)
|
|
1470
|
+
throw new Error("extend failed, please check that all dependencies are included.");
|
|
1471
|
+
var i = function() {
|
|
1472
|
+
};
|
|
1473
|
+
i.prototype = t.prototype, r.prototype = new i(), r.prototype.constructor = r, r.superclass = t.prototype, t.prototype.constructor == Object.prototype.constructor && (t.prototype.constructor = t);
|
|
1474
|
+
}
|
|
1475
|
+
var a = {};
|
|
1476
|
+
(typeof a.asn1 > "u" || !a.asn1) && (a.asn1 = {});
|
|
1477
|
+
a.asn1.ASN1Util = new function() {
|
|
1478
|
+
this.integerToByteHex = function(r) {
|
|
1479
|
+
var t = r.toString(16);
|
|
1480
|
+
return t.length % 2 == 1 && (t = "0" + t), t;
|
|
1481
|
+
}, this.bigIntToMinTwosComplementsHex = function(r) {
|
|
1482
|
+
var t = r.toString(16);
|
|
1483
|
+
if (t.substring(0, 1) != "-")
|
|
1484
|
+
t.length % 2 == 1 ? t = "0" + t : t.match(/^[0-7]/) || (t = "00" + t);
|
|
1485
|
+
else {
|
|
1486
|
+
var e = t.substring(1), i = e.length;
|
|
1487
|
+
i % 2 == 1 ? i += 1 : t.match(/^[0-7]/) || (i += 2);
|
|
1488
|
+
for (var n = "", s = 0; s < i; s++)
|
|
1489
|
+
n += "f";
|
|
1490
|
+
var o = new v(n, 16), h = o.xor(r).add(v.ONE);
|
|
1491
|
+
t = h.toString(16).replace(/^-/, "");
|
|
1492
|
+
}
|
|
1493
|
+
return t;
|
|
1494
|
+
}, this.getPEMStringFromHex = function(r, t) {
|
|
1495
|
+
return hextopem(r, t);
|
|
1496
|
+
}, this.newObject = function(r) {
|
|
1497
|
+
var t = a, e = t.asn1, i = e.DERBoolean, n = e.DERInteger, s = e.DERBitString, o = e.DEROctetString, h = e.DERNull, f = e.DERObjectIdentifier, u = e.DEREnumerated, l = e.DERUTF8String, c = e.DERNumericString, g = e.DERPrintableString, p = e.DERTeletexString, S = e.DERIA5String, m = e.DERUTCTime, D = e.DERGeneralizedTime, M = e.DERSequence, B = e.DERSet, q = e.DERTaggedObject, J = e.ASN1Util.newObject, ct = Object.keys(r);
|
|
1498
|
+
if (ct.length != 1)
|
|
1499
|
+
throw "key of param shall be only one.";
|
|
1500
|
+
var y = ct[0];
|
|
1501
|
+
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + y + ":") == -1)
|
|
1502
|
+
throw "undefined key: " + y;
|
|
1503
|
+
if (y == "bool")
|
|
1504
|
+
return new i(r[y]);
|
|
1505
|
+
if (y == "int")
|
|
1506
|
+
return new n(r[y]);
|
|
1507
|
+
if (y == "bitstr")
|
|
1508
|
+
return new s(r[y]);
|
|
1509
|
+
if (y == "octstr")
|
|
1510
|
+
return new o(r[y]);
|
|
1511
|
+
if (y == "null")
|
|
1512
|
+
return new h(r[y]);
|
|
1513
|
+
if (y == "oid")
|
|
1514
|
+
return new f(r[y]);
|
|
1515
|
+
if (y == "enum")
|
|
1516
|
+
return new u(r[y]);
|
|
1517
|
+
if (y == "utf8str")
|
|
1518
|
+
return new l(r[y]);
|
|
1519
|
+
if (y == "numstr")
|
|
1520
|
+
return new c(r[y]);
|
|
1521
|
+
if (y == "prnstr")
|
|
1522
|
+
return new g(r[y]);
|
|
1523
|
+
if (y == "telstr")
|
|
1524
|
+
return new p(r[y]);
|
|
1525
|
+
if (y == "ia5str")
|
|
1526
|
+
return new S(r[y]);
|
|
1527
|
+
if (y == "utctime")
|
|
1528
|
+
return new m(r[y]);
|
|
1529
|
+
if (y == "gentime")
|
|
1530
|
+
return new D(r[y]);
|
|
1531
|
+
if (y == "seq") {
|
|
1532
|
+
for (var j = r[y], z = [], C = 0; C < j.length; C++) {
|
|
1533
|
+
var st = J(j[C]);
|
|
1534
|
+
z.push(st);
|
|
1535
|
+
}
|
|
1536
|
+
return new M({ array: z });
|
|
1537
|
+
}
|
|
1538
|
+
if (y == "set") {
|
|
1539
|
+
for (var j = r[y], z = [], C = 0; C < j.length; C++) {
|
|
1540
|
+
var st = J(j[C]);
|
|
1541
|
+
z.push(st);
|
|
1542
|
+
}
|
|
1543
|
+
return new B({ array: z });
|
|
1544
|
+
}
|
|
1545
|
+
if (y == "tag") {
|
|
1546
|
+
var R = r[y];
|
|
1547
|
+
if (Object.prototype.toString.call(R) === "[object Array]" && R.length == 3) {
|
|
1548
|
+
var It = J(R[2]);
|
|
1549
|
+
return new q({
|
|
1550
|
+
tag: R[0],
|
|
1551
|
+
explicit: R[1],
|
|
1552
|
+
obj: It
|
|
1553
|
+
});
|
|
1554
|
+
} else {
|
|
1555
|
+
var $ = {};
|
|
1556
|
+
if (R.explicit !== void 0 && ($.explicit = R.explicit), R.tag !== void 0 && ($.tag = R.tag), R.obj === void 0)
|
|
1557
|
+
throw "obj shall be specified for 'tag'.";
|
|
1558
|
+
return $.obj = J(R.obj), new q($);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
}, this.jsonToASN1HEX = function(r) {
|
|
1562
|
+
var t = this.newObject(r);
|
|
1563
|
+
return t.getEncodedHex();
|
|
1564
|
+
};
|
|
1565
|
+
}();
|
|
1566
|
+
a.asn1.ASN1Util.oidHexToInt = function(r) {
|
|
1567
|
+
for (var n = "", t = parseInt(r.substring(0, 2), 16), e = Math.floor(t / 40), i = t % 40, n = e + "." + i, s = "", o = 2; o < r.length; o += 2) {
|
|
1568
|
+
var h = parseInt(r.substring(o, o + 2), 16), f = ("00000000" + h.toString(2)).slice(-8);
|
|
1569
|
+
if (s = s + f.substring(1, 8), f.substring(0, 1) == "0") {
|
|
1570
|
+
var u = new v(s, 2);
|
|
1571
|
+
n = n + "." + u.toString(10), s = "";
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
return n;
|
|
1575
|
+
};
|
|
1576
|
+
a.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
1577
|
+
var t = function(h) {
|
|
1578
|
+
var f = h.toString(16);
|
|
1579
|
+
return f.length == 1 && (f = "0" + f), f;
|
|
1580
|
+
}, e = function(h) {
|
|
1581
|
+
var f = "", u = new v(h, 10), l = u.toString(2), c = 7 - l.length % 7;
|
|
1582
|
+
c == 7 && (c = 0);
|
|
1583
|
+
for (var g = "", p = 0; p < c; p++)
|
|
1584
|
+
g += "0";
|
|
1585
|
+
l = g + l;
|
|
1586
|
+
for (var p = 0; p < l.length - 1; p += 7) {
|
|
1587
|
+
var S = l.substring(p, p + 7);
|
|
1588
|
+
p != l.length - 7 && (S = "1" + S), f += t(parseInt(S, 2));
|
|
1589
|
+
}
|
|
1590
|
+
return f;
|
|
1591
|
+
};
|
|
1592
|
+
if (!r.match(/^[0-9.]+$/))
|
|
1593
|
+
throw "malformed oid string: " + r;
|
|
1594
|
+
var i = "", n = r.split("."), s = parseInt(n[0]) * 40 + parseInt(n[1]);
|
|
1595
|
+
i += t(s), n.splice(0, 2);
|
|
1596
|
+
for (var o = 0; o < n.length; o++)
|
|
1597
|
+
i += e(n[o]);
|
|
1598
|
+
return i;
|
|
1599
|
+
};
|
|
1600
|
+
a.asn1.ASN1Object = function() {
|
|
1601
|
+
var r = "";
|
|
1602
|
+
this.getLengthHexFromValue = function() {
|
|
1603
|
+
if (typeof this.hV > "u" || this.hV == null)
|
|
1604
|
+
throw "this.hV is null or undefined.";
|
|
1605
|
+
if (this.hV.length % 2 == 1)
|
|
1606
|
+
throw "value hex must be even length: n=" + r.length + ",v=" + this.hV;
|
|
1607
|
+
var t = this.hV.length / 2, e = t.toString(16);
|
|
1608
|
+
if (e.length % 2 == 1 && (e = "0" + e), t < 128)
|
|
1609
|
+
return e;
|
|
1610
|
+
var i = e.length / 2;
|
|
1611
|
+
if (i > 15)
|
|
1612
|
+
throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
|
|
1613
|
+
var n = 128 + i;
|
|
1614
|
+
return n.toString(16) + e;
|
|
1615
|
+
}, this.getEncodedHex = function() {
|
|
1616
|
+
return (this.hTLV == null || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;
|
|
1617
|
+
}, this.getValueHex = function() {
|
|
1618
|
+
return this.getEncodedHex(), this.hV;
|
|
1619
|
+
}, this.getFreshValueHex = function() {
|
|
1620
|
+
return "";
|
|
1621
|
+
};
|
|
1622
|
+
};
|
|
1623
|
+
a.asn1.DERAbstractString = function(r) {
|
|
1624
|
+
a.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
|
|
1625
|
+
return this.s;
|
|
1626
|
+
}, this.setString = function(t) {
|
|
1627
|
+
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s);
|
|
1628
|
+
}, this.setStringHex = function(t) {
|
|
1629
|
+
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t;
|
|
1630
|
+
}, this.getFreshValueHex = function() {
|
|
1631
|
+
return this.hV;
|
|
1632
|
+
}, typeof r < "u" && (typeof r == "string" ? this.setString(r) : typeof r.str < "u" ? this.setString(r.str) : typeof r.hex < "u" && this.setStringHex(r.hex));
|
|
1633
|
+
};
|
|
1634
|
+
T(a.asn1.DERAbstractString, a.asn1.ASN1Object);
|
|
1635
|
+
a.asn1.DERAbstractTime = function(r) {
|
|
1636
|
+
a.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
|
|
1637
|
+
utc = t.getTime() + t.getTimezoneOffset() * 6e4;
|
|
1638
|
+
var e = new Date(utc);
|
|
1639
|
+
return e;
|
|
1640
|
+
}, this.formatDate = function(t, e, i) {
|
|
1641
|
+
var n = this.zeroPadding, s = this.localDateToUTC(t), o = String(s.getFullYear());
|
|
1642
|
+
e == "utc" && (o = o.substring(2, 4));
|
|
1643
|
+
var h = n(String(s.getMonth() + 1), 2), f = n(String(s.getDate()), 2), u = n(String(s.getHours()), 2), l = n(String(s.getMinutes()), 2), c = n(String(s.getSeconds()), 2), g = o + h + f + u + l + c;
|
|
1644
|
+
if (i === !0) {
|
|
1645
|
+
var p = s.getMilliseconds();
|
|
1646
|
+
if (p != 0) {
|
|
1647
|
+
var S = n(String(p), 3);
|
|
1648
|
+
S = S.replace(/[0]+$/, ""), g = g + "." + S;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
return g + "Z";
|
|
1652
|
+
}, this.zeroPadding = function(t, e) {
|
|
1653
|
+
return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t;
|
|
1654
|
+
}, this.getString = function() {
|
|
1655
|
+
return this.s;
|
|
1656
|
+
}, this.setString = function(t) {
|
|
1657
|
+
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(t);
|
|
1658
|
+
}, this.setByDateValue = function(t, e, i, n, s, o) {
|
|
1659
|
+
var h = new Date(Date.UTC(t, e - 1, i, n, s, o, 0));
|
|
1660
|
+
this.setByDate(h);
|
|
1661
|
+
}, this.getFreshValueHex = function() {
|
|
1662
|
+
return this.hV;
|
|
1663
|
+
};
|
|
1664
|
+
};
|
|
1665
|
+
T(a.asn1.DERAbstractTime, a.asn1.ASN1Object);
|
|
1666
|
+
a.asn1.DERAbstractStructured = function(r) {
|
|
1667
|
+
a.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
|
|
1668
|
+
this.hTLV = null, this.isModified = !0, this.asn1Array = t;
|
|
1669
|
+
}, this.appendASN1Object = function(t) {
|
|
1670
|
+
this.hTLV = null, this.isModified = !0, this.asn1Array.push(t);
|
|
1671
|
+
}, this.asn1Array = new Array(), typeof r < "u" && typeof r.array < "u" && (this.asn1Array = r.array);
|
|
1672
|
+
};
|
|
1673
|
+
T(a.asn1.DERAbstractStructured, a.asn1.ASN1Object);
|
|
1674
|
+
a.asn1.DERBoolean = function() {
|
|
1675
|
+
a.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
|
|
1676
|
+
};
|
|
1677
|
+
T(a.asn1.DERBoolean, a.asn1.ASN1Object);
|
|
1678
|
+
a.asn1.DERInteger = function(r) {
|
|
1679
|
+
a.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
|
|
1680
|
+
this.hTLV = null, this.isModified = !0, this.hV = a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1681
|
+
}, this.setByInteger = function(t) {
|
|
1682
|
+
var e = new v(String(t), 10);
|
|
1683
|
+
this.setByBigInteger(e);
|
|
1684
|
+
}, this.setValueHex = function(t) {
|
|
1685
|
+
this.hV = t;
|
|
1686
|
+
}, this.getFreshValueHex = function() {
|
|
1687
|
+
return this.hV;
|
|
1688
|
+
}, typeof r < "u" && (typeof r.bigint < "u" ? this.setByBigInteger(r.bigint) : typeof r.int < "u" ? this.setByInteger(r.int) : typeof r == "number" ? this.setByInteger(r) : typeof r.hex < "u" && this.setValueHex(r.hex));
|
|
1689
|
+
};
|
|
1690
|
+
T(a.asn1.DERInteger, a.asn1.ASN1Object);
|
|
1691
|
+
a.asn1.DERBitString = function(r) {
|
|
1692
|
+
if (r !== void 0 && typeof r.obj < "u") {
|
|
1693
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1694
|
+
r.hex = "00" + t.getEncodedHex();
|
|
1695
|
+
}
|
|
1696
|
+
a.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
|
|
1697
|
+
this.hTLV = null, this.isModified = !0, this.hV = e;
|
|
1698
|
+
}, this.setUnusedBitsAndHexValue = function(e, i) {
|
|
1699
|
+
if (e < 0 || 7 < e)
|
|
1700
|
+
throw "unused bits shall be from 0 to 7: u = " + e;
|
|
1701
|
+
var n = "0" + e;
|
|
1702
|
+
this.hTLV = null, this.isModified = !0, this.hV = n + i;
|
|
1703
|
+
}, this.setByBinaryString = function(e) {
|
|
1704
|
+
e = e.replace(/0+$/, "");
|
|
1705
|
+
var i = 8 - e.length % 8;
|
|
1706
|
+
i == 8 && (i = 0);
|
|
1707
|
+
for (var n = 0; n <= i; n++)
|
|
1708
|
+
e += "0";
|
|
1709
|
+
for (var s = "", n = 0; n < e.length - 1; n += 8) {
|
|
1710
|
+
var o = e.substring(n, n + 8), h = parseInt(o, 2).toString(16);
|
|
1711
|
+
h.length == 1 && (h = "0" + h), s += h;
|
|
1712
|
+
}
|
|
1713
|
+
this.hTLV = null, this.isModified = !0, this.hV = "0" + i + s;
|
|
1714
|
+
}, this.setByBooleanArray = function(e) {
|
|
1715
|
+
for (var i = "", n = 0; n < e.length; n++)
|
|
1716
|
+
e[n] == !0 ? i += "1" : i += "0";
|
|
1717
|
+
this.setByBinaryString(i);
|
|
1718
|
+
}, this.newFalseArray = function(e) {
|
|
1719
|
+
for (var i = new Array(e), n = 0; n < e; n++)
|
|
1720
|
+
i[n] = !1;
|
|
1721
|
+
return i;
|
|
1722
|
+
}, this.getFreshValueHex = function() {
|
|
1723
|
+
return this.hV;
|
|
1724
|
+
}, typeof r < "u" && (typeof r == "string" && r.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(r) : typeof r.hex < "u" ? this.setHexValueIncludingUnusedBits(r.hex) : typeof r.bin < "u" ? this.setByBinaryString(r.bin) : typeof r.array < "u" && this.setByBooleanArray(r.array));
|
|
1725
|
+
};
|
|
1726
|
+
T(a.asn1.DERBitString, a.asn1.ASN1Object);
|
|
1727
|
+
a.asn1.DEROctetString = function(r) {
|
|
1728
|
+
if (r !== void 0 && typeof r.obj < "u") {
|
|
1729
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1730
|
+
r.hex = t.getEncodedHex();
|
|
1731
|
+
}
|
|
1732
|
+
a.asn1.DEROctetString.superclass.constructor.call(this, r), this.hT = "04";
|
|
1733
|
+
};
|
|
1734
|
+
T(a.asn1.DEROctetString, a.asn1.DERAbstractString);
|
|
1735
|
+
a.asn1.DERNull = function() {
|
|
1736
|
+
a.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
|
|
1737
|
+
};
|
|
1738
|
+
T(a.asn1.DERNull, a.asn1.ASN1Object);
|
|
1739
|
+
a.asn1.DERObjectIdentifier = function(r) {
|
|
1740
|
+
var t = function(i) {
|
|
1741
|
+
var n = i.toString(16);
|
|
1742
|
+
return n.length == 1 && (n = "0" + n), n;
|
|
1743
|
+
}, e = function(i) {
|
|
1744
|
+
var n = "", s = new v(i, 10), o = s.toString(2), h = 7 - o.length % 7;
|
|
1745
|
+
h == 7 && (h = 0);
|
|
1746
|
+
for (var f = "", u = 0; u < h; u++)
|
|
1747
|
+
f += "0";
|
|
1748
|
+
o = f + o;
|
|
1749
|
+
for (var u = 0; u < o.length - 1; u += 7) {
|
|
1750
|
+
var l = o.substring(u, u + 7);
|
|
1751
|
+
u != o.length - 7 && (l = "1" + l), n += t(parseInt(l, 2));
|
|
1752
|
+
}
|
|
1753
|
+
return n;
|
|
1754
|
+
};
|
|
1755
|
+
a.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(i) {
|
|
1756
|
+
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = i;
|
|
1757
|
+
}, this.setValueOidString = function(i) {
|
|
1758
|
+
if (!i.match(/^[0-9.]+$/))
|
|
1759
|
+
throw "malformed oid string: " + i;
|
|
1760
|
+
var n = "", s = i.split("."), o = parseInt(s[0]) * 40 + parseInt(s[1]);
|
|
1761
|
+
n += t(o), s.splice(0, 2);
|
|
1762
|
+
for (var h = 0; h < s.length; h++)
|
|
1763
|
+
n += e(s[h]);
|
|
1764
|
+
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n;
|
|
1765
|
+
}, this.setValueName = function(i) {
|
|
1766
|
+
var n = a.asn1.x509.OID.name2oid(i);
|
|
1767
|
+
if (n !== "")
|
|
1768
|
+
this.setValueOidString(n);
|
|
1769
|
+
else
|
|
1770
|
+
throw "DERObjectIdentifier oidName undefined: " + i;
|
|
1771
|
+
}, this.getFreshValueHex = function() {
|
|
1772
|
+
return this.hV;
|
|
1773
|
+
}, r !== void 0 && (typeof r == "string" ? r.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(r) : this.setValueName(r) : r.oid !== void 0 ? this.setValueOidString(r.oid) : r.hex !== void 0 ? this.setValueHex(r.hex) : r.name !== void 0 && this.setValueName(r.name));
|
|
1774
|
+
};
|
|
1775
|
+
T(a.asn1.DERObjectIdentifier, a.asn1.ASN1Object);
|
|
1776
|
+
a.asn1.DEREnumerated = function(r) {
|
|
1777
|
+
a.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
|
|
1778
|
+
this.hTLV = null, this.isModified = !0, this.hV = a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1779
|
+
}, this.setByInteger = function(t) {
|
|
1780
|
+
var e = new v(String(t), 10);
|
|
1781
|
+
this.setByBigInteger(e);
|
|
1782
|
+
}, this.setValueHex = function(t) {
|
|
1783
|
+
this.hV = t;
|
|
1784
|
+
}, this.getFreshValueHex = function() {
|
|
1785
|
+
return this.hV;
|
|
1786
|
+
}, typeof r < "u" && (typeof r.int < "u" ? this.setByInteger(r.int) : typeof r == "number" ? this.setByInteger(r) : typeof r.hex < "u" && this.setValueHex(r.hex));
|
|
1787
|
+
};
|
|
1788
|
+
T(a.asn1.DEREnumerated, a.asn1.ASN1Object);
|
|
1789
|
+
a.asn1.DERUTF8String = function(r) {
|
|
1790
|
+
a.asn1.DERUTF8String.superclass.constructor.call(this, r), this.hT = "0c";
|
|
1791
|
+
};
|
|
1792
|
+
T(a.asn1.DERUTF8String, a.asn1.DERAbstractString);
|
|
1793
|
+
a.asn1.DERNumericString = function(r) {
|
|
1794
|
+
a.asn1.DERNumericString.superclass.constructor.call(this, r), this.hT = "12";
|
|
1795
|
+
};
|
|
1796
|
+
T(a.asn1.DERNumericString, a.asn1.DERAbstractString);
|
|
1797
|
+
a.asn1.DERPrintableString = function(r) {
|
|
1798
|
+
a.asn1.DERPrintableString.superclass.constructor.call(this, r), this.hT = "13";
|
|
1799
|
+
};
|
|
1800
|
+
T(a.asn1.DERPrintableString, a.asn1.DERAbstractString);
|
|
1801
|
+
a.asn1.DERTeletexString = function(r) {
|
|
1802
|
+
a.asn1.DERTeletexString.superclass.constructor.call(this, r), this.hT = "14";
|
|
1803
|
+
};
|
|
1804
|
+
T(a.asn1.DERTeletexString, a.asn1.DERAbstractString);
|
|
1805
|
+
a.asn1.DERIA5String = function(r) {
|
|
1806
|
+
a.asn1.DERIA5String.superclass.constructor.call(this, r), this.hT = "16";
|
|
1807
|
+
};
|
|
1808
|
+
T(a.asn1.DERIA5String, a.asn1.DERAbstractString);
|
|
1809
|
+
a.asn1.DERUTCTime = function(r) {
|
|
1810
|
+
a.asn1.DERUTCTime.superclass.constructor.call(this, r), this.hT = "17", this.setByDate = function(t) {
|
|
1811
|
+
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
|
|
1812
|
+
}, this.getFreshValueHex = function() {
|
|
1813
|
+
return typeof this.date > "u" && typeof this.s > "u" && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
|
|
1814
|
+
}, r !== void 0 && (r.str !== void 0 ? this.setString(r.str) : typeof r == "string" && r.match(/^[0-9]{12}Z$/) ? this.setString(r) : r.hex !== void 0 ? this.setStringHex(r.hex) : r.date !== void 0 && this.setByDate(r.date));
|
|
1815
|
+
};
|
|
1816
|
+
T(a.asn1.DERUTCTime, a.asn1.DERAbstractTime);
|
|
1817
|
+
a.asn1.DERGeneralizedTime = function(r) {
|
|
1818
|
+
a.asn1.DERGeneralizedTime.superclass.constructor.call(this, r), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
|
|
1819
|
+
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
|
|
1820
|
+
}, this.getFreshValueHex = function() {
|
|
1821
|
+
return this.date === void 0 && this.s === void 0 && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
|
|
1822
|
+
}, r !== void 0 && (r.str !== void 0 ? this.setString(r.str) : typeof r == "string" && r.match(/^[0-9]{14}Z$/) ? this.setString(r) : r.hex !== void 0 ? this.setStringHex(r.hex) : r.date !== void 0 && this.setByDate(r.date), r.millis === !0 && (this.withMillis = !0));
|
|
1823
|
+
};
|
|
1824
|
+
T(a.asn1.DERGeneralizedTime, a.asn1.DERAbstractTime);
|
|
1825
|
+
a.asn1.DERSequence = function(r) {
|
|
1826
|
+
a.asn1.DERSequence.superclass.constructor.call(this, r), this.hT = "30", this.getFreshValueHex = function() {
|
|
1827
|
+
for (var t = "", e = 0; e < this.asn1Array.length; e++) {
|
|
1828
|
+
var i = this.asn1Array[e];
|
|
1829
|
+
t += i.getEncodedHex();
|
|
1830
|
+
}
|
|
1831
|
+
return this.hV = t, this.hV;
|
|
1832
|
+
};
|
|
1833
|
+
};
|
|
1834
|
+
T(a.asn1.DERSequence, a.asn1.DERAbstractStructured);
|
|
1835
|
+
a.asn1.DERSet = function(r) {
|
|
1836
|
+
a.asn1.DERSet.superclass.constructor.call(this, r), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
|
|
1837
|
+
for (var t = new Array(), e = 0; e < this.asn1Array.length; e++) {
|
|
1838
|
+
var i = this.asn1Array[e];
|
|
1839
|
+
t.push(i.getEncodedHex());
|
|
1840
|
+
}
|
|
1841
|
+
return this.sortFlag == !0 && t.sort(), this.hV = t.join(""), this.hV;
|
|
1842
|
+
}, typeof r < "u" && typeof r.sortflag < "u" && r.sortflag == !1 && (this.sortFlag = !1);
|
|
1843
|
+
};
|
|
1844
|
+
T(a.asn1.DERSet, a.asn1.DERAbstractStructured);
|
|
1845
|
+
a.asn1.DERTaggedObject = function(r) {
|
|
1846
|
+
a.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
|
|
1847
|
+
this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1);
|
|
1848
|
+
}, this.getFreshValueHex = function() {
|
|
1849
|
+
return this.hV;
|
|
1850
|
+
}, typeof r < "u" && (typeof r.tag < "u" && (this.hT = r.tag), typeof r.explicit < "u" && (this.isExplicit = r.explicit), typeof r.obj < "u" && (this.asn1Object = r.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
|
|
1851
|
+
};
|
|
1852
|
+
T(a.asn1.DERTaggedObject, a.asn1.ASN1Object);
|
|
1853
|
+
var ae = /* @__PURE__ */ (function() {
|
|
1854
|
+
var r = function(t, e) {
|
|
1855
|
+
return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
|
|
1856
|
+
i.__proto__ = n;
|
|
1857
|
+
} || function(i, n) {
|
|
1858
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (i[s] = n[s]);
|
|
1859
|
+
}, r(t, e);
|
|
1860
|
+
};
|
|
1861
|
+
return function(t, e) {
|
|
1862
|
+
if (typeof e != "function" && e !== null)
|
|
1863
|
+
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1864
|
+
r(t, e);
|
|
1865
|
+
function i() {
|
|
1866
|
+
this.constructor = t;
|
|
1867
|
+
}
|
|
1868
|
+
t.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i());
|
|
1869
|
+
};
|
|
1870
|
+
})(), Dt = (
|
|
1871
|
+
/** @class */
|
|
1872
|
+
(function(r) {
|
|
1873
|
+
ae(t, r);
|
|
1874
|
+
function t(e) {
|
|
1875
|
+
var i = r.call(this) || this;
|
|
1876
|
+
return e && (typeof e == "string" ? i.parseKey(e) : (t.hasPrivateKeyProperty(e) || t.hasPublicKeyProperty(e)) && i.parsePropertiesFrom(e)), i;
|
|
1877
|
+
}
|
|
1878
|
+
return t.prototype.parseKey = function(e) {
|
|
1879
|
+
try {
|
|
1880
|
+
var i = 0, n = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, o = s.test(e) ? Ct.decode(e) : at.unarmor(e), h = qt.decode(o);
|
|
1881
|
+
if (h.sub.length === 3 && (h = h.sub[2].sub[0]), h.sub.length === 9) {
|
|
1882
|
+
i = h.sub[1].getHexStringValue(), this.n = b(i, 16), n = h.sub[2].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1883
|
+
var f = h.sub[3].getHexStringValue();
|
|
1884
|
+
this.d = b(f, 16);
|
|
1885
|
+
var u = h.sub[4].getHexStringValue();
|
|
1886
|
+
this.p = b(u, 16);
|
|
1887
|
+
var l = h.sub[5].getHexStringValue();
|
|
1888
|
+
this.q = b(l, 16);
|
|
1889
|
+
var c = h.sub[6].getHexStringValue();
|
|
1890
|
+
this.dmp1 = b(c, 16);
|
|
1891
|
+
var g = h.sub[7].getHexStringValue();
|
|
1892
|
+
this.dmq1 = b(g, 16);
|
|
1893
|
+
var p = h.sub[8].getHexStringValue();
|
|
1894
|
+
this.coeff = b(p, 16);
|
|
1895
|
+
} else if (h.sub.length === 2)
|
|
1896
|
+
if (h.sub[0].sub) {
|
|
1897
|
+
var S = h.sub[1], m = S.sub[0];
|
|
1898
|
+
i = m.sub[0].getHexStringValue(), this.n = b(i, 16), n = m.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1899
|
+
} else
|
|
1900
|
+
i = h.sub[0].getHexStringValue(), this.n = b(i, 16), n = h.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1901
|
+
else
|
|
1902
|
+
return !1;
|
|
1903
|
+
return !0;
|
|
1904
|
+
} catch {
|
|
1905
|
+
return !1;
|
|
1906
|
+
}
|
|
1907
|
+
}, t.prototype.getPrivateBaseKey = function() {
|
|
1908
|
+
var e = {
|
|
1909
|
+
array: [
|
|
1910
|
+
new a.asn1.DERInteger({ int: 0 }),
|
|
1911
|
+
new a.asn1.DERInteger({ bigint: this.n }),
|
|
1912
|
+
new a.asn1.DERInteger({ int: this.e }),
|
|
1913
|
+
new a.asn1.DERInteger({ bigint: this.d }),
|
|
1914
|
+
new a.asn1.DERInteger({ bigint: this.p }),
|
|
1915
|
+
new a.asn1.DERInteger({ bigint: this.q }),
|
|
1916
|
+
new a.asn1.DERInteger({ bigint: this.dmp1 }),
|
|
1917
|
+
new a.asn1.DERInteger({ bigint: this.dmq1 }),
|
|
1918
|
+
new a.asn1.DERInteger({ bigint: this.coeff })
|
|
1919
|
+
]
|
|
1920
|
+
}, i = new a.asn1.DERSequence(e);
|
|
1921
|
+
return i.getEncodedHex();
|
|
1922
|
+
}, t.prototype.getPrivateBaseKeyB64 = function() {
|
|
1923
|
+
return Z(this.getPrivateBaseKey());
|
|
1924
|
+
}, t.prototype.getPublicBaseKey = function() {
|
|
1925
|
+
var e = new a.asn1.DERSequence({
|
|
1926
|
+
array: [
|
|
1927
|
+
new a.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }),
|
|
1928
|
+
// RSA Encryption pkcs #1 oid
|
|
1929
|
+
new a.asn1.DERNull()
|
|
1930
|
+
]
|
|
1931
|
+
}), i = new a.asn1.DERSequence({
|
|
1932
|
+
array: [
|
|
1933
|
+
new a.asn1.DERInteger({ bigint: this.n }),
|
|
1934
|
+
new a.asn1.DERInteger({ int: this.e })
|
|
1935
|
+
]
|
|
1936
|
+
}), n = new a.asn1.DERBitString({
|
|
1937
|
+
hex: "00" + i.getEncodedHex()
|
|
1938
|
+
}), s = new a.asn1.DERSequence({
|
|
1939
|
+
array: [e, n]
|
|
1940
|
+
});
|
|
1941
|
+
return s.getEncodedHex();
|
|
1942
|
+
}, t.prototype.getPublicBaseKeyB64 = function() {
|
|
1943
|
+
return Z(this.getPublicBaseKey());
|
|
1944
|
+
}, t.wordwrap = function(e, i) {
|
|
1945
|
+
if (i = i || 64, !e)
|
|
1946
|
+
return e;
|
|
1947
|
+
var n = "(.{1," + i + `})( +|$
|
|
1948
|
+
?)|(.{1,` + i + "})";
|
|
1949
|
+
return e.match(RegExp(n, "g")).join(`
|
|
1950
|
+
`);
|
|
1951
|
+
}, t.prototype.getPrivateKey = function() {
|
|
1952
|
+
var e = `-----BEGIN RSA PRIVATE KEY-----
|
|
1953
|
+
`;
|
|
1954
|
+
return e += t.wordwrap(this.getPrivateBaseKeyB64()) + `
|
|
1955
|
+
`, e += "-----END RSA PRIVATE KEY-----", e;
|
|
1956
|
+
}, t.prototype.getPublicKey = function() {
|
|
1957
|
+
var e = `-----BEGIN PUBLIC KEY-----
|
|
1958
|
+
`;
|
|
1959
|
+
return e += t.wordwrap(this.getPublicBaseKeyB64()) + `
|
|
1960
|
+
`, e += "-----END PUBLIC KEY-----", e;
|
|
1961
|
+
}, t.hasPublicKeyProperty = function(e) {
|
|
1962
|
+
return e = e || {}, e.hasOwnProperty("n") && e.hasOwnProperty("e");
|
|
1963
|
+
}, t.hasPrivateKeyProperty = function(e) {
|
|
1964
|
+
return e = e || {}, e.hasOwnProperty("n") && e.hasOwnProperty("e") && e.hasOwnProperty("d") && e.hasOwnProperty("p") && e.hasOwnProperty("q") && e.hasOwnProperty("dmp1") && e.hasOwnProperty("dmq1") && e.hasOwnProperty("coeff");
|
|
1965
|
+
}, t.prototype.parsePropertiesFrom = function(e) {
|
|
1966
|
+
this.n = e.n, this.e = e.e, e.hasOwnProperty("d") && (this.d = e.d, this.p = e.p, this.q = e.q, this.dmp1 = e.dmp1, this.dmq1 = e.dmq1, this.coeff = e.coeff);
|
|
1967
|
+
}, t;
|
|
1968
|
+
})(se)
|
|
1969
|
+
), ft, ue = typeof process < "u" ? (ft = process.env) === null || ft === void 0 ? void 0 : ft.npm_package_version : void 0, le = (
|
|
1970
|
+
/** @class */
|
|
1971
|
+
(function() {
|
|
1972
|
+
function r(t) {
|
|
1973
|
+
t === void 0 && (t = {}), this.default_key_size = t.default_key_size ? parseInt(t.default_key_size, 10) : 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = t.key || null;
|
|
1974
|
+
}
|
|
1975
|
+
return r.prototype.setKey = function(t) {
|
|
1976
|
+
t ? (this.log && this.key, this.key = new Dt(t)) : !this.key && this.log;
|
|
1977
|
+
}, r.prototype.setPrivateKey = function(t) {
|
|
1978
|
+
this.setKey(t);
|
|
1979
|
+
}, r.prototype.setPublicKey = function(t) {
|
|
1980
|
+
this.setKey(t);
|
|
1981
|
+
}, r.prototype.decrypt = function(t) {
|
|
1982
|
+
try {
|
|
1983
|
+
return this.getKey().decrypt(gt(t));
|
|
1984
|
+
} catch {
|
|
1985
|
+
return !1;
|
|
1986
|
+
}
|
|
1987
|
+
}, r.prototype.encrypt = function(t) {
|
|
1988
|
+
try {
|
|
1989
|
+
return Z(this.getKey().encrypt(t));
|
|
1990
|
+
} catch {
|
|
1991
|
+
return !1;
|
|
1992
|
+
}
|
|
1993
|
+
}, r.prototype.encryptOAEP = function(t) {
|
|
1994
|
+
try {
|
|
1995
|
+
return Z(this.getKey().encrypt(t, ne));
|
|
1996
|
+
} catch {
|
|
1997
|
+
return !1;
|
|
1998
|
+
}
|
|
1999
|
+
}, r.prototype.sign = function(t, e, i) {
|
|
2000
|
+
e === void 0 && (e = function(n) {
|
|
2001
|
+
return n;
|
|
2002
|
+
}), i === void 0 && (i = "");
|
|
2003
|
+
try {
|
|
2004
|
+
return Z(this.getKey().sign(t, e, i));
|
|
2005
|
+
} catch {
|
|
2006
|
+
return !1;
|
|
2007
|
+
}
|
|
2008
|
+
}, r.prototype.signSha256 = function(t) {
|
|
2009
|
+
return this.sign(t, function(e) {
|
|
2010
|
+
return Et(ut(e));
|
|
2011
|
+
}, "sha256");
|
|
2012
|
+
}, r.prototype.verify = function(t, e, i) {
|
|
2013
|
+
i === void 0 && (i = function(n) {
|
|
2014
|
+
return n;
|
|
2015
|
+
});
|
|
2016
|
+
try {
|
|
2017
|
+
return this.getKey().verify(t, gt(e), i);
|
|
2018
|
+
} catch {
|
|
2019
|
+
return !1;
|
|
2020
|
+
}
|
|
2021
|
+
}, r.prototype.verifySha256 = function(t, e) {
|
|
2022
|
+
return this.verify(t, e, function(i) {
|
|
2023
|
+
return Et(ut(i));
|
|
2024
|
+
});
|
|
2025
|
+
}, r.prototype.getKey = function(t) {
|
|
2026
|
+
if (!this.key) {
|
|
2027
|
+
if (this.key = new Dt(), t && {}.toString.call(t) === "[object Function]") {
|
|
2028
|
+
this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
this.key.generate(this.default_key_size, this.default_public_exponent);
|
|
2032
|
+
}
|
|
2033
|
+
return this.key;
|
|
2034
|
+
}, r.prototype.getPrivateKey = function() {
|
|
2035
|
+
return this.getKey().getPrivateKey();
|
|
2036
|
+
}, r.prototype.getPrivateKeyB64 = function() {
|
|
2037
|
+
return this.getKey().getPrivateBaseKeyB64();
|
|
2038
|
+
}, r.prototype.getPublicKey = function() {
|
|
2039
|
+
return this.getKey().getPublicKey();
|
|
2040
|
+
}, r.prototype.getPublicKeyB64 = function() {
|
|
2041
|
+
return this.getKey().getPublicBaseKeyB64();
|
|
2042
|
+
}, r.version = ue, r;
|
|
2043
|
+
})()
|
|
2044
|
+
);
|
|
2045
|
+
const ce = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApmTqXPG9vBsvUS2cmzdboGWL3vnqBlQ6PNdz8y5UxHe7lH8PyyZaquyNDS4BG00g8Yo1jF2I5Kg8jDd6+KLggKCL9xQSQUouU5nU3XAPnyCHS05oi6h7zaH7pP97DcovNsW5sEblncsMm0Xu9AcNHszIlSiX9fDJqi+bIyELyPWCw4QDmPToB+DsrVXxmUqPKxkjqb4yFghWDZY7nNVK28ra8i9KFj9segH4ujGymCorNPY8f8nEIe2+oxrb+dXGv5xmaBfwi/q7EEyMdzTkSDgUnExnkIhJ+Ki43u9cFFMU94noIsOzmFWJ78JAkiG+I9dE2c0XZx4Asm+tBgw+oQIDAQAB";
|
|
2046
|
+
class U {
|
|
2047
|
+
static instance;
|
|
2048
|
+
encryptor;
|
|
2049
|
+
constructor() {
|
|
2050
|
+
this.encryptor = new le(), this.encryptor.setPublicKey(ce);
|
|
2051
|
+
}
|
|
2052
|
+
static getInstance() {
|
|
2053
|
+
return U.instance || (U.instance = new U()), U.instance;
|
|
2054
|
+
}
|
|
2055
|
+
encrypt(t) {
|
|
2056
|
+
const e = this.encryptor.encrypt(t);
|
|
2057
|
+
if (!e)
|
|
2058
|
+
throw new Error(`RSA 加密失败,数据: ${t.substring(0, 20)}...`);
|
|
2059
|
+
return e;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
const pe = U.getInstance();
|
|
2063
|
+
function ve(r) {
|
|
2064
|
+
try {
|
|
2065
|
+
if (!r)
|
|
2066
|
+
return null;
|
|
2067
|
+
const t = r.split(".");
|
|
2068
|
+
if (t.length !== 3)
|
|
2069
|
+
return null;
|
|
2070
|
+
const e = t[1];
|
|
2071
|
+
if (!e)
|
|
2072
|
+
return null;
|
|
2073
|
+
const i = e.replace(/-/g, "+").replace(/_/g, "/"), n = atob(i), s = decodeURIComponent(
|
|
2074
|
+
n.split("").map((o) => "%" + ("00" + o.charCodeAt(0).toString(16)).slice(-2)).join("")
|
|
2075
|
+
);
|
|
2076
|
+
return JSON.parse(s);
|
|
2077
|
+
} catch {
|
|
2078
|
+
return null;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
export {
|
|
2082
|
+
ve as p,
|
|
2083
|
+
pe as r
|
|
2084
|
+
};
|