ss-component-new 1.1.595 → 1.1.597
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/dist/{crypto-AruyYTHF.js → crypto-BRyGpjGR.js} +430 -503
- package/dist/{crypto-CyF3hwB4.cjs → crypto-CRbcEKIz.cjs} +11 -11
- package/dist/{index-CtKkkNVO.js → index-4me0w_d_.js} +1 -1
- package/dist/index-B-P2iW5F.cjs +1 -0
- package/dist/index-BFKRXrzQ.cjs +1 -0
- package/dist/{index--x1v2tVg.js → index-BIu-jTfc.js} +1 -1
- package/dist/index-BJi_ECqJ.cjs +1 -0
- package/dist/{index-kHf3YLFM.js → index-BOb-2bQ6.js} +1 -1
- package/dist/{index-OwBy9Gpy.js → index-BhIXAFkM.js} +4 -3
- package/dist/{index-ROm5ioP3.js → index-Bk3SowMg.js} +1 -1
- package/dist/{index-CaYc-fdU.cjs → index-BmX_GIIO.cjs} +1 -1
- package/dist/{index-QCZigjx6.js → index-Bq9zvPYq.js} +1 -1
- package/dist/{index-BNRTUsQy.js → index-BrR-UBrL.js} +2 -2
- package/dist/{index-CGjO9Rfc.js → index-BriwvEur.js} +1 -1
- package/dist/{index-DbfXZuSO.js → index-BurAdhpz.js} +2 -2
- package/dist/{index-kBwJORKQ.js → index-BxSBnCA1.js} +240 -238
- package/dist/{index-DulzcrfM.js → index-C1KIIGh8.js} +2 -2
- package/dist/{index-BCEAEGRT.js → index-C7x-mC0R.js} +82 -81
- package/dist/index-CATptFmj.cjs +1 -0
- package/dist/{index-DnfA7Rxr.cjs → index-CB4s2Qtu.cjs} +1 -1
- package/dist/{index-BEhahmXR.cjs → index-CUnz8HhY.cjs} +1 -1
- package/dist/{index-pPqGNFo4.cjs → index-CwYjbsHf.cjs} +1 -1
- package/dist/index-DFdkXYtv.js +4373 -0
- package/dist/{index-BDyEsCzC.cjs → index-DHuIlYC1.cjs} +1 -1
- package/dist/index-DJc0EPc7.cjs +1 -0
- package/dist/{index-thv0_1C7.cjs → index-DSsJ2-ii.cjs} +1 -1
- package/dist/{index-Bn_QEmCm.cjs → index-DTKpspvK.cjs} +1 -1
- package/dist/index-DUjNOx49.cjs +1 -0
- package/dist/{index-DU7mec17.js → index-Db0lTu76.js} +1 -1
- package/dist/index-K05hKXiU.cjs +1 -0
- package/dist/{index-CoXYZaFu.cjs → index-P7MVl516.cjs} +1 -1
- package/dist/index-R71UAxtE.cjs +1 -0
- package/dist/{index-B_wxih7J.js → index-TRcS4V2m.js} +2 -2
- package/dist/{index-B8CqF9dV.js → index-Zt6huWXY.js} +4 -4
- package/dist/{index-CAFMHjaK.js → index-bALhgSe4.js} +22 -21
- package/dist/index-n20urAJT.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-DztskrHi.js → index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-C4KOyCan.js} +2 -2
- package/dist/index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-CHdcwZZm.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-DrVsYebD.js → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang--Ckdd4kI.js} +51 -51
- package/dist/{index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-CUaHvGT0.cjs → index.vue_vue_type_style_index_0_scoped_c4f9c92c_lang-DNiiRDF0.cjs} +10 -10
- package/dist/login-BBvcYktp.cjs +1 -0
- package/dist/login-afGmER0u.js +129 -0
- package/dist/{main-Bv6-X84h.js → main-BdwwE9kL.js} +2 -2
- package/dist/{main-BcnpB9rQ.cjs → main-CBruCFMa.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +3 -3
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/package.json +1 -1
- package/dist/index-BA2jgTGT.cjs +0 -1
- package/dist/index-BYIt5bNH.cjs +0 -1
- package/dist/index-Boa9Jb6y.cjs +0 -1
- package/dist/index-CNZyrawL.cjs +0 -1
- package/dist/index-CWYl8R8Z.cjs +0 -1
- package/dist/index-DMcamypJ.cjs +0 -1
- package/dist/index-DiRp2gT0.cjs +0 -1
- package/dist/index-Dl_vrtf5.cjs +0 -1
- package/dist/index-hsD4_RoH.cjs +0 -1
- package/dist/index-jNlKGITs.js +0 -4369
- package/dist/index.vue_vue_type_style_index_0_scoped_b9f960ef_lang-ooefAkbS.cjs +0 -1
- package/dist/menuIndex-BUbnVBfn.cjs +0 -1
- package/dist/menuIndex-w5mHOEmH.js +0 -60
|
@@ -1,138 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
import { f as Vt, g as Nt } from "./menuIndex-w5mHOEmH.js";
|
|
3
|
-
const Pt = It(Ot), { menus: Mt } = xt(Pt), oe = Dt("loginState", {
|
|
4
|
-
state: () => ({
|
|
5
|
-
superAdminInfo: {},
|
|
6
|
-
cryptoInfo: {
|
|
7
|
-
publicKey: "",
|
|
8
|
-
privateKey: ""
|
|
9
|
-
},
|
|
10
|
-
loginUserInfo: {},
|
|
11
|
-
structureData: [],
|
|
12
|
-
isStructureExist: !1
|
|
13
|
-
}),
|
|
14
|
-
actions: {
|
|
15
|
-
setSuperAdminInfo(r) {
|
|
16
|
-
this.superAdminInfo = r;
|
|
17
|
-
},
|
|
18
|
-
setLoginUserInfo(r) {
|
|
19
|
-
this.loginUserInfo = r;
|
|
20
|
-
},
|
|
21
|
-
setStructureData(r) {
|
|
22
|
-
this.structureData = r;
|
|
23
|
-
},
|
|
24
|
-
setIsStructureExist(r) {
|
|
25
|
-
this.isStructureExist = r;
|
|
26
|
-
},
|
|
27
|
-
async getModelSecretAsync(r) {
|
|
28
|
-
var e, i, n, s, h, o, a, f, l, p, v, y, S;
|
|
29
|
-
const t = await At({
|
|
30
|
-
key: {
|
|
31
|
-
systemKey: r ? r.systemKey : sessionStorage.getItem("systemKey"),
|
|
32
|
-
pageKey: "secret",
|
|
33
|
-
type: "system"
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.code) === 200 && (i = t == null ? void 0 : t.data) != null && i.result && Array.isArray((n = t == null ? void 0 : t.data) == null ? void 0 : n.result) && ((h = (s = t == null ? void 0 : t.data) == null ? void 0 : s.result) == null ? void 0 : h.length) > 0 && (this.cryptoInfo.publicKey = (l = (f = (a = (o = t.data) == null ? void 0 : o.result[0]) == null ? void 0 : a.value) == null ? void 0 : f.cryptoInfo) == null ? void 0 : l.publicKey, this.cryptoInfo.privateKey = (S = (y = (v = (p = t.data) == null ? void 0 : p.result[0]) == null ? void 0 : v.value) == null ? void 0 : y.cryptoInfo) == null ? void 0 : S.privateKey), {
|
|
37
|
-
publicKey: this.cryptoInfo.publicKey,
|
|
38
|
-
privateKey: this.cryptoInfo.privateKey
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
async setLogRecordAsync(r, t, e = "operate") {
|
|
42
|
-
var i;
|
|
43
|
-
try {
|
|
44
|
-
const n = Vt(Mt.value, "path", t, "children");
|
|
45
|
-
if (!n) return;
|
|
46
|
-
const s = await Rt({
|
|
47
|
-
key: {
|
|
48
|
-
systemKey: sessionStorage.getItem("systemKey"),
|
|
49
|
-
pageKey: "/log",
|
|
50
|
-
type: "system",
|
|
51
|
-
logType: e
|
|
52
|
-
},
|
|
53
|
-
value: {
|
|
54
|
-
module: n ? n.title : t,
|
|
55
|
-
timeStamp: Nt(),
|
|
56
|
-
detail: { ...r }
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return ((i = s == null ? void 0 : s.data) == null ? void 0 : i.code) === 200;
|
|
60
|
-
} catch (n) {
|
|
61
|
-
Bt.error(n);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
persist: [
|
|
66
|
-
{
|
|
67
|
-
key: "loginState",
|
|
68
|
-
storage: localStorage,
|
|
69
|
-
pick: ["superAdminInfo"]
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
});
|
|
73
|
-
var Kt = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
1
|
+
var Dt = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
74
2
|
function A(r) {
|
|
75
|
-
return
|
|
3
|
+
return Dt.charAt(r);
|
|
76
4
|
}
|
|
77
|
-
function
|
|
5
|
+
function xt(r, t) {
|
|
78
6
|
return r & t;
|
|
79
7
|
}
|
|
80
8
|
function Z(r, t) {
|
|
81
9
|
return r | t;
|
|
82
10
|
}
|
|
83
|
-
function
|
|
11
|
+
function ut(r, t) {
|
|
84
12
|
return r ^ t;
|
|
85
13
|
}
|
|
86
14
|
function lt(r, t) {
|
|
87
15
|
return r & ~t;
|
|
88
16
|
}
|
|
89
|
-
function
|
|
17
|
+
function Rt(r) {
|
|
90
18
|
if (r == 0)
|
|
91
19
|
return -1;
|
|
92
20
|
var t = 0;
|
|
93
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;
|
|
94
22
|
}
|
|
95
|
-
function
|
|
23
|
+
function Bt(r) {
|
|
96
24
|
for (var t = 0; r != 0; )
|
|
97
25
|
r &= r - 1, ++t;
|
|
98
26
|
return t;
|
|
99
27
|
}
|
|
100
|
-
var
|
|
28
|
+
var _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", mt = "=";
|
|
101
29
|
function W(r) {
|
|
102
30
|
var t, e, i = "";
|
|
103
31
|
for (t = 0; t + 3 <= r.length; t += 3)
|
|
104
|
-
e = parseInt(r.substring(t, t + 3), 16), i +=
|
|
105
|
-
for (t + 1 == r.length ? (e = parseInt(r.substring(t, t + 1), 16), i +=
|
|
106
|
-
i +=
|
|
32
|
+
e = parseInt(r.substring(t, t + 3), 16), i += _.charAt(e >> 6) + _.charAt(e & 63);
|
|
33
|
+
for (t + 1 == r.length ? (e = parseInt(r.substring(t, t + 1), 16), i += _.charAt(e << 2)) : t + 2 == r.length && (e = parseInt(r.substring(t, t + 2), 16), i += _.charAt(e >> 2) + _.charAt((e & 3) << 4)); (i.length & 3) > 0; )
|
|
34
|
+
i += mt;
|
|
107
35
|
return i;
|
|
108
36
|
}
|
|
109
37
|
function ct(r) {
|
|
110
38
|
var t = "", e, i = 0, n = 0;
|
|
111
|
-
for (e = 0; e < r.length && r.charAt(e) !=
|
|
112
|
-
var s =
|
|
39
|
+
for (e = 0; e < r.length && r.charAt(e) != mt; ++e) {
|
|
40
|
+
var s = _.indexOf(r.charAt(e));
|
|
113
41
|
s < 0 || (i == 0 ? (t += A(s >> 2), n = s & 3, i = 1) : i == 1 ? (t += A(n << 2 | s >> 4), n = s & 15, i = 2) : i == 2 ? (t += A(n), t += A(s >> 2), n = s & 3, i = 3) : (t += A(n << 2 | s >> 4), t += A(s & 15), i = 0));
|
|
114
42
|
}
|
|
115
43
|
return i == 1 && (t += A(n << 2)), t;
|
|
116
44
|
}
|
|
117
|
-
var
|
|
45
|
+
var H, At = {
|
|
118
46
|
decode: function(r) {
|
|
119
47
|
var t;
|
|
120
|
-
if (
|
|
48
|
+
if (H === void 0) {
|
|
121
49
|
var e = "0123456789ABCDEF", i = ` \f
|
|
122
50
|
\r \u2028\u2029`;
|
|
123
|
-
for (
|
|
124
|
-
|
|
51
|
+
for (H = {}, t = 0; t < 16; ++t)
|
|
52
|
+
H[e.charAt(t)] = t;
|
|
125
53
|
for (e = e.toLowerCase(), t = 10; t < 16; ++t)
|
|
126
|
-
|
|
54
|
+
H[e.charAt(t)] = t;
|
|
127
55
|
for (t = 0; t < i.length; ++t)
|
|
128
|
-
|
|
56
|
+
H[i.charAt(t)] = -1;
|
|
129
57
|
}
|
|
130
58
|
var n = [], s = 0, h = 0;
|
|
131
59
|
for (t = 0; t < r.length; ++t) {
|
|
132
60
|
var o = r.charAt(t);
|
|
133
61
|
if (o == "=")
|
|
134
62
|
break;
|
|
135
|
-
if (o =
|
|
63
|
+
if (o = H[o], o != -1) {
|
|
136
64
|
if (o === void 0)
|
|
137
65
|
throw new Error("Illegal character at offset " + t);
|
|
138
66
|
s |= o, ++h >= 2 ? (n[n.length] = s, s = 0, h = 0) : s <<= 4;
|
|
@@ -188,7 +116,7 @@ var q, _t = {
|
|
|
188
116
|
throw new Error("RegExp out of sync");
|
|
189
117
|
return ot.decode(r);
|
|
190
118
|
}
|
|
191
|
-
},
|
|
119
|
+
}, C = 1e13, j = (
|
|
192
120
|
/** @class */
|
|
193
121
|
function() {
|
|
194
122
|
function r(t) {
|
|
@@ -197,31 +125,31 @@ var q, _t = {
|
|
|
197
125
|
return r.prototype.mulAdd = function(t, e) {
|
|
198
126
|
var i = this.buf, n = i.length, s, h;
|
|
199
127
|
for (s = 0; s < n; ++s)
|
|
200
|
-
h = i[s] * t + e, h <
|
|
128
|
+
h = i[s] * t + e, h < C ? e = 0 : (e = 0 | h / C, h -= e * C), i[s] = h;
|
|
201
129
|
e > 0 && (i[s] = e);
|
|
202
130
|
}, r.prototype.sub = function(t) {
|
|
203
131
|
var e = this.buf, i = e.length, n, s;
|
|
204
132
|
for (n = 0; n < i; ++n)
|
|
205
|
-
s = e[n] - t, s < 0 ? (s +=
|
|
133
|
+
s = e[n] - t, s < 0 ? (s += C, t = 1) : t = 0, e[n] = s;
|
|
206
134
|
for (; e[e.length - 1] === 0; )
|
|
207
135
|
e.pop();
|
|
208
136
|
}, r.prototype.toString = function(t) {
|
|
209
137
|
if ((t || 10) != 10)
|
|
210
138
|
throw new Error("only base 10 is supported");
|
|
211
139
|
for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n)
|
|
212
|
-
i += (
|
|
140
|
+
i += (C + e[n]).toString().substring(1);
|
|
213
141
|
return i;
|
|
214
142
|
}, r.prototype.valueOf = function() {
|
|
215
143
|
for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i)
|
|
216
|
-
e = e *
|
|
144
|
+
e = e * C + t[i];
|
|
217
145
|
return e;
|
|
218
146
|
}, r.prototype.simplify = function() {
|
|
219
147
|
var t = this.buf;
|
|
220
148
|
return t.length == 1 ? t[0] : this;
|
|
221
149
|
}, r;
|
|
222
150
|
}()
|
|
223
|
-
), bt = "…",
|
|
224
|
-
function
|
|
151
|
+
), bt = "…", Ot = /^(\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)?)?$/, Vt = /^(\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 F(r, t) {
|
|
225
153
|
return r.length > t && (r = r.substring(0, t) + bt), r;
|
|
226
154
|
}
|
|
227
155
|
var rt = (
|
|
@@ -273,7 +201,7 @@ var rt = (
|
|
|
273
201
|
n = this.get(h++), s = this.get(h++), i += String.fromCharCode(n << 8 | s);
|
|
274
202
|
return i;
|
|
275
203
|
}, r.prototype.parseTime = function(t, e, i) {
|
|
276
|
-
var n = this.parseStringISO(t, e), s = (i ?
|
|
204
|
+
var n = this.parseStringISO(t, e), s = (i ? Ot : Vt).exec(n);
|
|
277
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;
|
|
278
206
|
}, r.prototype.parseInteger = function(t, e) {
|
|
279
207
|
for (var i = this.get(t), n = i > 127, s = n ? 255 : 0, h, o = ""; i == s && ++t < e; )
|
|
@@ -287,21 +215,21 @@ var rt = (
|
|
|
287
215
|
`;
|
|
288
216
|
}
|
|
289
217
|
n && (i = i - 256);
|
|
290
|
-
for (var
|
|
291
|
-
|
|
292
|
-
return o +
|
|
218
|
+
for (var f = new j(i), u = t + 1; u < e; ++u)
|
|
219
|
+
f.mulAdd(256, this.get(u));
|
|
220
|
+
return o + f.toString();
|
|
293
221
|
}, r.prototype.parseBitString = function(t, e, i) {
|
|
294
222
|
for (var n = this.get(t), s = (e - t - 1 << 3) - n, h = "(" + s + ` bit)
|
|
295
|
-
`, o = "",
|
|
296
|
-
for (var
|
|
297
|
-
o +=
|
|
223
|
+
`, o = "", f = t + 1; f < e; ++f) {
|
|
224
|
+
for (var u = this.get(f), l = f == e - 1 ? n : 0, g = 7; g >= l; --g)
|
|
225
|
+
o += u >> g & 1 ? "1" : "0";
|
|
298
226
|
if (o.length > i)
|
|
299
|
-
return h +
|
|
227
|
+
return h + F(o, i);
|
|
300
228
|
}
|
|
301
229
|
return h + o;
|
|
302
230
|
}, r.prototype.parseOctetString = function(t, e, i) {
|
|
303
231
|
if (this.isASCII(t, e))
|
|
304
|
-
return
|
|
232
|
+
return F(this.parseStringISO(t, e), i);
|
|
305
233
|
var n = e - t, s = "(" + n + ` byte)
|
|
306
234
|
`;
|
|
307
235
|
i /= 2, n > i && (e = t + i);
|
|
@@ -309,27 +237,27 @@ var rt = (
|
|
|
309
237
|
s += this.hexByte(this.get(h));
|
|
310
238
|
return n > i && (s += bt), s;
|
|
311
239
|
}, r.prototype.parseOID = function(t, e, i) {
|
|
312
|
-
for (var n = "", s = new
|
|
313
|
-
var
|
|
314
|
-
if (s.mulAdd(128,
|
|
240
|
+
for (var n = "", s = new j(), h = 0, o = t; o < e; ++o) {
|
|
241
|
+
var f = this.get(o);
|
|
242
|
+
if (s.mulAdd(128, f & 127), h += 7, !(f & 128)) {
|
|
315
243
|
if (n === "")
|
|
316
|
-
if (s = s.simplify(), s instanceof
|
|
244
|
+
if (s = s.simplify(), s instanceof j)
|
|
317
245
|
s.sub(80), n = "2." + s.toString();
|
|
318
246
|
else {
|
|
319
|
-
var
|
|
320
|
-
n =
|
|
247
|
+
var u = s < 80 ? s < 40 ? 0 : 1 : 2;
|
|
248
|
+
n = u + "." + (s - u * 40);
|
|
321
249
|
}
|
|
322
250
|
else
|
|
323
251
|
n += "." + s.toString();
|
|
324
252
|
if (n.length > i)
|
|
325
|
-
return
|
|
326
|
-
s = new
|
|
253
|
+
return F(n, i);
|
|
254
|
+
s = new j(), h = 0;
|
|
327
255
|
}
|
|
328
256
|
}
|
|
329
257
|
return h > 0 && (n += ".incomplete"), n;
|
|
330
258
|
}, r;
|
|
331
259
|
}()
|
|
332
|
-
),
|
|
260
|
+
), It = (
|
|
333
261
|
/** @class */
|
|
334
262
|
function() {
|
|
335
263
|
function r(t, e, i, n, s) {
|
|
@@ -438,7 +366,7 @@ var rt = (
|
|
|
438
366
|
case 17:
|
|
439
367
|
return this.sub !== null ? "(" + this.sub.length + " elem)" : "(no elem)";
|
|
440
368
|
case 12:
|
|
441
|
-
return
|
|
369
|
+
return F(this.stream.parseStringUTF(e, e + i), t);
|
|
442
370
|
case 18:
|
|
443
371
|
// NumericString
|
|
444
372
|
case 19:
|
|
@@ -451,9 +379,9 @@ var rt = (
|
|
|
451
379
|
// IA5String
|
|
452
380
|
// case 0x19: // GraphicString
|
|
453
381
|
case 26:
|
|
454
|
-
return
|
|
382
|
+
return F(this.stream.parseStringISO(e, e + i), t);
|
|
455
383
|
case 30:
|
|
456
|
-
return
|
|
384
|
+
return F(this.stream.parseStringBMP(e, e + i), t);
|
|
457
385
|
case 23:
|
|
458
386
|
// UTCTime
|
|
459
387
|
case 24:
|
|
@@ -498,12 +426,12 @@ var rt = (
|
|
|
498
426
|
}, r.decode = function(t) {
|
|
499
427
|
var e;
|
|
500
428
|
t instanceof rt ? e = t : e = new rt(t, 0);
|
|
501
|
-
var i = new rt(e), n = new pt(e), s = r.decodeLength(e), h = e.pos, o = h - i.pos,
|
|
502
|
-
var
|
|
429
|
+
var i = new rt(e), n = new pt(e), s = r.decodeLength(e), h = e.pos, o = h - i.pos, f = null, u = function() {
|
|
430
|
+
var g = [];
|
|
503
431
|
if (s !== null) {
|
|
504
|
-
for (var
|
|
505
|
-
|
|
506
|
-
if (e.pos !=
|
|
432
|
+
for (var d = h + s; e.pos < d; )
|
|
433
|
+
g[g.length] = r.decode(e);
|
|
434
|
+
if (e.pos != d)
|
|
507
435
|
throw new Error("Content size is not correct for container starting at offset " + h);
|
|
508
436
|
} else
|
|
509
437
|
try {
|
|
@@ -511,33 +439,33 @@ var rt = (
|
|
|
511
439
|
var y = r.decode(e);
|
|
512
440
|
if (y.tag.isEOC())
|
|
513
441
|
break;
|
|
514
|
-
|
|
442
|
+
g[g.length] = y;
|
|
515
443
|
}
|
|
516
444
|
s = h - e.pos;
|
|
517
|
-
} catch (
|
|
518
|
-
throw new Error("Exception while decoding undefined length content: " +
|
|
445
|
+
} catch (T) {
|
|
446
|
+
throw new Error("Exception while decoding undefined length content: " + T);
|
|
519
447
|
}
|
|
520
|
-
return
|
|
448
|
+
return g;
|
|
521
449
|
};
|
|
522
450
|
if (n.tagConstructed)
|
|
523
|
-
|
|
451
|
+
f = u();
|
|
524
452
|
else if (n.isUniversal() && (n.tagNumber == 3 || n.tagNumber == 4))
|
|
525
453
|
try {
|
|
526
454
|
if (n.tagNumber == 3 && e.get() != 0)
|
|
527
455
|
throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
|
|
528
|
-
|
|
529
|
-
for (var l = 0; l <
|
|
530
|
-
if (
|
|
456
|
+
f = u();
|
|
457
|
+
for (var l = 0; l < f.length; ++l)
|
|
458
|
+
if (f[l].tag.isEOC())
|
|
531
459
|
throw new Error("EOC is not supposed to be actual content.");
|
|
532
460
|
} catch {
|
|
533
|
-
|
|
461
|
+
f = null;
|
|
534
462
|
}
|
|
535
|
-
if (
|
|
463
|
+
if (f === null) {
|
|
536
464
|
if (s === null)
|
|
537
465
|
throw new Error("We can't skip over an invalid tag with undefined length at offset " + h);
|
|
538
466
|
e.pos = h + Math.abs(s);
|
|
539
467
|
}
|
|
540
|
-
return new r(i, o, s, n,
|
|
468
|
+
return new r(i, o, s, n, f);
|
|
541
469
|
}, r;
|
|
542
470
|
}()
|
|
543
471
|
), pt = (
|
|
@@ -546,7 +474,7 @@ var rt = (
|
|
|
546
474
|
function r(t) {
|
|
547
475
|
var e = t.get();
|
|
548
476
|
if (this.tagClass = e >> 6, this.tagConstructed = (e & 32) !== 0, this.tagNumber = e & 31, this.tagNumber == 31) {
|
|
549
|
-
var i = new
|
|
477
|
+
var i = new j();
|
|
550
478
|
do
|
|
551
479
|
e = t.get(), i.mulAdd(128, e & 127);
|
|
552
480
|
while (e & 128);
|
|
@@ -559,7 +487,7 @@ var rt = (
|
|
|
559
487
|
return this.tagClass === 0 && this.tagNumber === 0;
|
|
560
488
|
}, r;
|
|
561
489
|
}()
|
|
562
|
-
),
|
|
490
|
+
), I, Nt = 244837814094590, gt = (Nt & 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], Pt = (1 << 26) / w[w.length - 1], c = (
|
|
563
491
|
/** @class */
|
|
564
492
|
function() {
|
|
565
493
|
function r(t, e, i) {
|
|
@@ -581,13 +509,13 @@ var rt = (
|
|
|
581
509
|
e = 2;
|
|
582
510
|
else
|
|
583
511
|
return this.toRadix(t);
|
|
584
|
-
var i = (1 << e) - 1, n, s = !1, h = "", o = this.t,
|
|
512
|
+
var i = (1 << e) - 1, n, s = !1, h = "", o = this.t, f = this.DB - o * this.DB % e;
|
|
585
513
|
if (o-- > 0)
|
|
586
|
-
for (
|
|
587
|
-
|
|
514
|
+
for (f < this.DB && (n = this[o] >> f) > 0 && (s = !0, h = A(n)); o >= 0; )
|
|
515
|
+
f < e ? (n = (this[o] & (1 << f) - 1) << e - f, n |= this[--o] >> (f += this.DB - e)) : (n = this[o] >> (f -= e) & i, f <= 0 && (f += this.DB, --o)), n > 0 && (s = !0), s && (h += A(n));
|
|
588
516
|
return s ? h : "0";
|
|
589
517
|
}, r.prototype.negate = function() {
|
|
590
|
-
var t =
|
|
518
|
+
var t = p();
|
|
591
519
|
return r.ZERO.subTo(this, t), t;
|
|
592
520
|
}, r.prototype.abs = function() {
|
|
593
521
|
return this.s < 0 ? this.negate() : this;
|
|
@@ -605,13 +533,13 @@ var rt = (
|
|
|
605
533
|
}, r.prototype.bitLength = function() {
|
|
606
534
|
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + G(this[this.t - 1] ^ this.s & this.DM);
|
|
607
535
|
}, r.prototype.mod = function(t) {
|
|
608
|
-
var e =
|
|
536
|
+
var e = p();
|
|
609
537
|
return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(r.ZERO) > 0 && t.subTo(e, e), e;
|
|
610
538
|
}, r.prototype.modPowInt = function(t, e) {
|
|
611
539
|
var i;
|
|
612
540
|
return t < 256 || e.isEven() ? i = new vt(e) : i = new dt(e), this.exp(t, i);
|
|
613
541
|
}, r.prototype.clone = function() {
|
|
614
|
-
var t =
|
|
542
|
+
var t = p();
|
|
615
543
|
return this.copyTo(t), t;
|
|
616
544
|
}, r.prototype.intValue = function() {
|
|
617
545
|
if (this.s < 0) {
|
|
@@ -647,35 +575,35 @@ var rt = (
|
|
|
647
575
|
}, r.prototype.max = function(t) {
|
|
648
576
|
return this.compareTo(t) > 0 ? this : t;
|
|
649
577
|
}, r.prototype.and = function(t) {
|
|
650
|
-
var e =
|
|
651
|
-
return this.bitwiseTo(t,
|
|
578
|
+
var e = p();
|
|
579
|
+
return this.bitwiseTo(t, xt, e), e;
|
|
652
580
|
}, r.prototype.or = function(t) {
|
|
653
|
-
var e =
|
|
581
|
+
var e = p();
|
|
654
582
|
return this.bitwiseTo(t, Z, e), e;
|
|
655
583
|
}, r.prototype.xor = function(t) {
|
|
656
|
-
var e =
|
|
657
|
-
return this.bitwiseTo(t,
|
|
584
|
+
var e = p();
|
|
585
|
+
return this.bitwiseTo(t, ut, e), e;
|
|
658
586
|
}, r.prototype.andNot = function(t) {
|
|
659
|
-
var e =
|
|
587
|
+
var e = p();
|
|
660
588
|
return this.bitwiseTo(t, lt, e), e;
|
|
661
589
|
}, r.prototype.not = function() {
|
|
662
|
-
for (var t =
|
|
590
|
+
for (var t = p(), e = 0; e < this.t; ++e)
|
|
663
591
|
t[e] = this.DM & ~this[e];
|
|
664
592
|
return t.t = this.t, t.s = ~this.s, t;
|
|
665
593
|
}, r.prototype.shiftLeft = function(t) {
|
|
666
|
-
var e =
|
|
594
|
+
var e = p();
|
|
667
595
|
return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e;
|
|
668
596
|
}, r.prototype.shiftRight = function(t) {
|
|
669
|
-
var e =
|
|
597
|
+
var e = p();
|
|
670
598
|
return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e;
|
|
671
599
|
}, r.prototype.getLowestSetBit = function() {
|
|
672
600
|
for (var t = 0; t < this.t; ++t)
|
|
673
601
|
if (this[t] != 0)
|
|
674
|
-
return t * this.DB +
|
|
602
|
+
return t * this.DB + Rt(this[t]);
|
|
675
603
|
return this.s < 0 ? this.t * this.DB : -1;
|
|
676
604
|
}, r.prototype.bitCount = function() {
|
|
677
605
|
for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i)
|
|
678
|
-
t +=
|
|
606
|
+
t += Bt(this[i] ^ e);
|
|
679
607
|
return t;
|
|
680
608
|
}, r.prototype.testBit = function(t) {
|
|
681
609
|
var e = Math.floor(t / this.DB);
|
|
@@ -685,73 +613,73 @@ var rt = (
|
|
|
685
613
|
}, r.prototype.clearBit = function(t) {
|
|
686
614
|
return this.changeBit(t, lt);
|
|
687
615
|
}, r.prototype.flipBit = function(t) {
|
|
688
|
-
return this.changeBit(t,
|
|
616
|
+
return this.changeBit(t, ut);
|
|
689
617
|
}, r.prototype.add = function(t) {
|
|
690
|
-
var e =
|
|
618
|
+
var e = p();
|
|
691
619
|
return this.addTo(t, e), e;
|
|
692
620
|
}, r.prototype.subtract = function(t) {
|
|
693
|
-
var e =
|
|
621
|
+
var e = p();
|
|
694
622
|
return this.subTo(t, e), e;
|
|
695
623
|
}, r.prototype.multiply = function(t) {
|
|
696
|
-
var e =
|
|
624
|
+
var e = p();
|
|
697
625
|
return this.multiplyTo(t, e), e;
|
|
698
626
|
}, r.prototype.divide = function(t) {
|
|
699
|
-
var e =
|
|
627
|
+
var e = p();
|
|
700
628
|
return this.divRemTo(t, e, null), e;
|
|
701
629
|
}, r.prototype.remainder = function(t) {
|
|
702
|
-
var e =
|
|
630
|
+
var e = p();
|
|
703
631
|
return this.divRemTo(t, null, e), e;
|
|
704
632
|
}, r.prototype.divideAndRemainder = function(t) {
|
|
705
|
-
var e =
|
|
633
|
+
var e = p(), i = p();
|
|
706
634
|
return this.divRemTo(t, e, i), [e, i];
|
|
707
635
|
}, r.prototype.modPow = function(t, e) {
|
|
708
|
-
var i = t.bitLength(), n, s =
|
|
636
|
+
var i = t.bitLength(), n, s = O(1), h;
|
|
709
637
|
if (i <= 0)
|
|
710
638
|
return s;
|
|
711
|
-
i < 18 ? n = 1 : i < 48 ? n = 3 : i < 144 ? n = 4 : i < 768 ? n = 5 : n = 6, i < 8 ? h = new vt(e) : e.isEven() ? h = new
|
|
712
|
-
var o = [],
|
|
639
|
+
i < 18 ? n = 1 : i < 48 ? n = 3 : i < 144 ? n = 4 : i < 768 ? n = 5 : n = 6, i < 8 ? h = new vt(e) : e.isEven() ? h = new qt(e) : h = new dt(e);
|
|
640
|
+
var o = [], f = 3, u = n - 1, l = (1 << n) - 1;
|
|
713
641
|
if (o[1] = h.convert(this), n > 1) {
|
|
714
|
-
var
|
|
715
|
-
for (h.sqrTo(o[1],
|
|
716
|
-
o[
|
|
642
|
+
var g = p();
|
|
643
|
+
for (h.sqrTo(o[1], g); f <= l; )
|
|
644
|
+
o[f] = p(), h.mulTo(g, o[f - 2], o[f]), f += 2;
|
|
717
645
|
}
|
|
718
|
-
var
|
|
719
|
-
for (i = G(t[
|
|
720
|
-
for (i >=
|
|
721
|
-
y >>= 1, --
|
|
722
|
-
if ((i -=
|
|
723
|
-
o[y].copyTo(s),
|
|
646
|
+
var d = t.t - 1, y, T = !0, b = p(), E;
|
|
647
|
+
for (i = G(t[d]) - 1; d >= 0; ) {
|
|
648
|
+
for (i >= u ? y = t[d] >> i - u & l : (y = (t[d] & (1 << i + 1) - 1) << u - i, d > 0 && (y |= t[d - 1] >> this.DB + i - u)), f = n; (y & 1) == 0; )
|
|
649
|
+
y >>= 1, --f;
|
|
650
|
+
if ((i -= f) < 0 && (i += this.DB, --d), T)
|
|
651
|
+
o[y].copyTo(s), T = !1;
|
|
724
652
|
else {
|
|
725
|
-
for (;
|
|
726
|
-
h.sqrTo(s, b), h.sqrTo(b, s),
|
|
727
|
-
|
|
653
|
+
for (; f > 1; )
|
|
654
|
+
h.sqrTo(s, b), h.sqrTo(b, s), f -= 2;
|
|
655
|
+
f > 0 ? h.sqrTo(s, b) : (E = s, s = b, b = E), h.mulTo(b, o[y], s);
|
|
728
656
|
}
|
|
729
|
-
for (;
|
|
730
|
-
h.sqrTo(s, b), E = s, s = b, b = E, --i < 0 && (i = this.DB - 1, --
|
|
657
|
+
for (; d >= 0 && (t[d] & 1 << i) == 0; )
|
|
658
|
+
h.sqrTo(s, b), E = s, s = b, b = E, --i < 0 && (i = this.DB - 1, --d);
|
|
731
659
|
}
|
|
732
660
|
return h.revert(s);
|
|
733
661
|
}, r.prototype.modInverse = function(t) {
|
|
734
662
|
var e = t.isEven();
|
|
735
663
|
if (this.isEven() && e || t.signum() == 0)
|
|
736
664
|
return r.ZERO;
|
|
737
|
-
for (var i = t.clone(), n = this.clone(), s =
|
|
665
|
+
for (var i = t.clone(), n = this.clone(), s = O(1), h = O(0), o = O(0), f = O(1); i.signum() != 0; ) {
|
|
738
666
|
for (; i.isEven(); )
|
|
739
667
|
i.rShiftTo(1, i), e ? ((!s.isEven() || !h.isEven()) && (s.addTo(this, s), h.subTo(t, h)), s.rShiftTo(1, s)) : h.isEven() || h.subTo(t, h), h.rShiftTo(1, h);
|
|
740
668
|
for (; n.isEven(); )
|
|
741
|
-
n.rShiftTo(1, n), e ? ((!o.isEven() || !
|
|
742
|
-
i.compareTo(n) >= 0 ? (i.subTo(n, i), e && s.subTo(o, s), h.subTo(
|
|
669
|
+
n.rShiftTo(1, n), e ? ((!o.isEven() || !f.isEven()) && (o.addTo(this, o), f.subTo(t, f)), o.rShiftTo(1, o)) : f.isEven() || f.subTo(t, f), f.rShiftTo(1, f);
|
|
670
|
+
i.compareTo(n) >= 0 ? (i.subTo(n, i), e && s.subTo(o, s), h.subTo(f, h)) : (n.subTo(i, n), e && o.subTo(s, o), f.subTo(h, f));
|
|
743
671
|
}
|
|
744
672
|
if (n.compareTo(r.ONE) != 0)
|
|
745
673
|
return r.ZERO;
|
|
746
|
-
if (
|
|
747
|
-
return
|
|
748
|
-
if (
|
|
749
|
-
|
|
674
|
+
if (f.compareTo(t) >= 0)
|
|
675
|
+
return f.subtract(t);
|
|
676
|
+
if (f.signum() < 0)
|
|
677
|
+
f.addTo(t, f);
|
|
750
678
|
else
|
|
751
|
-
return
|
|
752
|
-
return
|
|
679
|
+
return f;
|
|
680
|
+
return f.signum() < 0 ? f.add(t) : f;
|
|
753
681
|
}, r.prototype.pow = function(t) {
|
|
754
|
-
return this.exp(t, new
|
|
682
|
+
return this.exp(t, new Mt());
|
|
755
683
|
}, r.prototype.gcd = function(t) {
|
|
756
684
|
var e = this.s < 0 ? this.negate() : this.clone(), i = t.s < 0 ? t.negate() : t.clone();
|
|
757
685
|
if (e.compareTo(i) < 0) {
|
|
@@ -775,7 +703,7 @@ var rt = (
|
|
|
775
703
|
if (i.isEven())
|
|
776
704
|
return !1;
|
|
777
705
|
for (e = 1; e < w.length; ) {
|
|
778
|
-
for (var n = w[e], s = e + 1; s < w.length && n <
|
|
706
|
+
for (var n = w[e], s = e + 1; s < w.length && n < Pt; )
|
|
779
707
|
n *= w[s++];
|
|
780
708
|
for (n = i.modInt(n); e < s; )
|
|
781
709
|
if (n % w[e++] == 0)
|
|
@@ -831,10 +759,10 @@ var rt = (
|
|
|
831
759
|
e[i - t] = this[i];
|
|
832
760
|
e.t = Math.max(this.t - t, 0), e.s = this.s;
|
|
833
761
|
}, r.prototype.lShiftTo = function(t, e) {
|
|
834
|
-
for (var i = t % this.DB, n = this.DB - i, s = (1 << n) - 1, h = Math.floor(t / this.DB), o = this.s << i & this.DM,
|
|
835
|
-
e[
|
|
836
|
-
for (var
|
|
837
|
-
e[
|
|
762
|
+
for (var i = t % this.DB, n = this.DB - i, s = (1 << n) - 1, h = Math.floor(t / this.DB), o = this.s << i & this.DM, f = this.t - 1; f >= 0; --f)
|
|
763
|
+
e[f + h + 1] = this[f] >> n | o, o = (this[f] & s) << i;
|
|
764
|
+
for (var f = h - 1; f >= 0; --f)
|
|
765
|
+
e[f] = 0;
|
|
838
766
|
e[h] = o, e.t = this.t + h + 1, e.s = this.s, e.clamp();
|
|
839
767
|
}, r.prototype.rShiftTo = function(t, e) {
|
|
840
768
|
e.s = this.s;
|
|
@@ -884,21 +812,21 @@ var rt = (
|
|
|
884
812
|
e != null && e.fromInt(0), i != null && this.copyTo(i);
|
|
885
813
|
return;
|
|
886
814
|
}
|
|
887
|
-
i == null && (i =
|
|
888
|
-
var h =
|
|
889
|
-
|
|
890
|
-
var l = h.t,
|
|
891
|
-
if (
|
|
892
|
-
var
|
|
815
|
+
i == null && (i = p());
|
|
816
|
+
var h = p(), o = this.s, f = t.s, u = this.DB - G(n[n.t - 1]);
|
|
817
|
+
u > 0 ? (n.lShiftTo(u, h), s.lShiftTo(u, i)) : (n.copyTo(h), s.copyTo(i));
|
|
818
|
+
var l = h.t, g = h[l - 1];
|
|
819
|
+
if (g != 0) {
|
|
820
|
+
var d = g * (1 << this.F1) + (l > 1 ? h[l - 2] >> this.F2 : 0), y = this.FV / d, T = (1 << this.F1) / d, b = 1 << this.F2, E = i.t, M = E - l, B = e ?? p();
|
|
893
821
|
for (h.dlShiftTo(M, B), i.compareTo(B) >= 0 && (i[i.t++] = 1, i.subTo(B, i)), r.ONE.dlShiftTo(l, B), B.subTo(h, h); h.t < l; )
|
|
894
822
|
h[h.t++] = 0;
|
|
895
823
|
for (; --M >= 0; ) {
|
|
896
|
-
var
|
|
897
|
-
if ((i[E] += h.am(0,
|
|
898
|
-
for (h.dlShiftTo(M, B), i.subTo(B, i); i[E] < --
|
|
824
|
+
var q = i[--E] == g ? this.DM : Math.floor(i[E] * y + (i[E - 1] + b) * T);
|
|
825
|
+
if ((i[E] += h.am(0, q, i, M, 0, l)) < q)
|
|
826
|
+
for (h.dlShiftTo(M, B), i.subTo(B, i); i[E] < --q; )
|
|
899
827
|
i.subTo(B, i);
|
|
900
828
|
}
|
|
901
|
-
e != null && (i.drShiftTo(l, e), o !=
|
|
829
|
+
e != null && (i.drShiftTo(l, e), o != f && r.ZERO.subTo(e, e)), i.t = l, i.clamp(), u > 0 && i.rShiftTo(u, i), o < 0 && r.ZERO.subTo(i, i);
|
|
902
830
|
}
|
|
903
831
|
}
|
|
904
832
|
}, r.prototype.invDigit = function() {
|
|
@@ -914,7 +842,7 @@ var rt = (
|
|
|
914
842
|
}, r.prototype.exp = function(t, e) {
|
|
915
843
|
if (t > 4294967295 || t < 1)
|
|
916
844
|
return r.ONE;
|
|
917
|
-
var i =
|
|
845
|
+
var i = p(), n = p(), s = e.convert(this), h = G(t) - 1;
|
|
918
846
|
for (s.copyTo(i); --h >= 0; )
|
|
919
847
|
if (e.sqrTo(i, n), (t & 1 << h) > 0)
|
|
920
848
|
e.mulTo(n, s, i);
|
|
@@ -928,19 +856,19 @@ var rt = (
|
|
|
928
856
|
}, r.prototype.toRadix = function(t) {
|
|
929
857
|
if (t == null && (t = 10), this.signum() == 0 || t < 2 || t > 36)
|
|
930
858
|
return "0";
|
|
931
|
-
var e = this.chunkSize(t), i = Math.pow(t, e), n =
|
|
859
|
+
var e = this.chunkSize(t), i = Math.pow(t, e), n = O(i), s = p(), h = p(), o = "";
|
|
932
860
|
for (this.divRemTo(n, s, h); s.signum() > 0; )
|
|
933
861
|
o = (i + h.intValue()).toString(t).substr(1) + o, s.divRemTo(n, s, h);
|
|
934
862
|
return h.intValue().toString(t) + o;
|
|
935
863
|
}, r.prototype.fromRadix = function(t, e) {
|
|
936
864
|
this.fromInt(0), e == null && (e = 10);
|
|
937
|
-
for (var i = this.chunkSize(e), n = Math.pow(e, i), s = !1, h = 0, o = 0,
|
|
938
|
-
var
|
|
939
|
-
if (
|
|
940
|
-
t.charAt(
|
|
865
|
+
for (var i = this.chunkSize(e), n = Math.pow(e, i), s = !1, h = 0, o = 0, f = 0; f < t.length; ++f) {
|
|
866
|
+
var u = St(t, f);
|
|
867
|
+
if (u < 0) {
|
|
868
|
+
t.charAt(f) == "-" && this.signum() == 0 && (s = !0);
|
|
941
869
|
continue;
|
|
942
870
|
}
|
|
943
|
-
o = e * o +
|
|
871
|
+
o = e * o + u, ++h >= i && (this.dMultiply(n), this.dAddOffset(o, 0), h = 0, o = 0);
|
|
944
872
|
}
|
|
945
873
|
h > 0 && (this.dMultiply(Math.pow(e, h)), this.dAddOffset(o, 0)), s && r.ZERO.subTo(this, this);
|
|
946
874
|
}, r.prototype.fromNumber = function(t, e, i) {
|
|
@@ -1027,11 +955,11 @@ var rt = (
|
|
|
1027
955
|
return !1;
|
|
1028
956
|
var n = e.shiftRight(i);
|
|
1029
957
|
t = t + 1 >> 1, t > w.length && (t = w.length);
|
|
1030
|
-
for (var s =
|
|
958
|
+
for (var s = p(), h = 0; h < t; ++h) {
|
|
1031
959
|
s.fromInt(w[Math.floor(Math.random() * w.length)]);
|
|
1032
960
|
var o = s.modPow(n, this);
|
|
1033
961
|
if (o.compareTo(r.ONE) != 0 && o.compareTo(e) != 0) {
|
|
1034
|
-
for (var
|
|
962
|
+
for (var f = 1; f++ < i && o.compareTo(e) != 0; )
|
|
1035
963
|
if (o = o.modPowInt(2, this), o.compareTo(r.ONE) == 0)
|
|
1036
964
|
return !1;
|
|
1037
965
|
if (o.compareTo(e) != 0)
|
|
@@ -1040,7 +968,7 @@ var rt = (
|
|
|
1040
968
|
}
|
|
1041
969
|
return !0;
|
|
1042
970
|
}, r.prototype.square = function() {
|
|
1043
|
-
var t =
|
|
971
|
+
var t = p();
|
|
1044
972
|
return this.squareTo(t), t;
|
|
1045
973
|
}, r.prototype.gcda = function(t, e) {
|
|
1046
974
|
var i = this.s < 0 ? this.negate() : this.clone(), n = t.s < 0 ? t.negate() : t.clone();
|
|
@@ -1054,12 +982,12 @@ var rt = (
|
|
|
1054
982
|
return;
|
|
1055
983
|
}
|
|
1056
984
|
h < o && (o = h), o > 0 && (i.rShiftTo(o, i), n.rShiftTo(o, n));
|
|
1057
|
-
var
|
|
1058
|
-
(h = i.getLowestSetBit()) > 0 && i.rShiftTo(h, i), (h = n.getLowestSetBit()) > 0 && n.rShiftTo(h, 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(
|
|
985
|
+
var f = function() {
|
|
986
|
+
(h = i.getLowestSetBit()) > 0 && i.rShiftTo(h, i), (h = n.getLowestSetBit()) > 0 && n.rShiftTo(h, 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) : (o > 0 && n.lShiftTo(o, n), setTimeout(function() {
|
|
1059
987
|
e(n);
|
|
1060
988
|
}, 0));
|
|
1061
989
|
};
|
|
1062
|
-
setTimeout(
|
|
990
|
+
setTimeout(f, 10);
|
|
1063
991
|
}, r.prototype.fromNumberAsync = function(t, e, i, n) {
|
|
1064
992
|
if (typeof e == "number")
|
|
1065
993
|
if (t < 2)
|
|
@@ -1074,12 +1002,12 @@ var rt = (
|
|
|
1074
1002
|
setTimeout(h, 0);
|
|
1075
1003
|
}
|
|
1076
1004
|
else {
|
|
1077
|
-
var o = [],
|
|
1078
|
-
o.length = (t >> 3) + 1, e.nextBytes(o),
|
|
1005
|
+
var o = [], f = t & 7;
|
|
1006
|
+
o.length = (t >> 3) + 1, e.nextBytes(o), f > 0 ? o[0] &= (1 << f) - 1 : o[0] = 0, this.fromString(o, 256);
|
|
1079
1007
|
}
|
|
1080
1008
|
}, r;
|
|
1081
1009
|
}()
|
|
1082
|
-
),
|
|
1010
|
+
), Mt = (
|
|
1083
1011
|
/** @class */
|
|
1084
1012
|
function() {
|
|
1085
1013
|
function r() {
|
|
@@ -1119,10 +1047,10 @@ var rt = (
|
|
|
1119
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;
|
|
1120
1048
|
}
|
|
1121
1049
|
return r.prototype.convert = function(t) {
|
|
1122
|
-
var e =
|
|
1050
|
+
var e = p();
|
|
1123
1051
|
return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(c.ZERO) > 0 && this.m.subTo(e, e), e;
|
|
1124
1052
|
}, r.prototype.revert = function(t) {
|
|
1125
|
-
var e =
|
|
1053
|
+
var e = p();
|
|
1126
1054
|
return t.copyTo(e), this.reduce(e), e;
|
|
1127
1055
|
}, r.prototype.reduce = function(t) {
|
|
1128
1056
|
for (; t.t <= this.mt2; )
|
|
@@ -1139,18 +1067,18 @@ var rt = (
|
|
|
1139
1067
|
t.squareTo(e), this.reduce(e);
|
|
1140
1068
|
}, r;
|
|
1141
1069
|
}()
|
|
1142
|
-
),
|
|
1070
|
+
), qt = (
|
|
1143
1071
|
/** @class */
|
|
1144
1072
|
function() {
|
|
1145
1073
|
function r(t) {
|
|
1146
|
-
this.m = t, this.r2 =
|
|
1074
|
+
this.m = t, this.r2 = p(), this.q3 = p(), c.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t);
|
|
1147
1075
|
}
|
|
1148
1076
|
return r.prototype.convert = function(t) {
|
|
1149
1077
|
if (t.s < 0 || t.t > 2 * this.m.t)
|
|
1150
1078
|
return t.mod(this.m);
|
|
1151
1079
|
if (t.compareTo(this.m) < 0)
|
|
1152
1080
|
return t;
|
|
1153
|
-
var e =
|
|
1081
|
+
var e = p();
|
|
1154
1082
|
return t.copyTo(e), this.reduce(e), e;
|
|
1155
1083
|
}, r.prototype.revert = function(t) {
|
|
1156
1084
|
return t;
|
|
@@ -1166,64 +1094,64 @@ var rt = (
|
|
|
1166
1094
|
}, r;
|
|
1167
1095
|
}()
|
|
1168
1096
|
);
|
|
1169
|
-
function
|
|
1097
|
+
function p() {
|
|
1170
1098
|
return new c(null);
|
|
1171
1099
|
}
|
|
1172
|
-
function
|
|
1100
|
+
function S(r, t) {
|
|
1173
1101
|
return new c(r, t);
|
|
1174
1102
|
}
|
|
1175
1103
|
var yt = typeof navigator < "u";
|
|
1176
1104
|
yt && gt && navigator.appName == "Microsoft Internet Explorer" ? (c.prototype.am = function(t, e, i, n, s, h) {
|
|
1177
|
-
for (var o = e & 32767,
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1105
|
+
for (var o = e & 32767, f = e >> 15; --h >= 0; ) {
|
|
1106
|
+
var u = this[t] & 32767, l = this[t++] >> 15, g = f * u + l * o;
|
|
1107
|
+
u = o * u + ((g & 32767) << 15) + i[n] + (s & 1073741823), s = (u >>> 30) + (g >>> 15) + f * l + (s >>> 30), i[n++] = u & 1073741823;
|
|
1180
1108
|
}
|
|
1181
1109
|
return s;
|
|
1182
|
-
},
|
|
1110
|
+
}, I = 30) : yt && gt && navigator.appName != "Netscape" ? (c.prototype.am = function(t, e, i, n, s, h) {
|
|
1183
1111
|
for (; --h >= 0; ) {
|
|
1184
1112
|
var o = e * this[t++] + i[n] + s;
|
|
1185
1113
|
s = Math.floor(o / 67108864), i[n++] = o & 67108863;
|
|
1186
1114
|
}
|
|
1187
1115
|
return s;
|
|
1188
|
-
},
|
|
1189
|
-
for (var o = e & 16383,
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1116
|
+
}, I = 26) : (c.prototype.am = function(t, e, i, n, s, h) {
|
|
1117
|
+
for (var o = e & 16383, f = e >> 14; --h >= 0; ) {
|
|
1118
|
+
var u = this[t] & 16383, l = this[t++] >> 14, g = f * u + l * o;
|
|
1119
|
+
u = o * u + ((g & 16383) << 14) + i[n] + s, s = (u >> 28) + (g >> 14) + f * l, i[n++] = u & 268435455;
|
|
1192
1120
|
}
|
|
1193
1121
|
return s;
|
|
1194
|
-
},
|
|
1195
|
-
c.prototype.DB =
|
|
1196
|
-
c.prototype.DM = (1 <<
|
|
1197
|
-
c.prototype.DV = 1 <<
|
|
1198
|
-
var
|
|
1199
|
-
c.prototype.FV = Math.pow(2,
|
|
1200
|
-
c.prototype.F1 =
|
|
1201
|
-
c.prototype.F2 = 2 *
|
|
1202
|
-
var tt = [],
|
|
1203
|
-
|
|
1122
|
+
}, I = 28);
|
|
1123
|
+
c.prototype.DB = I;
|
|
1124
|
+
c.prototype.DM = (1 << I) - 1;
|
|
1125
|
+
c.prototype.DV = 1 << I;
|
|
1126
|
+
var ft = 52;
|
|
1127
|
+
c.prototype.FV = Math.pow(2, ft);
|
|
1128
|
+
c.prototype.F1 = ft - I;
|
|
1129
|
+
c.prototype.F2 = 2 * I - ft;
|
|
1130
|
+
var tt = [], K, D;
|
|
1131
|
+
K = 48;
|
|
1204
1132
|
for (D = 0; D <= 9; ++D)
|
|
1205
|
-
tt[
|
|
1206
|
-
|
|
1133
|
+
tt[K++] = D;
|
|
1134
|
+
K = 97;
|
|
1207
1135
|
for (D = 10; D < 36; ++D)
|
|
1208
|
-
tt[
|
|
1209
|
-
|
|
1136
|
+
tt[K++] = D;
|
|
1137
|
+
K = 65;
|
|
1210
1138
|
for (D = 10; D < 36; ++D)
|
|
1211
|
-
tt[
|
|
1139
|
+
tt[K++] = D;
|
|
1212
1140
|
function St(r, t) {
|
|
1213
1141
|
var e = tt[r.charCodeAt(t)];
|
|
1214
1142
|
return e ?? -1;
|
|
1215
1143
|
}
|
|
1216
|
-
function
|
|
1217
|
-
var t =
|
|
1144
|
+
function O(r) {
|
|
1145
|
+
var t = p();
|
|
1218
1146
|
return t.fromInt(r), t;
|
|
1219
1147
|
}
|
|
1220
1148
|
function G(r) {
|
|
1221
1149
|
var t = 1, e;
|
|
1222
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;
|
|
1223
1151
|
}
|
|
1224
|
-
c.ZERO =
|
|
1225
|
-
c.ONE =
|
|
1226
|
-
var
|
|
1152
|
+
c.ZERO = O(0);
|
|
1153
|
+
c.ONE = O(1);
|
|
1154
|
+
var Ht = (
|
|
1227
1155
|
/** @class */
|
|
1228
1156
|
function() {
|
|
1229
1157
|
function r() {
|
|
@@ -1242,17 +1170,17 @@ var Gt = (
|
|
|
1242
1170
|
}, r;
|
|
1243
1171
|
}()
|
|
1244
1172
|
);
|
|
1245
|
-
function
|
|
1246
|
-
return new
|
|
1173
|
+
function Ct() {
|
|
1174
|
+
return new Ht();
|
|
1247
1175
|
}
|
|
1248
|
-
var wt = 256, $,
|
|
1249
|
-
if (
|
|
1250
|
-
|
|
1176
|
+
var wt = 256, $, V = null, R;
|
|
1177
|
+
if (V == null) {
|
|
1178
|
+
V = [], R = 0;
|
|
1251
1179
|
var J = void 0;
|
|
1252
1180
|
if (typeof window < "u" && window.crypto && window.crypto.getRandomValues) {
|
|
1253
1181
|
var nt = new Uint32Array(256);
|
|
1254
1182
|
for (window.crypto.getRandomValues(nt), J = 0; J < nt.length; ++J)
|
|
1255
|
-
|
|
1183
|
+
V[R++] = nt[J] & 255;
|
|
1256
1184
|
}
|
|
1257
1185
|
var Y = 0, X = function(r) {
|
|
1258
1186
|
if (Y = Y || 0, Y >= 256 || R >= wt) {
|
|
@@ -1261,20 +1189,20 @@ if (O == null) {
|
|
|
1261
1189
|
}
|
|
1262
1190
|
try {
|
|
1263
1191
|
var t = r.x + r.y;
|
|
1264
|
-
|
|
1192
|
+
V[R++] = t & 255, Y += 1;
|
|
1265
1193
|
} catch {
|
|
1266
1194
|
}
|
|
1267
1195
|
};
|
|
1268
1196
|
typeof window < "u" && (window.addEventListener ? window.addEventListener("mousemove", X, !1) : window.attachEvent && window.attachEvent("onmousemove", X));
|
|
1269
1197
|
}
|
|
1270
|
-
function
|
|
1198
|
+
function _t() {
|
|
1271
1199
|
if ($ == null) {
|
|
1272
|
-
for ($ =
|
|
1200
|
+
for ($ = Ct(); R < wt; ) {
|
|
1273
1201
|
var r = Math.floor(65536 * Math.random());
|
|
1274
|
-
|
|
1202
|
+
V[R++] = r & 255;
|
|
1275
1203
|
}
|
|
1276
|
-
for ($.init(
|
|
1277
|
-
|
|
1204
|
+
for ($.init(V), R = 0; R < V.length; ++R)
|
|
1205
|
+
V[R] = 0;
|
|
1278
1206
|
R = 0;
|
|
1279
1207
|
}
|
|
1280
1208
|
return $.next();
|
|
@@ -1286,19 +1214,19 @@ var ht = (
|
|
|
1286
1214
|
}
|
|
1287
1215
|
return r.prototype.nextBytes = function(t) {
|
|
1288
1216
|
for (var e = 0; e < t.length; ++e)
|
|
1289
|
-
t[e] =
|
|
1217
|
+
t[e] = _t();
|
|
1290
1218
|
}, r;
|
|
1291
1219
|
}()
|
|
1292
1220
|
);
|
|
1293
|
-
function
|
|
1221
|
+
function Ft(r, t) {
|
|
1294
1222
|
if (t < r.length + 22)
|
|
1295
1223
|
return console.error("Message too long for RSA"), null;
|
|
1296
1224
|
for (var e = t - r.length - 6, i = "", n = 0; n < e; n += 2)
|
|
1297
1225
|
i += "ff";
|
|
1298
1226
|
var s = "0001" + i + "00" + r;
|
|
1299
|
-
return
|
|
1227
|
+
return S(s, 16);
|
|
1300
1228
|
}
|
|
1301
|
-
function
|
|
1229
|
+
function Kt(r, t) {
|
|
1302
1230
|
if (t < r.length + 11)
|
|
1303
1231
|
return console.error("Message too long for RSA"), null;
|
|
1304
1232
|
for (var e = [], i = r.length - 1; i >= 0 && t > 0; ) {
|
|
@@ -1313,7 +1241,7 @@ function Xt(r, t) {
|
|
|
1313
1241
|
}
|
|
1314
1242
|
return e[--t] = 2, e[--t] = 0, new c(e);
|
|
1315
1243
|
}
|
|
1316
|
-
var
|
|
1244
|
+
var Lt = (
|
|
1317
1245
|
/** @class */
|
|
1318
1246
|
function() {
|
|
1319
1247
|
function r() {
|
|
@@ -1328,9 +1256,9 @@ var Qt = (
|
|
|
1328
1256
|
e = e.add(this.p);
|
|
1329
1257
|
return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i);
|
|
1330
1258
|
}, r.prototype.setPublic = function(t, e) {
|
|
1331
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n =
|
|
1259
|
+
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = S(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key");
|
|
1332
1260
|
}, r.prototype.encrypt = function(t) {
|
|
1333
|
-
var e = this.n.bitLength() + 7 >> 3, i =
|
|
1261
|
+
var e = this.n.bitLength() + 7 >> 3, i = Kt(t, e);
|
|
1334
1262
|
if (i == null)
|
|
1335
1263
|
return null;
|
|
1336
1264
|
var n = this.doPublic(i);
|
|
@@ -1340,9 +1268,9 @@ var Qt = (
|
|
|
1340
1268
|
s = "0" + s;
|
|
1341
1269
|
return s;
|
|
1342
1270
|
}, r.prototype.setPrivate = function(t, e, i) {
|
|
1343
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n =
|
|
1344
|
-
}, r.prototype.setPrivateEx = function(t, e, i, n, s, h, o,
|
|
1345
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n =
|
|
1271
|
+
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = S(t, 16), this.e = parseInt(e, 16), this.d = S(i, 16)) : console.error("Invalid RSA private key");
|
|
1272
|
+
}, r.prototype.setPrivateEx = function(t, e, i, n, s, h, o, f) {
|
|
1273
|
+
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = S(t, 16), this.e = parseInt(e, 16), this.d = S(i, 16), this.p = S(n, 16), this.q = S(s, 16), this.dmp1 = S(h, 16), this.dmq1 = S(o, 16), this.coeff = S(f, 16)) : console.error("Invalid RSA private key");
|
|
1346
1274
|
}, r.prototype.generate = function(t, e) {
|
|
1347
1275
|
var i = new ht(), n = t >> 1;
|
|
1348
1276
|
this.e = parseInt(e, 16);
|
|
@@ -1355,63 +1283,63 @@ var Qt = (
|
|
|
1355
1283
|
var h = this.p;
|
|
1356
1284
|
this.p = this.q, this.q = h;
|
|
1357
1285
|
}
|
|
1358
|
-
var o = this.p.subtract(c.ONE),
|
|
1359
|
-
if (
|
|
1360
|
-
this.n = this.p.multiply(this.q), this.d = s.modInverse(
|
|
1286
|
+
var o = this.p.subtract(c.ONE), f = this.q.subtract(c.ONE), u = o.multiply(f);
|
|
1287
|
+
if (u.gcd(s).compareTo(c.ONE) == 0) {
|
|
1288
|
+
this.n = this.p.multiply(this.q), this.d = s.modInverse(u), this.dmp1 = this.d.mod(o), this.dmq1 = this.d.mod(f), this.coeff = this.q.modInverse(this.p);
|
|
1361
1289
|
break;
|
|
1362
1290
|
}
|
|
1363
1291
|
}
|
|
1364
1292
|
}, r.prototype.decrypt = function(t) {
|
|
1365
|
-
var e =
|
|
1366
|
-
return i == null ? null :
|
|
1293
|
+
var e = S(t, 16), i = this.doPrivate(e);
|
|
1294
|
+
return i == null ? null : Ut(i, this.n.bitLength() + 7 >> 3);
|
|
1367
1295
|
}, r.prototype.generateAsync = function(t, e, i) {
|
|
1368
1296
|
var n = new ht(), s = t >> 1;
|
|
1369
1297
|
this.e = parseInt(e, 16);
|
|
1370
|
-
var h = new c(e, 16), o = this,
|
|
1371
|
-
var
|
|
1298
|
+
var h = new c(e, 16), o = this, f = function() {
|
|
1299
|
+
var u = function() {
|
|
1372
1300
|
if (o.p.compareTo(o.q) <= 0) {
|
|
1373
|
-
var
|
|
1374
|
-
o.p = o.q, o.q =
|
|
1301
|
+
var d = o.p;
|
|
1302
|
+
o.p = o.q, o.q = d;
|
|
1375
1303
|
}
|
|
1376
|
-
var y = o.p.subtract(c.ONE),
|
|
1377
|
-
b.gcd(h).compareTo(c.ONE) == 0 ? (o.n = o.p.multiply(o.q), o.d = h.modInverse(b), o.dmp1 = o.d.mod(y), o.dmq1 = o.d.mod(
|
|
1304
|
+
var y = o.p.subtract(c.ONE), T = o.q.subtract(c.ONE), b = y.multiply(T);
|
|
1305
|
+
b.gcd(h).compareTo(c.ONE) == 0 ? (o.n = o.p.multiply(o.q), o.d = h.modInverse(b), o.dmp1 = o.d.mod(y), o.dmq1 = o.d.mod(T), o.coeff = o.q.modInverse(o.p), setTimeout(function() {
|
|
1378
1306
|
i();
|
|
1379
|
-
}, 0)) : setTimeout(
|
|
1307
|
+
}, 0)) : setTimeout(f, 0);
|
|
1380
1308
|
}, l = function() {
|
|
1381
|
-
o.q =
|
|
1382
|
-
o.q.subtract(c.ONE).gcda(h, function(
|
|
1383
|
-
|
|
1309
|
+
o.q = p(), o.q.fromNumberAsync(s, 1, n, function() {
|
|
1310
|
+
o.q.subtract(c.ONE).gcda(h, function(d) {
|
|
1311
|
+
d.compareTo(c.ONE) == 0 && o.q.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(l, 0);
|
|
1384
1312
|
});
|
|
1385
1313
|
});
|
|
1386
|
-
},
|
|
1387
|
-
o.p =
|
|
1388
|
-
o.p.subtract(c.ONE).gcda(h, function(
|
|
1389
|
-
|
|
1314
|
+
}, g = function() {
|
|
1315
|
+
o.p = p(), o.p.fromNumberAsync(t - s, 1, n, function() {
|
|
1316
|
+
o.p.subtract(c.ONE).gcda(h, function(d) {
|
|
1317
|
+
d.compareTo(c.ONE) == 0 && o.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(g, 0);
|
|
1390
1318
|
});
|
|
1391
1319
|
});
|
|
1392
1320
|
};
|
|
1393
|
-
setTimeout(
|
|
1321
|
+
setTimeout(g, 0);
|
|
1394
1322
|
};
|
|
1395
|
-
setTimeout(
|
|
1323
|
+
setTimeout(f, 0);
|
|
1396
1324
|
}, r.prototype.sign = function(t, e, i) {
|
|
1397
|
-
var n =
|
|
1325
|
+
var n = jt(i), s = n + e(t).toString(), h = Ft(s, this.n.bitLength() / 4);
|
|
1398
1326
|
if (h == null)
|
|
1399
1327
|
return null;
|
|
1400
1328
|
var o = this.doPrivate(h);
|
|
1401
1329
|
if (o == null)
|
|
1402
1330
|
return null;
|
|
1403
|
-
var
|
|
1404
|
-
return (
|
|
1331
|
+
var f = o.toString(16);
|
|
1332
|
+
return (f.length & 1) == 0 ? f : "0" + f;
|
|
1405
1333
|
}, r.prototype.verify = function(t, e, i) {
|
|
1406
|
-
var n =
|
|
1334
|
+
var n = S(e, 16), s = this.doPublic(n);
|
|
1407
1335
|
if (s == null)
|
|
1408
1336
|
return null;
|
|
1409
|
-
var h = s.toString(16).replace(/^1f+00/, ""), o =
|
|
1337
|
+
var h = s.toString(16).replace(/^1f+00/, ""), o = kt(h);
|
|
1410
1338
|
return o == i(t).toString();
|
|
1411
1339
|
}, r;
|
|
1412
1340
|
}()
|
|
1413
1341
|
);
|
|
1414
|
-
function
|
|
1342
|
+
function Ut(r, t) {
|
|
1415
1343
|
for (var e = r.toByteArray(), i = 0; i < e.length && e[i] == 0; )
|
|
1416
1344
|
++i;
|
|
1417
1345
|
if (e.length - i != t - 1 || e[i] != 2)
|
|
@@ -1435,10 +1363,10 @@ var Q = {
|
|
|
1435
1363
|
sha512: "3051300d060960864801650304020305000440",
|
|
1436
1364
|
ripemd160: "3021300906052b2403020105000414"
|
|
1437
1365
|
};
|
|
1438
|
-
function
|
|
1366
|
+
function jt(r) {
|
|
1439
1367
|
return Q[r] || "";
|
|
1440
1368
|
}
|
|
1441
|
-
function
|
|
1369
|
+
function kt(r) {
|
|
1442
1370
|
for (var t in Q)
|
|
1443
1371
|
if (Q.hasOwnProperty(t)) {
|
|
1444
1372
|
var e = Q[t], i = e.length;
|
|
@@ -1453,8 +1381,8 @@ Code licensed under the BSD License:
|
|
|
1453
1381
|
http://developer.yahoo.com/yui/license.html
|
|
1454
1382
|
version: 2.9.0
|
|
1455
1383
|
*/
|
|
1456
|
-
var
|
|
1457
|
-
|
|
1384
|
+
var m = {};
|
|
1385
|
+
m.lang = {
|
|
1458
1386
|
/**
|
|
1459
1387
|
* Utility to set up the prototype, constructor and superclass properties to
|
|
1460
1388
|
* support an inheritance strategy that can chain constructors and methods.
|
|
@@ -1481,10 +1409,10 @@ T.lang = {
|
|
|
1481
1409
|
var s = function() {
|
|
1482
1410
|
}, h = ["toString", "valueOf"];
|
|
1483
1411
|
try {
|
|
1484
|
-
/MSIE/.test(navigator.userAgent) && (s = function(o,
|
|
1412
|
+
/MSIE/.test(navigator.userAgent) && (s = function(o, f) {
|
|
1485
1413
|
for (n = 0; n < h.length; n = n + 1) {
|
|
1486
|
-
var
|
|
1487
|
-
typeof l == "function" && l != Object.prototype[
|
|
1414
|
+
var u = h[n], l = f[u];
|
|
1415
|
+
typeof l == "function" && l != Object.prototype[u] && (o[u] = l);
|
|
1488
1416
|
}
|
|
1489
1417
|
});
|
|
1490
1418
|
} catch {
|
|
@@ -1501,9 +1429,9 @@ T.lang = {
|
|
|
1501
1429
|
* @since jsrsasign 2.1
|
|
1502
1430
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
1503
1431
|
*/
|
|
1504
|
-
var
|
|
1505
|
-
(typeof
|
|
1506
|
-
|
|
1432
|
+
var a = {};
|
|
1433
|
+
(typeof a.asn1 > "u" || !a.asn1) && (a.asn1 = {});
|
|
1434
|
+
a.asn1.ASN1Util = new function() {
|
|
1507
1435
|
this.integerToByteHex = function(r) {
|
|
1508
1436
|
var t = r.toString(16);
|
|
1509
1437
|
return t.length % 2 == 1 && (t = "0" + t), t;
|
|
@@ -1523,59 +1451,59 @@ u.asn1.ASN1Util = new function() {
|
|
|
1523
1451
|
}, this.getPEMStringFromHex = function(r, t) {
|
|
1524
1452
|
return hextopem(r, t);
|
|
1525
1453
|
}, this.newObject = function(r) {
|
|
1526
|
-
var t =
|
|
1527
|
-
if (
|
|
1454
|
+
var t = a, e = t.asn1, i = e.DERBoolean, n = e.DERInteger, s = e.DERBitString, h = e.DEROctetString, o = e.DERNull, f = e.DERObjectIdentifier, u = e.DEREnumerated, l = e.DERUTF8String, g = e.DERNumericString, d = e.DERPrintableString, y = e.DERTeletexString, T = e.DERIA5String, b = e.DERUTCTime, E = e.DERGeneralizedTime, M = e.DERSequence, B = e.DERSet, q = e.DERTaggedObject, k = e.ASN1Util.newObject, at = Object.keys(r);
|
|
1455
|
+
if (at.length != 1)
|
|
1528
1456
|
throw "key of param shall be only one.";
|
|
1529
|
-
var
|
|
1530
|
-
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" +
|
|
1531
|
-
throw "undefined key: " +
|
|
1532
|
-
if (
|
|
1533
|
-
return new i(r[
|
|
1534
|
-
if (
|
|
1535
|
-
return new n(r[
|
|
1536
|
-
if (
|
|
1537
|
-
return new s(r[
|
|
1538
|
-
if (
|
|
1539
|
-
return new h(r[
|
|
1540
|
-
if (
|
|
1541
|
-
return new o(r[
|
|
1542
|
-
if (
|
|
1543
|
-
return new
|
|
1544
|
-
if (
|
|
1545
|
-
return new
|
|
1546
|
-
if (
|
|
1547
|
-
return new l(r[
|
|
1548
|
-
if (
|
|
1549
|
-
return new
|
|
1550
|
-
if (
|
|
1551
|
-
return new
|
|
1552
|
-
if (
|
|
1553
|
-
return new y(r[
|
|
1554
|
-
if (
|
|
1555
|
-
return new
|
|
1556
|
-
if (
|
|
1557
|
-
return new b(r[
|
|
1558
|
-
if (
|
|
1559
|
-
return new E(r[
|
|
1560
|
-
if (
|
|
1561
|
-
for (var L = r[
|
|
1562
|
-
var it =
|
|
1563
|
-
|
|
1457
|
+
var v = at[0];
|
|
1458
|
+
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + v + ":") == -1)
|
|
1459
|
+
throw "undefined key: " + v;
|
|
1460
|
+
if (v == "bool")
|
|
1461
|
+
return new i(r[v]);
|
|
1462
|
+
if (v == "int")
|
|
1463
|
+
return new n(r[v]);
|
|
1464
|
+
if (v == "bitstr")
|
|
1465
|
+
return new s(r[v]);
|
|
1466
|
+
if (v == "octstr")
|
|
1467
|
+
return new h(r[v]);
|
|
1468
|
+
if (v == "null")
|
|
1469
|
+
return new o(r[v]);
|
|
1470
|
+
if (v == "oid")
|
|
1471
|
+
return new f(r[v]);
|
|
1472
|
+
if (v == "enum")
|
|
1473
|
+
return new u(r[v]);
|
|
1474
|
+
if (v == "utf8str")
|
|
1475
|
+
return new l(r[v]);
|
|
1476
|
+
if (v == "numstr")
|
|
1477
|
+
return new g(r[v]);
|
|
1478
|
+
if (v == "prnstr")
|
|
1479
|
+
return new d(r[v]);
|
|
1480
|
+
if (v == "telstr")
|
|
1481
|
+
return new y(r[v]);
|
|
1482
|
+
if (v == "ia5str")
|
|
1483
|
+
return new T(r[v]);
|
|
1484
|
+
if (v == "utctime")
|
|
1485
|
+
return new b(r[v]);
|
|
1486
|
+
if (v == "gentime")
|
|
1487
|
+
return new E(r[v]);
|
|
1488
|
+
if (v == "seq") {
|
|
1489
|
+
for (var L = r[v], U = [], N = 0; N < L.length; N++) {
|
|
1490
|
+
var it = k(L[N]);
|
|
1491
|
+
U.push(it);
|
|
1564
1492
|
}
|
|
1565
|
-
return new M({ array:
|
|
1493
|
+
return new M({ array: U });
|
|
1566
1494
|
}
|
|
1567
|
-
if (
|
|
1568
|
-
for (var L = r[
|
|
1569
|
-
var it =
|
|
1570
|
-
|
|
1495
|
+
if (v == "set") {
|
|
1496
|
+
for (var L = r[v], U = [], N = 0; N < L.length; N++) {
|
|
1497
|
+
var it = k(L[N]);
|
|
1498
|
+
U.push(it);
|
|
1571
1499
|
}
|
|
1572
|
-
return new B({ array:
|
|
1500
|
+
return new B({ array: U });
|
|
1573
1501
|
}
|
|
1574
|
-
if (
|
|
1575
|
-
var x = r[
|
|
1502
|
+
if (v == "tag") {
|
|
1503
|
+
var x = r[v];
|
|
1576
1504
|
if (Object.prototype.toString.call(x) === "[object Array]" && x.length == 3) {
|
|
1577
|
-
var Et =
|
|
1578
|
-
return new
|
|
1505
|
+
var Et = k(x[2]);
|
|
1506
|
+
return new q({
|
|
1579
1507
|
tag: x[0],
|
|
1580
1508
|
explicit: x[1],
|
|
1581
1509
|
obj: Et
|
|
@@ -1584,7 +1512,7 @@ u.asn1.ASN1Util = new function() {
|
|
|
1584
1512
|
var z = {};
|
|
1585
1513
|
if (x.explicit !== void 0 && (z.explicit = x.explicit), x.tag !== void 0 && (z.tag = x.tag), x.obj === void 0)
|
|
1586
1514
|
throw "obj shall be specified for 'tag'.";
|
|
1587
|
-
return z.obj =
|
|
1515
|
+
return z.obj = k(x.obj), new q(z);
|
|
1588
1516
|
}
|
|
1589
1517
|
}
|
|
1590
1518
|
}, this.jsonToASN1HEX = function(r) {
|
|
@@ -1592,31 +1520,31 @@ u.asn1.ASN1Util = new function() {
|
|
|
1592
1520
|
return t.getEncodedHex();
|
|
1593
1521
|
};
|
|
1594
1522
|
}();
|
|
1595
|
-
|
|
1523
|
+
a.asn1.ASN1Util.oidHexToInt = function(r) {
|
|
1596
1524
|
for (var n = "", t = parseInt(r.substr(0, 2), 16), e = Math.floor(t / 40), i = t % 40, n = e + "." + i, s = "", h = 2; h < r.length; h += 2) {
|
|
1597
|
-
var o = parseInt(r.substr(h, 2), 16),
|
|
1598
|
-
if (s = s +
|
|
1599
|
-
var
|
|
1600
|
-
n = n + "." +
|
|
1525
|
+
var o = parseInt(r.substr(h, 2), 16), f = ("00000000" + o.toString(2)).slice(-8);
|
|
1526
|
+
if (s = s + f.substr(1, 7), f.substr(0, 1) == "0") {
|
|
1527
|
+
var u = new c(s, 2);
|
|
1528
|
+
n = n + "." + u.toString(10), s = "";
|
|
1601
1529
|
}
|
|
1602
1530
|
}
|
|
1603
1531
|
return n;
|
|
1604
1532
|
};
|
|
1605
|
-
|
|
1533
|
+
a.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
1606
1534
|
var t = function(o) {
|
|
1607
|
-
var
|
|
1608
|
-
return
|
|
1535
|
+
var f = o.toString(16);
|
|
1536
|
+
return f.length == 1 && (f = "0" + f), f;
|
|
1609
1537
|
}, e = function(o) {
|
|
1610
|
-
var
|
|
1611
|
-
|
|
1612
|
-
for (var
|
|
1613
|
-
|
|
1614
|
-
l =
|
|
1538
|
+
var f = "", u = new c(o, 10), l = u.toString(2), g = 7 - l.length % 7;
|
|
1539
|
+
g == 7 && (g = 0);
|
|
1540
|
+
for (var d = "", y = 0; y < g; y++)
|
|
1541
|
+
d += "0";
|
|
1542
|
+
l = d + l;
|
|
1615
1543
|
for (var y = 0; y < l.length - 1; y += 7) {
|
|
1616
|
-
var
|
|
1617
|
-
y != l.length - 7 && (
|
|
1544
|
+
var T = l.substr(y, 7);
|
|
1545
|
+
y != l.length - 7 && (T = "1" + T), f += t(parseInt(T, 2));
|
|
1618
1546
|
}
|
|
1619
|
-
return
|
|
1547
|
+
return f;
|
|
1620
1548
|
};
|
|
1621
1549
|
if (!r.match(/^[0-9.]+$/))
|
|
1622
1550
|
throw "malformed oid string: " + r;
|
|
@@ -1626,7 +1554,7 @@ u.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
|
1626
1554
|
i += e(n[h]);
|
|
1627
1555
|
return i;
|
|
1628
1556
|
};
|
|
1629
|
-
|
|
1557
|
+
a.asn1.ASN1Object = function() {
|
|
1630
1558
|
var r = "";
|
|
1631
1559
|
this.getLengthHexFromValue = function() {
|
|
1632
1560
|
if (typeof this.hV > "u" || this.hV == null)
|
|
@@ -1649,8 +1577,8 @@ u.asn1.ASN1Object = function() {
|
|
|
1649
1577
|
return "";
|
|
1650
1578
|
};
|
|
1651
1579
|
};
|
|
1652
|
-
|
|
1653
|
-
|
|
1580
|
+
a.asn1.DERAbstractString = function(r) {
|
|
1581
|
+
a.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
|
|
1654
1582
|
return this.s;
|
|
1655
1583
|
}, this.setString = function(t) {
|
|
1656
1584
|
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s);
|
|
@@ -1660,24 +1588,24 @@ u.asn1.DERAbstractString = function(r) {
|
|
|
1660
1588
|
return this.hV;
|
|
1661
1589
|
}, 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));
|
|
1662
1590
|
};
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1591
|
+
m.lang.extend(a.asn1.DERAbstractString, a.asn1.ASN1Object);
|
|
1592
|
+
a.asn1.DERAbstractTime = function(r) {
|
|
1593
|
+
a.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
|
|
1666
1594
|
utc = t.getTime() + t.getTimezoneOffset() * 6e4;
|
|
1667
1595
|
var e = new Date(utc);
|
|
1668
1596
|
return e;
|
|
1669
1597
|
}, this.formatDate = function(t, e, i) {
|
|
1670
1598
|
var n = this.zeroPadding, s = this.localDateToUTC(t), h = String(s.getFullYear());
|
|
1671
1599
|
e == "utc" && (h = h.substr(2, 2));
|
|
1672
|
-
var o = n(String(s.getMonth() + 1), 2),
|
|
1600
|
+
var o = n(String(s.getMonth() + 1), 2), f = n(String(s.getDate()), 2), u = n(String(s.getHours()), 2), l = n(String(s.getMinutes()), 2), g = n(String(s.getSeconds()), 2), d = h + o + f + u + l + g;
|
|
1673
1601
|
if (i === !0) {
|
|
1674
1602
|
var y = s.getMilliseconds();
|
|
1675
1603
|
if (y != 0) {
|
|
1676
|
-
var
|
|
1677
|
-
|
|
1604
|
+
var T = n(String(y), 3);
|
|
1605
|
+
T = T.replace(/[0]+$/, ""), d = d + "." + T;
|
|
1678
1606
|
}
|
|
1679
1607
|
}
|
|
1680
|
-
return
|
|
1608
|
+
return d + "Z";
|
|
1681
1609
|
}, this.zeroPadding = function(t, e) {
|
|
1682
1610
|
return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t;
|
|
1683
1611
|
}, this.getString = function() {
|
|
@@ -1691,22 +1619,22 @@ u.asn1.DERAbstractTime = function(r) {
|
|
|
1691
1619
|
return this.hV;
|
|
1692
1620
|
};
|
|
1693
1621
|
};
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1622
|
+
m.lang.extend(a.asn1.DERAbstractTime, a.asn1.ASN1Object);
|
|
1623
|
+
a.asn1.DERAbstractStructured = function(r) {
|
|
1624
|
+
a.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
|
|
1697
1625
|
this.hTLV = null, this.isModified = !0, this.asn1Array = t;
|
|
1698
1626
|
}, this.appendASN1Object = function(t) {
|
|
1699
1627
|
this.hTLV = null, this.isModified = !0, this.asn1Array.push(t);
|
|
1700
1628
|
}, this.asn1Array = new Array(), typeof r < "u" && typeof r.array < "u" && (this.asn1Array = r.array);
|
|
1701
1629
|
};
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1630
|
+
m.lang.extend(a.asn1.DERAbstractStructured, a.asn1.ASN1Object);
|
|
1631
|
+
a.asn1.DERBoolean = function() {
|
|
1632
|
+
a.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
|
|
1705
1633
|
};
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
this.hTLV = null, this.isModified = !0, this.hV =
|
|
1634
|
+
m.lang.extend(a.asn1.DERBoolean, a.asn1.ASN1Object);
|
|
1635
|
+
a.asn1.DERInteger = function(r) {
|
|
1636
|
+
a.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
|
|
1637
|
+
this.hTLV = null, this.isModified = !0, this.hV = a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1710
1638
|
}, this.setByInteger = function(t) {
|
|
1711
1639
|
var e = new c(String(t), 10);
|
|
1712
1640
|
this.setByBigInteger(e);
|
|
@@ -1716,13 +1644,13 @@ u.asn1.DERInteger = function(r) {
|
|
|
1716
1644
|
return this.hV;
|
|
1717
1645
|
}, 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));
|
|
1718
1646
|
};
|
|
1719
|
-
|
|
1720
|
-
|
|
1647
|
+
m.lang.extend(a.asn1.DERInteger, a.asn1.ASN1Object);
|
|
1648
|
+
a.asn1.DERBitString = function(r) {
|
|
1721
1649
|
if (r !== void 0 && typeof r.obj < "u") {
|
|
1722
|
-
var t =
|
|
1650
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1723
1651
|
r.hex = "00" + t.getEncodedHex();
|
|
1724
1652
|
}
|
|
1725
|
-
|
|
1653
|
+
a.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
|
|
1726
1654
|
this.hTLV = null, this.isModified = !0, this.hV = e;
|
|
1727
1655
|
}, this.setUnusedBitsAndHexValue = function(e, i) {
|
|
1728
1656
|
if (e < 0 || 7 < e)
|
|
@@ -1752,36 +1680,36 @@ u.asn1.DERBitString = function(r) {
|
|
|
1752
1680
|
return this.hV;
|
|
1753
1681
|
}, 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));
|
|
1754
1682
|
};
|
|
1755
|
-
|
|
1756
|
-
|
|
1683
|
+
m.lang.extend(a.asn1.DERBitString, a.asn1.ASN1Object);
|
|
1684
|
+
a.asn1.DEROctetString = function(r) {
|
|
1757
1685
|
if (r !== void 0 && typeof r.obj < "u") {
|
|
1758
|
-
var t =
|
|
1686
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1759
1687
|
r.hex = t.getEncodedHex();
|
|
1760
1688
|
}
|
|
1761
|
-
|
|
1689
|
+
a.asn1.DEROctetString.superclass.constructor.call(this, r), this.hT = "04";
|
|
1762
1690
|
};
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1691
|
+
m.lang.extend(a.asn1.DEROctetString, a.asn1.DERAbstractString);
|
|
1692
|
+
a.asn1.DERNull = function() {
|
|
1693
|
+
a.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
|
|
1766
1694
|
};
|
|
1767
|
-
|
|
1768
|
-
|
|
1695
|
+
m.lang.extend(a.asn1.DERNull, a.asn1.ASN1Object);
|
|
1696
|
+
a.asn1.DERObjectIdentifier = function(r) {
|
|
1769
1697
|
var t = function(i) {
|
|
1770
1698
|
var n = i.toString(16);
|
|
1771
1699
|
return n.length == 1 && (n = "0" + n), n;
|
|
1772
1700
|
}, e = function(i) {
|
|
1773
1701
|
var n = "", s = new c(i, 10), h = s.toString(2), o = 7 - h.length % 7;
|
|
1774
1702
|
o == 7 && (o = 0);
|
|
1775
|
-
for (var
|
|
1776
|
-
|
|
1777
|
-
h =
|
|
1778
|
-
for (var
|
|
1779
|
-
var l = h.substr(
|
|
1780
|
-
|
|
1703
|
+
for (var f = "", u = 0; u < o; u++)
|
|
1704
|
+
f += "0";
|
|
1705
|
+
h = f + h;
|
|
1706
|
+
for (var u = 0; u < h.length - 1; u += 7) {
|
|
1707
|
+
var l = h.substr(u, 7);
|
|
1708
|
+
u != h.length - 7 && (l = "1" + l), n += t(parseInt(l, 2));
|
|
1781
1709
|
}
|
|
1782
1710
|
return n;
|
|
1783
1711
|
};
|
|
1784
|
-
|
|
1712
|
+
a.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(i) {
|
|
1785
1713
|
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = i;
|
|
1786
1714
|
}, this.setValueOidString = function(i) {
|
|
1787
1715
|
if (!i.match(/^[0-9.]+$/))
|
|
@@ -1792,7 +1720,7 @@ u.asn1.DERObjectIdentifier = function(r) {
|
|
|
1792
1720
|
n += e(s[o]);
|
|
1793
1721
|
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n;
|
|
1794
1722
|
}, this.setValueName = function(i) {
|
|
1795
|
-
var n =
|
|
1723
|
+
var n = a.asn1.x509.OID.name2oid(i);
|
|
1796
1724
|
if (n !== "")
|
|
1797
1725
|
this.setValueOidString(n);
|
|
1798
1726
|
else
|
|
@@ -1801,10 +1729,10 @@ u.asn1.DERObjectIdentifier = function(r) {
|
|
|
1801
1729
|
return this.hV;
|
|
1802
1730
|
}, 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));
|
|
1803
1731
|
};
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
this.hTLV = null, this.isModified = !0, this.hV =
|
|
1732
|
+
m.lang.extend(a.asn1.DERObjectIdentifier, a.asn1.ASN1Object);
|
|
1733
|
+
a.asn1.DEREnumerated = function(r) {
|
|
1734
|
+
a.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
|
|
1735
|
+
this.hTLV = null, this.isModified = !0, this.hV = a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1808
1736
|
}, this.setByInteger = function(t) {
|
|
1809
1737
|
var e = new c(String(t), 10);
|
|
1810
1738
|
this.setByBigInteger(e);
|
|
@@ -1814,45 +1742,45 @@ u.asn1.DEREnumerated = function(r) {
|
|
|
1814
1742
|
return this.hV;
|
|
1815
1743
|
}, 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));
|
|
1816
1744
|
};
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1745
|
+
m.lang.extend(a.asn1.DEREnumerated, a.asn1.ASN1Object);
|
|
1746
|
+
a.asn1.DERUTF8String = function(r) {
|
|
1747
|
+
a.asn1.DERUTF8String.superclass.constructor.call(this, r), this.hT = "0c";
|
|
1820
1748
|
};
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1749
|
+
m.lang.extend(a.asn1.DERUTF8String, a.asn1.DERAbstractString);
|
|
1750
|
+
a.asn1.DERNumericString = function(r) {
|
|
1751
|
+
a.asn1.DERNumericString.superclass.constructor.call(this, r), this.hT = "12";
|
|
1824
1752
|
};
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1753
|
+
m.lang.extend(a.asn1.DERNumericString, a.asn1.DERAbstractString);
|
|
1754
|
+
a.asn1.DERPrintableString = function(r) {
|
|
1755
|
+
a.asn1.DERPrintableString.superclass.constructor.call(this, r), this.hT = "13";
|
|
1828
1756
|
};
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1757
|
+
m.lang.extend(a.asn1.DERPrintableString, a.asn1.DERAbstractString);
|
|
1758
|
+
a.asn1.DERTeletexString = function(r) {
|
|
1759
|
+
a.asn1.DERTeletexString.superclass.constructor.call(this, r), this.hT = "14";
|
|
1832
1760
|
};
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1761
|
+
m.lang.extend(a.asn1.DERTeletexString, a.asn1.DERAbstractString);
|
|
1762
|
+
a.asn1.DERIA5String = function(r) {
|
|
1763
|
+
a.asn1.DERIA5String.superclass.constructor.call(this, r), this.hT = "16";
|
|
1836
1764
|
};
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1765
|
+
m.lang.extend(a.asn1.DERIA5String, a.asn1.DERAbstractString);
|
|
1766
|
+
a.asn1.DERUTCTime = function(r) {
|
|
1767
|
+
a.asn1.DERUTCTime.superclass.constructor.call(this, r), this.hT = "17", this.setByDate = function(t) {
|
|
1840
1768
|
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
|
|
1841
1769
|
}, this.getFreshValueHex = function() {
|
|
1842
1770
|
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;
|
|
1843
1771
|
}, 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));
|
|
1844
1772
|
};
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1773
|
+
m.lang.extend(a.asn1.DERUTCTime, a.asn1.DERAbstractTime);
|
|
1774
|
+
a.asn1.DERGeneralizedTime = function(r) {
|
|
1775
|
+
a.asn1.DERGeneralizedTime.superclass.constructor.call(this, r), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
|
|
1848
1776
|
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
|
|
1849
1777
|
}, this.getFreshValueHex = function() {
|
|
1850
1778
|
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;
|
|
1851
1779
|
}, 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));
|
|
1852
1780
|
};
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1781
|
+
m.lang.extend(a.asn1.DERGeneralizedTime, a.asn1.DERAbstractTime);
|
|
1782
|
+
a.asn1.DERSequence = function(r) {
|
|
1783
|
+
a.asn1.DERSequence.superclass.constructor.call(this, r), this.hT = "30", this.getFreshValueHex = function() {
|
|
1856
1784
|
for (var t = "", e = 0; e < this.asn1Array.length; e++) {
|
|
1857
1785
|
var i = this.asn1Array[e];
|
|
1858
1786
|
t += i.getEncodedHex();
|
|
@@ -1860,9 +1788,9 @@ u.asn1.DERSequence = function(r) {
|
|
|
1860
1788
|
return this.hV = t, this.hV;
|
|
1861
1789
|
};
|
|
1862
1790
|
};
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1791
|
+
m.lang.extend(a.asn1.DERSequence, a.asn1.DERAbstractStructured);
|
|
1792
|
+
a.asn1.DERSet = function(r) {
|
|
1793
|
+
a.asn1.DERSet.superclass.constructor.call(this, r), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
|
|
1866
1794
|
for (var t = new Array(), e = 0; e < this.asn1Array.length; e++) {
|
|
1867
1795
|
var i = this.asn1Array[e];
|
|
1868
1796
|
t.push(i.getEncodedHex());
|
|
@@ -1870,16 +1798,16 @@ u.asn1.DERSet = function(r) {
|
|
|
1870
1798
|
return this.sortFlag == !0 && t.sort(), this.hV = t.join(""), this.hV;
|
|
1871
1799
|
}, typeof r < "u" && typeof r.sortflag < "u" && r.sortflag == !1 && (this.sortFlag = !1);
|
|
1872
1800
|
};
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1801
|
+
m.lang.extend(a.asn1.DERSet, a.asn1.DERAbstractStructured);
|
|
1802
|
+
a.asn1.DERTaggedObject = function(r) {
|
|
1803
|
+
a.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
|
|
1876
1804
|
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);
|
|
1877
1805
|
}, this.getFreshValueHex = function() {
|
|
1878
1806
|
return this.hV;
|
|
1879
1807
|
}, 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)));
|
|
1880
1808
|
};
|
|
1881
|
-
|
|
1882
|
-
var
|
|
1809
|
+
m.lang.extend(a.asn1.DERTaggedObject, a.asn1.ASN1Object);
|
|
1810
|
+
var zt = /* @__PURE__ */ function() {
|
|
1883
1811
|
var r = function(t, e) {
|
|
1884
1812
|
return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
|
|
1885
1813
|
i.__proto__ = n;
|
|
@@ -1896,37 +1824,37 @@ var ie = /* @__PURE__ */ function() {
|
|
|
1896
1824
|
}
|
|
1897
1825
|
t.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i());
|
|
1898
1826
|
};
|
|
1899
|
-
}(),
|
|
1827
|
+
}(), Tt = (
|
|
1900
1828
|
/** @class */
|
|
1901
1829
|
function(r) {
|
|
1902
|
-
|
|
1830
|
+
zt(t, r);
|
|
1903
1831
|
function t(e) {
|
|
1904
1832
|
var i = r.call(this) || this;
|
|
1905
1833
|
return e && (typeof e == "string" ? i.parseKey(e) : (t.hasPrivateKeyProperty(e) || t.hasPublicKeyProperty(e)) && i.parsePropertiesFrom(e)), i;
|
|
1906
1834
|
}
|
|
1907
1835
|
return t.prototype.parseKey = function(e) {
|
|
1908
1836
|
try {
|
|
1909
|
-
var i = 0, n = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, h = s.test(e) ?
|
|
1837
|
+
var i = 0, n = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, h = s.test(e) ? At.decode(e) : ot.unarmor(e), o = It.decode(h);
|
|
1910
1838
|
if (o.sub.length === 3 && (o = o.sub[2].sub[0]), o.sub.length === 9) {
|
|
1911
|
-
i = o.sub[1].getHexStringValue(), this.n =
|
|
1912
|
-
var
|
|
1913
|
-
this.d =
|
|
1914
|
-
var
|
|
1915
|
-
this.p =
|
|
1839
|
+
i = o.sub[1].getHexStringValue(), this.n = S(i, 16), n = o.sub[2].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1840
|
+
var f = o.sub[3].getHexStringValue();
|
|
1841
|
+
this.d = S(f, 16);
|
|
1842
|
+
var u = o.sub[4].getHexStringValue();
|
|
1843
|
+
this.p = S(u, 16);
|
|
1916
1844
|
var l = o.sub[5].getHexStringValue();
|
|
1917
|
-
this.q =
|
|
1918
|
-
var
|
|
1919
|
-
this.dmp1 =
|
|
1920
|
-
var
|
|
1921
|
-
this.dmq1 =
|
|
1845
|
+
this.q = S(l, 16);
|
|
1846
|
+
var g = o.sub[6].getHexStringValue();
|
|
1847
|
+
this.dmp1 = S(g, 16);
|
|
1848
|
+
var d = o.sub[7].getHexStringValue();
|
|
1849
|
+
this.dmq1 = S(d, 16);
|
|
1922
1850
|
var y = o.sub[8].getHexStringValue();
|
|
1923
|
-
this.coeff =
|
|
1851
|
+
this.coeff = S(y, 16);
|
|
1924
1852
|
} else if (o.sub.length === 2)
|
|
1925
1853
|
if (o.sub[0].sub) {
|
|
1926
|
-
var
|
|
1927
|
-
i = b.sub[0].getHexStringValue(), this.n =
|
|
1854
|
+
var T = o.sub[1], b = T.sub[0];
|
|
1855
|
+
i = b.sub[0].getHexStringValue(), this.n = S(i, 16), n = b.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1928
1856
|
} else
|
|
1929
|
-
i = o.sub[0].getHexStringValue(), this.n =
|
|
1857
|
+
i = o.sub[0].getHexStringValue(), this.n = S(i, 16), n = o.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1930
1858
|
else
|
|
1931
1859
|
return !1;
|
|
1932
1860
|
return !0;
|
|
@@ -1936,34 +1864,34 @@ var ie = /* @__PURE__ */ function() {
|
|
|
1936
1864
|
}, t.prototype.getPrivateBaseKey = function() {
|
|
1937
1865
|
var e = {
|
|
1938
1866
|
array: [
|
|
1939
|
-
new
|
|
1940
|
-
new
|
|
1941
|
-
new
|
|
1942
|
-
new
|
|
1943
|
-
new
|
|
1944
|
-
new
|
|
1945
|
-
new
|
|
1946
|
-
new
|
|
1947
|
-
new
|
|
1867
|
+
new a.asn1.DERInteger({ int: 0 }),
|
|
1868
|
+
new a.asn1.DERInteger({ bigint: this.n }),
|
|
1869
|
+
new a.asn1.DERInteger({ int: this.e }),
|
|
1870
|
+
new a.asn1.DERInteger({ bigint: this.d }),
|
|
1871
|
+
new a.asn1.DERInteger({ bigint: this.p }),
|
|
1872
|
+
new a.asn1.DERInteger({ bigint: this.q }),
|
|
1873
|
+
new a.asn1.DERInteger({ bigint: this.dmp1 }),
|
|
1874
|
+
new a.asn1.DERInteger({ bigint: this.dmq1 }),
|
|
1875
|
+
new a.asn1.DERInteger({ bigint: this.coeff })
|
|
1948
1876
|
]
|
|
1949
|
-
}, i = new
|
|
1877
|
+
}, i = new a.asn1.DERSequence(e);
|
|
1950
1878
|
return i.getEncodedHex();
|
|
1951
1879
|
}, t.prototype.getPrivateBaseKeyB64 = function() {
|
|
1952
1880
|
return W(this.getPrivateBaseKey());
|
|
1953
1881
|
}, t.prototype.getPublicBaseKey = function() {
|
|
1954
|
-
var e = new
|
|
1882
|
+
var e = new a.asn1.DERSequence({
|
|
1955
1883
|
array: [
|
|
1956
|
-
new
|
|
1957
|
-
new
|
|
1884
|
+
new a.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }),
|
|
1885
|
+
new a.asn1.DERNull()
|
|
1958
1886
|
]
|
|
1959
|
-
}), i = new
|
|
1887
|
+
}), i = new a.asn1.DERSequence({
|
|
1960
1888
|
array: [
|
|
1961
|
-
new
|
|
1962
|
-
new
|
|
1889
|
+
new a.asn1.DERInteger({ bigint: this.n }),
|
|
1890
|
+
new a.asn1.DERInteger({ int: this.e })
|
|
1963
1891
|
]
|
|
1964
|
-
}), n = new
|
|
1892
|
+
}), n = new a.asn1.DERBitString({
|
|
1965
1893
|
hex: "00" + i.getEncodedHex()
|
|
1966
|
-
}), s = new
|
|
1894
|
+
}), s = new a.asn1.DERSequence({
|
|
1967
1895
|
array: [e, n]
|
|
1968
1896
|
});
|
|
1969
1897
|
return s.getEncodedHex();
|
|
@@ -1993,15 +1921,15 @@ var ie = /* @__PURE__ */ function() {
|
|
|
1993
1921
|
}, t.prototype.parsePropertiesFrom = function(e) {
|
|
1994
1922
|
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);
|
|
1995
1923
|
}, t;
|
|
1996
|
-
}(
|
|
1997
|
-
), st,
|
|
1924
|
+
}(Lt)
|
|
1925
|
+
), st, Zt = typeof process < "u" ? (st = process.env) === null || st === void 0 ? void 0 : st.npm_package_version : void 0, et = (
|
|
1998
1926
|
/** @class */
|
|
1999
1927
|
function() {
|
|
2000
1928
|
function r(t) {
|
|
2001
1929
|
t === void 0 && (t = {}), t = 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 = null;
|
|
2002
1930
|
}
|
|
2003
1931
|
return r.prototype.setKey = function(t) {
|
|
2004
|
-
this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new
|
|
1932
|
+
this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new Tt(t);
|
|
2005
1933
|
}, r.prototype.setPrivateKey = function(t) {
|
|
2006
1934
|
this.setKey(t);
|
|
2007
1935
|
}, r.prototype.setPublicKey = function(t) {
|
|
@@ -2032,7 +1960,7 @@ var ie = /* @__PURE__ */ function() {
|
|
|
2032
1960
|
}
|
|
2033
1961
|
}, r.prototype.getKey = function(t) {
|
|
2034
1962
|
if (!this.key) {
|
|
2035
|
-
if (this.key = new
|
|
1963
|
+
if (this.key = new Tt(), t && {}.toString.call(t) === "[object Function]") {
|
|
2036
1964
|
this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
|
|
2037
1965
|
return;
|
|
2038
1966
|
}
|
|
@@ -2047,31 +1975,30 @@ var ie = /* @__PURE__ */ function() {
|
|
|
2047
1975
|
return this.getKey().getPublicKey();
|
|
2048
1976
|
}, r.prototype.getPublicKeyB64 = function() {
|
|
2049
1977
|
return this.getKey().getPublicBaseKeyB64();
|
|
2050
|
-
}, r.version =
|
|
1978
|
+
}, r.version = Zt, r;
|
|
2051
1979
|
}()
|
|
2052
1980
|
);
|
|
2053
|
-
function
|
|
1981
|
+
function Gt() {
|
|
2054
1982
|
const r = new et({ default_key_size: "2048" });
|
|
2055
1983
|
return {
|
|
2056
1984
|
publicKey: r.getPublicKey(),
|
|
2057
1985
|
privateKey: r.getPrivateKey()
|
|
2058
1986
|
};
|
|
2059
1987
|
}
|
|
2060
|
-
function
|
|
1988
|
+
function $t(r, t) {
|
|
2061
1989
|
const e = new et();
|
|
2062
1990
|
return e.setPublicKey(t), e.encrypt(r) || "";
|
|
2063
1991
|
}
|
|
2064
|
-
function
|
|
1992
|
+
function Jt(r, t) {
|
|
2065
1993
|
const e = new et();
|
|
2066
1994
|
return e.setPrivateKey(t), e.decrypt(r) || "";
|
|
2067
1995
|
}
|
|
2068
|
-
function
|
|
1996
|
+
function Yt() {
|
|
2069
1997
|
return typeof new et().encrypt == "function";
|
|
2070
1998
|
}
|
|
2071
1999
|
export {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
oe as u
|
|
2000
|
+
Jt as d,
|
|
2001
|
+
$t as e,
|
|
2002
|
+
Gt as g,
|
|
2003
|
+
Yt as i
|
|
2077
2004
|
};
|