ss-component-new 1.1.643 → 1.1.645
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/{array-B_wsE8_t.cjs → array-Dbtz7Lsx.cjs} +1 -1
- package/dist/{array-B8lWuPWk.js → array-NXwPkThl.js} +1 -1
- package/dist/{crypto-v3jAna0Y.js → crypto-BRyGpjGR.js} +383 -510
- package/dist/{crypto-DNSUM6-T.cjs → crypto-CRbcEKIz.cjs} +11 -11
- package/dist/{index-DkuHB0rR.js → index-B4gfcog1.js} +6 -6
- package/dist/index-B6ezvhL2.cjs +1 -0
- package/dist/{index-Dc9ujwGk.js → index-BHB6W84v.js} +1 -1
- package/dist/{index-CzRn17aQ.js → index-BKOLVNLy.js} +3 -3
- package/dist/index-BMUkNPzl.cjs +4207 -0
- package/dist/{index-B98K3NQ_.js → index-BMgOqys7.js} +5 -5
- package/dist/{index-CstZeLoO.js → index-BNPpYTxK.js} +4 -4
- package/dist/{index-Cq5FEQ8T.cjs → index-B_boHLxh.cjs} +1 -1
- package/dist/{index-yP9dxTXr.cjs → index-Bel0URH2.cjs} +1 -1
- package/dist/index-BseYBYRR.cjs +1 -0
- package/dist/{index-DZOOs3JX.js → index-BtO79Mkd.js} +5 -5
- package/dist/index-C0uZ6CrR.cjs +1 -0
- package/dist/{index-Bjsc84L1.js → index-C1fQQG9Y.js} +220 -222
- package/dist/{index-DaCmhrZN.js → index-C1okQZ1W.js} +5 -5
- package/dist/{index-Ce6cmWoK.js → index-CGBdaBEB.js} +1 -1
- package/dist/{index-TImrSuqA.js → index-CVDSoM3R.js} +7 -7
- package/dist/{index-DDZUeSoG.cjs → index-CXDxj3je.cjs} +1 -1
- package/dist/{index-B3z_K4tN.js → index-CXjnQuQm.js} +15 -17
- package/dist/{index-DnROsSAu.js → index-CnDGoX28.js} +1 -1
- package/dist/index-CnDYddiq.js +2511 -0
- package/dist/{index-H7RfjeN4.cjs → index-CvMwdfhw.cjs} +1 -1
- package/dist/index-CyTvXRd_.js +786 -0
- package/dist/{index-BXkdOTkd.js → index-CzC3BkW7.js} +6 -6
- package/dist/index-D-FbupVS.cjs +1 -0
- package/dist/{index-Dv0m3N6o.js → index-D4MvP0VN.js} +8702 -13692
- package/dist/index-D8yxAzMr.cjs +1 -0
- package/dist/{index-BGU26U8N.cjs → index-DG-Zzx6_.cjs} +12 -12
- package/dist/{index-C90tv0Xl.js → index-DK0ShkEj.js} +10 -9
- package/dist/{index-XoLdZvmA.cjs → index-DKoiQRFj.cjs} +1 -1
- package/dist/{index-CoO_L719.js → index-DUfwkFTo.js} +1 -1
- package/dist/{index-ugVCM2_1.cjs → index-DXpOifO9.cjs} +1 -1
- package/dist/index-DcXh-dz1.cjs +1 -0
- package/dist/{index-j_-9sdsj.js → index-DlrZ2H77.js} +5 -5
- package/dist/{index-D9rKJ22p.js → index-DroKEpJn.js} +25 -24
- package/dist/{index-Cf8HSIB7.js → index-DtFNS5JX.js} +1965 -1956
- package/dist/{index-S9mHFIiJ.js → index-DtOjrRlk.js} +8 -7
- package/dist/{index-CUE8dRo3.cjs → index-FCa5J2My.cjs} +1 -1
- package/dist/index-GtX0Y8gb.cjs +1 -0
- package/dist/{index-B3Uwh6Xf.cjs → index-HPLdZjoU.cjs} +1 -1
- package/dist/index-ZCzNjeSn.cjs +7 -0
- package/dist/{index-CeD_uFzd.cjs → index-_BlT7Ow2.cjs} +1 -1
- package/dist/{index-BV7GMSHu.cjs → index-cECmgKhq.cjs} +1 -1
- package/dist/{index-j-6MQx0k.cjs → index-e6ImJxWd.cjs} +1 -1
- package/dist/index-j8y7iBPh.cjs +1 -0
- package/dist/index-nkJMcLGo.js +4731 -0
- package/dist/{index-DamR6g_M.cjs → index-p5BDKj5j.cjs} +1 -1
- package/dist/index-uDDcvihH.cjs +1 -0
- package/dist/{index-DJq9wJbj.js → index-yCZoo-qN.js} +6 -6
- package/dist/{index.vue_vue_type_script_setup_true_lang-DmZ8M3M2.js → index.vue_vue_type_script_setup_true_lang-DKitPTZF.js} +7 -7
- package/dist/{index.vue_vue_type_script_setup_true_lang-DPRs_TEM.cjs → index.vue_vue_type_script_setup_true_lang-DLjUVVle.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CLRx6Pr7.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C6RGbzCD.js} +7870 -7846
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-G9Ly6LrV.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-orvz-niQ.cjs} +103 -103
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Bx59UssX.js → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-KpE1paY3.js} +12008 -11626
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Cx257lrG.cjs → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-ViCgptSE.cjs} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DnzbmtTR.js → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-BKiJ0n5W.js} +9 -10
- package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-Cri49ijq.cjs +1 -0
- package/dist/login-BiEodQd9.js +129 -0
- package/dist/login-zGHoUey-.cjs +1 -0
- package/dist/{main-Bytk3eJi.cjs → main-Cqr5wzb9.cjs} +1 -1
- package/dist/{main-B3z7cAFc.js → main-OXS6LXFh.js} +5 -5
- package/dist/{menu-EkyEcRhA.js → menu-Cl42pSjw.js} +1173 -1172
- package/dist/{menu-CcabvNj6.cjs → menu-nedhfMQM.cjs} +10 -10
- package/dist/{modelComp-DocJQ-pY.js → modelComp-DWx0hNJL.js} +1 -1
- package/dist/{modelComp-MsmKaqKZ.cjs → modelComp-VVOVTdqN.cjs} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +9 -9
- package/dist/{threeModel-DUi0i12h.cjs → threeModel-BGAaDA20.cjs} +1 -1
- package/dist/{threeModel-8fmYfsGI.js → threeModel-CCsYNDK0.js} +62 -62
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-B1zrlvmA.cjs +0 -1
- package/dist/index-BJOfcIfK.cjs +0 -1
- package/dist/index-BdSJGJAj.cjs +0 -1
- package/dist/index-BgOWcpJo.cjs +0 -1
- package/dist/index-BgjQ12lw.cjs +0 -1
- package/dist/index-BtbXPos3.cjs +0 -1
- package/dist/index-C0YmHmRc.js +0 -3295
- package/dist/index-CHDQYj9k.cjs +0 -7
- package/dist/index-DYLTl0bA.cjs +0 -4207
- package/dist/index-Wq7SUf3w.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-BxhCfpJ1.cjs +0 -1
|
@@ -1,189 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
for (const s of r) {
|
|
5
|
-
if (s[t] === e)
|
|
6
|
-
return s;
|
|
7
|
-
if (s[i] && ((n = s[i]) == null ? void 0 : n.length) > 0) {
|
|
8
|
-
const h = Tt(s[i], t, e);
|
|
9
|
-
if (h)
|
|
10
|
-
return h;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
function Mt() {
|
|
16
|
-
const r = /* @__PURE__ */ new Date(), t = r.getFullYear(), e = String(r.getMonth() + 1).padStart(2, "0"), i = String(r.getDate()).padStart(2, "0"), n = String(r.getHours()).padStart(2, "0"), s = String(r.getMinutes()).padStart(2, "0"), h = String(r.getSeconds()).padStart(2, "0");
|
|
17
|
-
return `${t}-${e}-${i} ${n}:${s}:${h}`;
|
|
18
|
-
}
|
|
19
|
-
function ue(r, t) {
|
|
20
|
-
const e = t.split("/");
|
|
21
|
-
let i = r, n = null;
|
|
22
|
-
for (let s of e) {
|
|
23
|
-
const h = i.find((o) => o.title === s);
|
|
24
|
-
if (!h)
|
|
25
|
-
return null;
|
|
26
|
-
n || (n = h), i = h.children ?? [];
|
|
27
|
-
}
|
|
28
|
-
return n;
|
|
29
|
-
}
|
|
30
|
-
const Ht = (r) => {
|
|
31
|
-
var e;
|
|
32
|
-
const t = r;
|
|
33
|
-
return t.children = (e = t.children) == null ? void 0 : e.map((i) => {
|
|
34
|
-
var n;
|
|
35
|
-
return (n = i == null ? void 0 : i.title) != null && n.children ? i == null ? void 0 : i.title : i;
|
|
36
|
-
}), t;
|
|
37
|
-
}, Kt = (r) => {
|
|
38
|
-
var t, e, i;
|
|
39
|
-
return Array.isArray(r == null ? void 0 : r.title) && ((t = r == null ? void 0 : r.title) == null ? void 0 : t.length) === ((i = (e = r == null ? void 0 : r.title) == null ? void 0 : e.filter((n) => n.title)) == null ? void 0 : i.length) ? r == null ? void 0 : r.title : Array.isArray(r == null ? void 0 : r.children) ? Ht(r) : r;
|
|
40
|
-
}, bt = (r, t) => {
|
|
41
|
-
const e = t, i = [];
|
|
42
|
-
r == null || r.forEach((s) => {
|
|
43
|
-
Array.isArray(s) ? i.push({ children: bt(s, []) }) : i.push({ title: s });
|
|
44
|
-
});
|
|
45
|
-
let n = i.reduce((s, h) => (Object.entries(h).forEach(([o, a]) => {
|
|
46
|
-
s[o] === void 0 ? a != null && a.title ? s[o] = [a] : s[o] = a : (Array.isArray(s[o]) || (s[o] = [{ title: s[o] }]), a != null && a.title || Array.isArray(a) ? s[o].push(a) : s[o].push({ title: a }));
|
|
47
|
-
}), s), {});
|
|
48
|
-
return n = Kt(Rt(n)), e.push(n), Array.isArray(e) && (e == null ? void 0 : e.length) > 1 ? e : e == null ? void 0 : e[0];
|
|
49
|
-
}, fe = (r) => {
|
|
50
|
-
let t = [], e = [];
|
|
51
|
-
return r == null || r.forEach((i) => {
|
|
52
|
-
t = bt(i, e);
|
|
53
|
-
}), t;
|
|
54
|
-
}, qt = Nt(Pt), { menus: _t } = Bt(qt), le = At("loginState", {
|
|
55
|
-
state: () => ({
|
|
56
|
-
superAdminInfo: {},
|
|
57
|
-
cryptoInfo: {
|
|
58
|
-
publicKey: "",
|
|
59
|
-
privateKey: ""
|
|
60
|
-
},
|
|
61
|
-
loginUserInfo: {},
|
|
62
|
-
structureData: [],
|
|
63
|
-
isStructureExist: !1
|
|
64
|
-
}),
|
|
65
|
-
actions: {
|
|
66
|
-
setSuperAdminInfo(r) {
|
|
67
|
-
this.superAdminInfo = r;
|
|
68
|
-
},
|
|
69
|
-
setLoginUserInfo(r) {
|
|
70
|
-
this.loginUserInfo = r;
|
|
71
|
-
},
|
|
72
|
-
setStructureData(r) {
|
|
73
|
-
this.structureData = r;
|
|
74
|
-
},
|
|
75
|
-
setIsStructureExist(r) {
|
|
76
|
-
this.isStructureExist = r;
|
|
77
|
-
},
|
|
78
|
-
async getModelSecretAsync(r) {
|
|
79
|
-
var e, i, n, s, h, o, a, f, l, p, d, y, S;
|
|
80
|
-
const t = await Vt({
|
|
81
|
-
key: {
|
|
82
|
-
systemKey: r ? r.systemKey : sessionStorage.getItem("systemKey"),
|
|
83
|
-
pageKey: "secret",
|
|
84
|
-
type: "system"
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
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 = (d = (p = t.data) == null ? void 0 : p.result[0]) == null ? void 0 : d.value) == null ? void 0 : y.cryptoInfo) == null ? void 0 : S.privateKey), {
|
|
88
|
-
publicKey: this.cryptoInfo.publicKey,
|
|
89
|
-
privateKey: this.cryptoInfo.privateKey
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
async setLogRecordAsync(r, t, e = "operate") {
|
|
93
|
-
var i;
|
|
94
|
-
try {
|
|
95
|
-
const n = Tt(_t.value, "path", t, "children");
|
|
96
|
-
if (!n) return;
|
|
97
|
-
const s = await It({
|
|
98
|
-
key: {
|
|
99
|
-
systemKey: sessionStorage.getItem("systemKey"),
|
|
100
|
-
pageKey: "/log",
|
|
101
|
-
type: "system",
|
|
102
|
-
logType: e
|
|
103
|
-
},
|
|
104
|
-
value: {
|
|
105
|
-
module: n ? n.title : t,
|
|
106
|
-
timeStamp: Mt(),
|
|
107
|
-
detail: { ...r }
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return ((i = s == null ? void 0 : s.data) == null ? void 0 : i.code) === 200;
|
|
111
|
-
} catch (n) {
|
|
112
|
-
Ot.error(n);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
persist: [
|
|
117
|
-
{
|
|
118
|
-
key: "loginState",
|
|
119
|
-
storage: localStorage,
|
|
120
|
-
pick: ["superAdminInfo"]
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
var Ft = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
125
|
-
function B(r) {
|
|
126
|
-
return Ft.charAt(r);
|
|
1
|
+
var Dt = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
2
|
+
function A(r) {
|
|
3
|
+
return Dt.charAt(r);
|
|
127
4
|
}
|
|
128
|
-
function
|
|
5
|
+
function xt(r, t) {
|
|
129
6
|
return r & t;
|
|
130
7
|
}
|
|
131
8
|
function Z(r, t) {
|
|
132
9
|
return r | t;
|
|
133
10
|
}
|
|
134
|
-
function
|
|
11
|
+
function ut(r, t) {
|
|
135
12
|
return r ^ t;
|
|
136
13
|
}
|
|
137
14
|
function lt(r, t) {
|
|
138
15
|
return r & ~t;
|
|
139
16
|
}
|
|
140
|
-
function
|
|
17
|
+
function Rt(r) {
|
|
141
18
|
if (r == 0)
|
|
142
19
|
return -1;
|
|
143
20
|
var t = 0;
|
|
144
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;
|
|
145
22
|
}
|
|
146
|
-
function
|
|
23
|
+
function Bt(r) {
|
|
147
24
|
for (var t = 0; r != 0; )
|
|
148
25
|
r &= r - 1, ++t;
|
|
149
26
|
return t;
|
|
150
27
|
}
|
|
151
|
-
var _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
28
|
+
var _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", mt = "=";
|
|
152
29
|
function W(r) {
|
|
153
30
|
var t, e, i = "";
|
|
154
31
|
for (t = 0; t + 3 <= r.length; t += 3)
|
|
155
32
|
e = parseInt(r.substring(t, t + 3), 16), i += _.charAt(e >> 6) + _.charAt(e & 63);
|
|
156
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; )
|
|
157
|
-
i +=
|
|
34
|
+
i += mt;
|
|
158
35
|
return i;
|
|
159
36
|
}
|
|
160
37
|
function ct(r) {
|
|
161
38
|
var t = "", e, i = 0, n = 0;
|
|
162
|
-
for (e = 0; e < r.length && r.charAt(e) !=
|
|
39
|
+
for (e = 0; e < r.length && r.charAt(e) != mt; ++e) {
|
|
163
40
|
var s = _.indexOf(r.charAt(e));
|
|
164
|
-
s < 0 || (i == 0 ? (t +=
|
|
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));
|
|
165
42
|
}
|
|
166
|
-
return i == 1 && (t +=
|
|
43
|
+
return i == 1 && (t += A(n << 2)), t;
|
|
167
44
|
}
|
|
168
|
-
var
|
|
45
|
+
var H, At = {
|
|
169
46
|
decode: function(r) {
|
|
170
47
|
var t;
|
|
171
|
-
if (
|
|
48
|
+
if (H === void 0) {
|
|
172
49
|
var e = "0123456789ABCDEF", i = ` \f
|
|
173
50
|
\r \u2028\u2029`;
|
|
174
|
-
for (
|
|
175
|
-
|
|
51
|
+
for (H = {}, t = 0; t < 16; ++t)
|
|
52
|
+
H[e.charAt(t)] = t;
|
|
176
53
|
for (e = e.toLowerCase(), t = 10; t < 16; ++t)
|
|
177
|
-
|
|
54
|
+
H[e.charAt(t)] = t;
|
|
178
55
|
for (t = 0; t < i.length; ++t)
|
|
179
|
-
|
|
56
|
+
H[i.charAt(t)] = -1;
|
|
180
57
|
}
|
|
181
58
|
var n = [], s = 0, h = 0;
|
|
182
59
|
for (t = 0; t < r.length; ++t) {
|
|
183
60
|
var o = r.charAt(t);
|
|
184
61
|
if (o == "=")
|
|
185
62
|
break;
|
|
186
|
-
if (o =
|
|
63
|
+
if (o = H[o], o != -1) {
|
|
187
64
|
if (o === void 0)
|
|
188
65
|
throw new Error("Illegal character at offset " + t);
|
|
189
66
|
s |= o, ++h >= 2 ? (n[n.length] = s, s = 0, h = 0) : s <<= 4;
|
|
@@ -239,7 +116,7 @@ var K, jt = {
|
|
|
239
116
|
throw new Error("RegExp out of sync");
|
|
240
117
|
return ot.decode(r);
|
|
241
118
|
}
|
|
242
|
-
},
|
|
119
|
+
}, C = 1e13, j = (
|
|
243
120
|
/** @class */
|
|
244
121
|
function() {
|
|
245
122
|
function r(t) {
|
|
@@ -248,32 +125,32 @@ var K, jt = {
|
|
|
248
125
|
return r.prototype.mulAdd = function(t, e) {
|
|
249
126
|
var i = this.buf, n = i.length, s, h;
|
|
250
127
|
for (s = 0; s < n; ++s)
|
|
251
|
-
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;
|
|
252
129
|
e > 0 && (i[s] = e);
|
|
253
130
|
}, r.prototype.sub = function(t) {
|
|
254
131
|
var e = this.buf, i = e.length, n, s;
|
|
255
132
|
for (n = 0; n < i; ++n)
|
|
256
|
-
s = e[n] - t, s < 0 ? (s +=
|
|
133
|
+
s = e[n] - t, s < 0 ? (s += C, t = 1) : t = 0, e[n] = s;
|
|
257
134
|
for (; e[e.length - 1] === 0; )
|
|
258
135
|
e.pop();
|
|
259
136
|
}, r.prototype.toString = function(t) {
|
|
260
137
|
if ((t || 10) != 10)
|
|
261
138
|
throw new Error("only base 10 is supported");
|
|
262
139
|
for (var e = this.buf, i = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n)
|
|
263
|
-
i += (
|
|
140
|
+
i += (C + e[n]).toString().substring(1);
|
|
264
141
|
return i;
|
|
265
142
|
}, r.prototype.valueOf = function() {
|
|
266
143
|
for (var t = this.buf, e = 0, i = t.length - 1; i >= 0; --i)
|
|
267
|
-
e = e *
|
|
144
|
+
e = e * C + t[i];
|
|
268
145
|
return e;
|
|
269
146
|
}, r.prototype.simplify = function() {
|
|
270
147
|
var t = this.buf;
|
|
271
148
|
return t.length == 1 ? t[0] : this;
|
|
272
149
|
}, r;
|
|
273
150
|
}()
|
|
274
|
-
),
|
|
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)?)?$/;
|
|
275
152
|
function F(r, t) {
|
|
276
|
-
return r.length > t && (r = r.substring(0, t) +
|
|
153
|
+
return r.length > t && (r = r.substring(0, t) + bt), r;
|
|
277
154
|
}
|
|
278
155
|
var rt = (
|
|
279
156
|
/** @class */
|
|
@@ -324,7 +201,7 @@ var rt = (
|
|
|
324
201
|
n = this.get(h++), s = this.get(h++), i += String.fromCharCode(n << 8 | s);
|
|
325
202
|
return i;
|
|
326
203
|
}, r.prototype.parseTime = function(t, e, i) {
|
|
327
|
-
var n = this.parseStringISO(t, e), s = (i ?
|
|
204
|
+
var n = this.parseStringISO(t, e), s = (i ? Ot : Vt).exec(n);
|
|
328
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;
|
|
329
206
|
}, r.prototype.parseInteger = function(t, e) {
|
|
330
207
|
for (var i = this.get(t), n = i > 127, s = n ? 255 : 0, h, o = ""; i == s && ++t < e; )
|
|
@@ -338,14 +215,14 @@ var rt = (
|
|
|
338
215
|
`;
|
|
339
216
|
}
|
|
340
217
|
n && (i = i - 256);
|
|
341
|
-
for (var
|
|
342
|
-
|
|
343
|
-
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();
|
|
344
221
|
}, r.prototype.parseBitString = function(t, e, i) {
|
|
345
222
|
for (var n = this.get(t), s = (e - t - 1 << 3) - n, h = "(" + s + ` bit)
|
|
346
|
-
`, o = "",
|
|
347
|
-
for (var
|
|
348
|
-
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";
|
|
349
226
|
if (o.length > i)
|
|
350
227
|
return h + F(o, i);
|
|
351
228
|
}
|
|
@@ -358,17 +235,17 @@ var rt = (
|
|
|
358
235
|
i /= 2, n > i && (e = t + i);
|
|
359
236
|
for (var h = t; h < e; ++h)
|
|
360
237
|
s += this.hexByte(this.get(h));
|
|
361
|
-
return n > i && (s +=
|
|
238
|
+
return n > i && (s += bt), s;
|
|
362
239
|
}, r.prototype.parseOID = function(t, e, i) {
|
|
363
240
|
for (var n = "", s = new j(), h = 0, o = t; o < e; ++o) {
|
|
364
|
-
var
|
|
365
|
-
if (s.mulAdd(128,
|
|
241
|
+
var f = this.get(o);
|
|
242
|
+
if (s.mulAdd(128, f & 127), h += 7, !(f & 128)) {
|
|
366
243
|
if (n === "")
|
|
367
244
|
if (s = s.simplify(), s instanceof j)
|
|
368
245
|
s.sub(80), n = "2." + s.toString();
|
|
369
246
|
else {
|
|
370
|
-
var
|
|
371
|
-
n =
|
|
247
|
+
var u = s < 80 ? s < 40 ? 0 : 1 : 2;
|
|
248
|
+
n = u + "." + (s - u * 40);
|
|
372
249
|
}
|
|
373
250
|
else
|
|
374
251
|
n += "." + s.toString();
|
|
@@ -380,7 +257,7 @@ var rt = (
|
|
|
380
257
|
return h > 0 && (n += ".incomplete"), n;
|
|
381
258
|
}, r;
|
|
382
259
|
}()
|
|
383
|
-
),
|
|
260
|
+
), It = (
|
|
384
261
|
/** @class */
|
|
385
262
|
function() {
|
|
386
263
|
function r(t, e, i, n, s) {
|
|
@@ -549,11 +426,11 @@ var rt = (
|
|
|
549
426
|
}, r.decode = function(t) {
|
|
550
427
|
var e;
|
|
551
428
|
t instanceof rt ? e = t : e = new rt(t, 0);
|
|
552
|
-
var i = new rt(e), n = new pt(e), s = r.decodeLength(e), h = e.pos, o = h - i.pos,
|
|
553
|
-
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 = [];
|
|
554
431
|
if (s !== null) {
|
|
555
432
|
for (var d = h + s; e.pos < d; )
|
|
556
|
-
|
|
433
|
+
g[g.length] = r.decode(e);
|
|
557
434
|
if (e.pos != d)
|
|
558
435
|
throw new Error("Content size is not correct for container starting at offset " + h);
|
|
559
436
|
} else
|
|
@@ -562,33 +439,33 @@ var rt = (
|
|
|
562
439
|
var y = r.decode(e);
|
|
563
440
|
if (y.tag.isEOC())
|
|
564
441
|
break;
|
|
565
|
-
|
|
442
|
+
g[g.length] = y;
|
|
566
443
|
}
|
|
567
444
|
s = h - e.pos;
|
|
568
|
-
} catch (
|
|
569
|
-
throw new Error("Exception while decoding undefined length content: " +
|
|
445
|
+
} catch (T) {
|
|
446
|
+
throw new Error("Exception while decoding undefined length content: " + T);
|
|
570
447
|
}
|
|
571
|
-
return
|
|
448
|
+
return g;
|
|
572
449
|
};
|
|
573
450
|
if (n.tagConstructed)
|
|
574
|
-
|
|
451
|
+
f = u();
|
|
575
452
|
else if (n.isUniversal() && (n.tagNumber == 3 || n.tagNumber == 4))
|
|
576
453
|
try {
|
|
577
454
|
if (n.tagNumber == 3 && e.get() != 0)
|
|
578
455
|
throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
|
|
579
|
-
|
|
580
|
-
for (var l = 0; l <
|
|
581
|
-
if (
|
|
456
|
+
f = u();
|
|
457
|
+
for (var l = 0; l < f.length; ++l)
|
|
458
|
+
if (f[l].tag.isEOC())
|
|
582
459
|
throw new Error("EOC is not supposed to be actual content.");
|
|
583
460
|
} catch {
|
|
584
|
-
|
|
461
|
+
f = null;
|
|
585
462
|
}
|
|
586
|
-
if (
|
|
463
|
+
if (f === null) {
|
|
587
464
|
if (s === null)
|
|
588
465
|
throw new Error("We can't skip over an invalid tag with undefined length at offset " + h);
|
|
589
466
|
e.pos = h + Math.abs(s);
|
|
590
467
|
}
|
|
591
|
-
return new r(i, o, s, n,
|
|
468
|
+
return new r(i, o, s, n, f);
|
|
592
469
|
}, r;
|
|
593
470
|
}()
|
|
594
471
|
), pt = (
|
|
@@ -610,7 +487,7 @@ var rt = (
|
|
|
610
487
|
return this.tagClass === 0 && this.tagNumber === 0;
|
|
611
488
|
}, r;
|
|
612
489
|
}()
|
|
613
|
-
),
|
|
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 = (
|
|
614
491
|
/** @class */
|
|
615
492
|
function() {
|
|
616
493
|
function r(t, e, i) {
|
|
@@ -632,13 +509,13 @@ var rt = (
|
|
|
632
509
|
e = 2;
|
|
633
510
|
else
|
|
634
511
|
return this.toRadix(t);
|
|
635
|
-
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;
|
|
636
513
|
if (o-- > 0)
|
|
637
|
-
for (
|
|
638
|
-
|
|
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));
|
|
639
516
|
return s ? h : "0";
|
|
640
517
|
}, r.prototype.negate = function() {
|
|
641
|
-
var t =
|
|
518
|
+
var t = p();
|
|
642
519
|
return r.ZERO.subTo(this, t), t;
|
|
643
520
|
}, r.prototype.abs = function() {
|
|
644
521
|
return this.s < 0 ? this.negate() : this;
|
|
@@ -654,15 +531,15 @@ var rt = (
|
|
|
654
531
|
return e;
|
|
655
532
|
return 0;
|
|
656
533
|
}, r.prototype.bitLength = function() {
|
|
657
|
-
return this.t <= 0 ? 0 : this.DB * (this.t - 1) +
|
|
534
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + G(this[this.t - 1] ^ this.s & this.DM);
|
|
658
535
|
}, r.prototype.mod = function(t) {
|
|
659
|
-
var e =
|
|
536
|
+
var e = p();
|
|
660
537
|
return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(r.ZERO) > 0 && t.subTo(e, e), e;
|
|
661
538
|
}, r.prototype.modPowInt = function(t, e) {
|
|
662
539
|
var i;
|
|
663
|
-
return t < 256 || e.isEven() ? i = new
|
|
540
|
+
return t < 256 || e.isEven() ? i = new vt(e) : i = new dt(e), this.exp(t, i);
|
|
664
541
|
}, r.prototype.clone = function() {
|
|
665
|
-
var t =
|
|
542
|
+
var t = p();
|
|
666
543
|
return this.copyTo(t), t;
|
|
667
544
|
}, r.prototype.intValue = function() {
|
|
668
545
|
if (this.s < 0) {
|
|
@@ -698,35 +575,35 @@ var rt = (
|
|
|
698
575
|
}, r.prototype.max = function(t) {
|
|
699
576
|
return this.compareTo(t) > 0 ? this : t;
|
|
700
577
|
}, r.prototype.and = function(t) {
|
|
701
|
-
var e =
|
|
702
|
-
return this.bitwiseTo(t,
|
|
578
|
+
var e = p();
|
|
579
|
+
return this.bitwiseTo(t, xt, e), e;
|
|
703
580
|
}, r.prototype.or = function(t) {
|
|
704
|
-
var e =
|
|
581
|
+
var e = p();
|
|
705
582
|
return this.bitwiseTo(t, Z, e), e;
|
|
706
583
|
}, r.prototype.xor = function(t) {
|
|
707
|
-
var e =
|
|
708
|
-
return this.bitwiseTo(t,
|
|
584
|
+
var e = p();
|
|
585
|
+
return this.bitwiseTo(t, ut, e), e;
|
|
709
586
|
}, r.prototype.andNot = function(t) {
|
|
710
|
-
var e =
|
|
587
|
+
var e = p();
|
|
711
588
|
return this.bitwiseTo(t, lt, e), e;
|
|
712
589
|
}, r.prototype.not = function() {
|
|
713
|
-
for (var t =
|
|
590
|
+
for (var t = p(), e = 0; e < this.t; ++e)
|
|
714
591
|
t[e] = this.DM & ~this[e];
|
|
715
592
|
return t.t = this.t, t.s = ~this.s, t;
|
|
716
593
|
}, r.prototype.shiftLeft = function(t) {
|
|
717
|
-
var e =
|
|
594
|
+
var e = p();
|
|
718
595
|
return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e;
|
|
719
596
|
}, r.prototype.shiftRight = function(t) {
|
|
720
|
-
var e =
|
|
597
|
+
var e = p();
|
|
721
598
|
return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e;
|
|
722
599
|
}, r.prototype.getLowestSetBit = function() {
|
|
723
600
|
for (var t = 0; t < this.t; ++t)
|
|
724
601
|
if (this[t] != 0)
|
|
725
|
-
return t * this.DB +
|
|
602
|
+
return t * this.DB + Rt(this[t]);
|
|
726
603
|
return this.s < 0 ? this.t * this.DB : -1;
|
|
727
604
|
}, r.prototype.bitCount = function() {
|
|
728
605
|
for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i)
|
|
729
|
-
t +=
|
|
606
|
+
t += Bt(this[i] ^ e);
|
|
730
607
|
return t;
|
|
731
608
|
}, r.prototype.testBit = function(t) {
|
|
732
609
|
var e = Math.floor(t / this.DB);
|
|
@@ -736,46 +613,46 @@ var rt = (
|
|
|
736
613
|
}, r.prototype.clearBit = function(t) {
|
|
737
614
|
return this.changeBit(t, lt);
|
|
738
615
|
}, r.prototype.flipBit = function(t) {
|
|
739
|
-
return this.changeBit(t,
|
|
616
|
+
return this.changeBit(t, ut);
|
|
740
617
|
}, r.prototype.add = function(t) {
|
|
741
|
-
var e =
|
|
618
|
+
var e = p();
|
|
742
619
|
return this.addTo(t, e), e;
|
|
743
620
|
}, r.prototype.subtract = function(t) {
|
|
744
|
-
var e =
|
|
621
|
+
var e = p();
|
|
745
622
|
return this.subTo(t, e), e;
|
|
746
623
|
}, r.prototype.multiply = function(t) {
|
|
747
|
-
var e =
|
|
624
|
+
var e = p();
|
|
748
625
|
return this.multiplyTo(t, e), e;
|
|
749
626
|
}, r.prototype.divide = function(t) {
|
|
750
|
-
var e =
|
|
627
|
+
var e = p();
|
|
751
628
|
return this.divRemTo(t, e, null), e;
|
|
752
629
|
}, r.prototype.remainder = function(t) {
|
|
753
|
-
var e =
|
|
630
|
+
var e = p();
|
|
754
631
|
return this.divRemTo(t, null, e), e;
|
|
755
632
|
}, r.prototype.divideAndRemainder = function(t) {
|
|
756
|
-
var e =
|
|
633
|
+
var e = p(), i = p();
|
|
757
634
|
return this.divRemTo(t, e, i), [e, i];
|
|
758
635
|
}, r.prototype.modPow = function(t, e) {
|
|
759
|
-
var i = t.bitLength(), n, s =
|
|
636
|
+
var i = t.bitLength(), n, s = O(1), h;
|
|
760
637
|
if (i <= 0)
|
|
761
638
|
return s;
|
|
762
|
-
i < 18 ? n = 1 : i < 48 ? n = 3 : i < 144 ? n = 4 : i < 768 ? n = 5 : n = 6, i < 8 ? h = new
|
|
763
|
-
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;
|
|
764
641
|
if (o[1] = h.convert(this), n > 1) {
|
|
765
|
-
var
|
|
766
|
-
for (h.sqrTo(o[1],
|
|
767
|
-
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;
|
|
768
645
|
}
|
|
769
|
-
var d = t.t - 1, y,
|
|
770
|
-
for (i =
|
|
771
|
-
for (i >=
|
|
772
|
-
y >>= 1, --
|
|
773
|
-
if ((i -=
|
|
774
|
-
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;
|
|
775
652
|
else {
|
|
776
|
-
for (;
|
|
777
|
-
h.sqrTo(s, b), h.sqrTo(b, s),
|
|
778
|
-
|
|
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);
|
|
779
656
|
}
|
|
780
657
|
for (; d >= 0 && (t[d] & 1 << i) == 0; )
|
|
781
658
|
h.sqrTo(s, b), E = s, s = b, b = E, --i < 0 && (i = this.DB - 1, --d);
|
|
@@ -785,24 +662,24 @@ var rt = (
|
|
|
785
662
|
var e = t.isEven();
|
|
786
663
|
if (this.isEven() && e || t.signum() == 0)
|
|
787
664
|
return r.ZERO;
|
|
788
|
-
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; ) {
|
|
789
666
|
for (; i.isEven(); )
|
|
790
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);
|
|
791
668
|
for (; n.isEven(); )
|
|
792
|
-
n.rShiftTo(1, n), e ? ((!o.isEven() || !
|
|
793
|
-
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));
|
|
794
671
|
}
|
|
795
672
|
if (n.compareTo(r.ONE) != 0)
|
|
796
673
|
return r.ZERO;
|
|
797
|
-
if (
|
|
798
|
-
return
|
|
799
|
-
if (
|
|
800
|
-
|
|
674
|
+
if (f.compareTo(t) >= 0)
|
|
675
|
+
return f.subtract(t);
|
|
676
|
+
if (f.signum() < 0)
|
|
677
|
+
f.addTo(t, f);
|
|
801
678
|
else
|
|
802
|
-
return
|
|
803
|
-
return
|
|
679
|
+
return f;
|
|
680
|
+
return f.signum() < 0 ? f.add(t) : f;
|
|
804
681
|
}, r.prototype.pow = function(t) {
|
|
805
|
-
return this.exp(t, new
|
|
682
|
+
return this.exp(t, new Mt());
|
|
806
683
|
}, r.prototype.gcd = function(t) {
|
|
807
684
|
var e = this.s < 0 ? this.negate() : this.clone(), i = t.s < 0 ? t.negate() : t.clone();
|
|
808
685
|
if (e.compareTo(i) < 0) {
|
|
@@ -826,7 +703,7 @@ var rt = (
|
|
|
826
703
|
if (i.isEven())
|
|
827
704
|
return !1;
|
|
828
705
|
for (e = 1; e < w.length; ) {
|
|
829
|
-
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; )
|
|
830
707
|
n *= w[s++];
|
|
831
708
|
for (n = i.modInt(n); e < s; )
|
|
832
709
|
if (n % w[e++] == 0)
|
|
@@ -882,10 +759,10 @@ var rt = (
|
|
|
882
759
|
e[i - t] = this[i];
|
|
883
760
|
e.t = Math.max(this.t - t, 0), e.s = this.s;
|
|
884
761
|
}, r.prototype.lShiftTo = function(t, e) {
|
|
885
|
-
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,
|
|
886
|
-
e[
|
|
887
|
-
for (var
|
|
888
|
-
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;
|
|
889
766
|
e[h] = o, e.t = this.t + h + 1, e.s = this.s, e.clamp();
|
|
890
767
|
}, r.prototype.rShiftTo = function(t, e) {
|
|
891
768
|
e.s = this.s;
|
|
@@ -935,21 +812,21 @@ var rt = (
|
|
|
935
812
|
e != null && e.fromInt(0), i != null && this.copyTo(i);
|
|
936
813
|
return;
|
|
937
814
|
}
|
|
938
|
-
i == null && (i =
|
|
939
|
-
var h =
|
|
940
|
-
|
|
941
|
-
var l = h.t,
|
|
942
|
-
if (
|
|
943
|
-
var d =
|
|
944
|
-
for (h.dlShiftTo(M,
|
|
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();
|
|
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; )
|
|
945
822
|
h[h.t++] = 0;
|
|
946
823
|
for (; --M >= 0; ) {
|
|
947
|
-
var
|
|
948
|
-
if ((i[E] += h.am(0,
|
|
949
|
-
for (h.dlShiftTo(M,
|
|
950
|
-
i.subTo(
|
|
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; )
|
|
827
|
+
i.subTo(B, i);
|
|
951
828
|
}
|
|
952
|
-
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);
|
|
953
830
|
}
|
|
954
831
|
}
|
|
955
832
|
}, r.prototype.invDigit = function() {
|
|
@@ -965,7 +842,7 @@ var rt = (
|
|
|
965
842
|
}, r.prototype.exp = function(t, e) {
|
|
966
843
|
if (t > 4294967295 || t < 1)
|
|
967
844
|
return r.ONE;
|
|
968
|
-
var i =
|
|
845
|
+
var i = p(), n = p(), s = e.convert(this), h = G(t) - 1;
|
|
969
846
|
for (s.copyTo(i); --h >= 0; )
|
|
970
847
|
if (e.sqrTo(i, n), (t & 1 << h) > 0)
|
|
971
848
|
e.mulTo(n, s, i);
|
|
@@ -979,19 +856,19 @@ var rt = (
|
|
|
979
856
|
}, r.prototype.toRadix = function(t) {
|
|
980
857
|
if (t == null && (t = 10), this.signum() == 0 || t < 2 || t > 36)
|
|
981
858
|
return "0";
|
|
982
|
-
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 = "";
|
|
983
860
|
for (this.divRemTo(n, s, h); s.signum() > 0; )
|
|
984
861
|
o = (i + h.intValue()).toString(t).substr(1) + o, s.divRemTo(n, s, h);
|
|
985
862
|
return h.intValue().toString(t) + o;
|
|
986
863
|
}, r.prototype.fromRadix = function(t, e) {
|
|
987
864
|
this.fromInt(0), e == null && (e = 10);
|
|
988
|
-
for (var i = this.chunkSize(e), n = Math.pow(e, i), s = !1, h = 0, o = 0,
|
|
989
|
-
var
|
|
990
|
-
if (
|
|
991
|
-
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);
|
|
992
869
|
continue;
|
|
993
870
|
}
|
|
994
|
-
o = e * o +
|
|
871
|
+
o = e * o + u, ++h >= i && (this.dMultiply(n), this.dAddOffset(o, 0), h = 0, o = 0);
|
|
995
872
|
}
|
|
996
873
|
h > 0 && (this.dMultiply(Math.pow(e, h)), this.dAddOffset(o, 0)), s && r.ZERO.subTo(this, this);
|
|
997
874
|
}, r.prototype.fromNumber = function(t, e, i) {
|
|
@@ -1078,11 +955,11 @@ var rt = (
|
|
|
1078
955
|
return !1;
|
|
1079
956
|
var n = e.shiftRight(i);
|
|
1080
957
|
t = t + 1 >> 1, t > w.length && (t = w.length);
|
|
1081
|
-
for (var s =
|
|
958
|
+
for (var s = p(), h = 0; h < t; ++h) {
|
|
1082
959
|
s.fromInt(w[Math.floor(Math.random() * w.length)]);
|
|
1083
960
|
var o = s.modPow(n, this);
|
|
1084
961
|
if (o.compareTo(r.ONE) != 0 && o.compareTo(e) != 0) {
|
|
1085
|
-
for (var
|
|
962
|
+
for (var f = 1; f++ < i && o.compareTo(e) != 0; )
|
|
1086
963
|
if (o = o.modPowInt(2, this), o.compareTo(r.ONE) == 0)
|
|
1087
964
|
return !1;
|
|
1088
965
|
if (o.compareTo(e) != 0)
|
|
@@ -1091,7 +968,7 @@ var rt = (
|
|
|
1091
968
|
}
|
|
1092
969
|
return !0;
|
|
1093
970
|
}, r.prototype.square = function() {
|
|
1094
|
-
var t =
|
|
971
|
+
var t = p();
|
|
1095
972
|
return this.squareTo(t), t;
|
|
1096
973
|
}, r.prototype.gcda = function(t, e) {
|
|
1097
974
|
var i = this.s < 0 ? this.negate() : this.clone(), n = t.s < 0 ? t.negate() : t.clone();
|
|
@@ -1105,12 +982,12 @@ var rt = (
|
|
|
1105
982
|
return;
|
|
1106
983
|
}
|
|
1107
984
|
h < o && (o = h), o > 0 && (i.rShiftTo(o, i), n.rShiftTo(o, n));
|
|
1108
|
-
var
|
|
1109
|
-
(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() {
|
|
1110
987
|
e(n);
|
|
1111
988
|
}, 0));
|
|
1112
989
|
};
|
|
1113
|
-
setTimeout(
|
|
990
|
+
setTimeout(f, 10);
|
|
1114
991
|
}, r.prototype.fromNumberAsync = function(t, e, i, n) {
|
|
1115
992
|
if (typeof e == "number")
|
|
1116
993
|
if (t < 2)
|
|
@@ -1125,12 +1002,12 @@ var rt = (
|
|
|
1125
1002
|
setTimeout(h, 0);
|
|
1126
1003
|
}
|
|
1127
1004
|
else {
|
|
1128
|
-
var o = [],
|
|
1129
|
-
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);
|
|
1130
1007
|
}
|
|
1131
1008
|
}, r;
|
|
1132
1009
|
}()
|
|
1133
|
-
),
|
|
1010
|
+
), Mt = (
|
|
1134
1011
|
/** @class */
|
|
1135
1012
|
function() {
|
|
1136
1013
|
function r() {
|
|
@@ -1145,7 +1022,7 @@ var rt = (
|
|
|
1145
1022
|
t.squareTo(e);
|
|
1146
1023
|
}, r;
|
|
1147
1024
|
}()
|
|
1148
|
-
),
|
|
1025
|
+
), vt = (
|
|
1149
1026
|
/** @class */
|
|
1150
1027
|
function() {
|
|
1151
1028
|
function r(t) {
|
|
@@ -1163,17 +1040,17 @@ var rt = (
|
|
|
1163
1040
|
t.squareTo(e), this.reduce(e);
|
|
1164
1041
|
}, r;
|
|
1165
1042
|
}()
|
|
1166
|
-
),
|
|
1043
|
+
), dt = (
|
|
1167
1044
|
/** @class */
|
|
1168
1045
|
function() {
|
|
1169
1046
|
function r(t) {
|
|
1170
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;
|
|
1171
1048
|
}
|
|
1172
1049
|
return r.prototype.convert = function(t) {
|
|
1173
|
-
var e =
|
|
1050
|
+
var e = p();
|
|
1174
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;
|
|
1175
1052
|
}, r.prototype.revert = function(t) {
|
|
1176
|
-
var e =
|
|
1053
|
+
var e = p();
|
|
1177
1054
|
return t.copyTo(e), this.reduce(e), e;
|
|
1178
1055
|
}, r.prototype.reduce = function(t) {
|
|
1179
1056
|
for (; t.t <= this.mt2; )
|
|
@@ -1190,18 +1067,18 @@ var rt = (
|
|
|
1190
1067
|
t.squareTo(e), this.reduce(e);
|
|
1191
1068
|
}, r;
|
|
1192
1069
|
}()
|
|
1193
|
-
),
|
|
1070
|
+
), qt = (
|
|
1194
1071
|
/** @class */
|
|
1195
1072
|
function() {
|
|
1196
1073
|
function r(t) {
|
|
1197
|
-
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);
|
|
1198
1075
|
}
|
|
1199
1076
|
return r.prototype.convert = function(t) {
|
|
1200
1077
|
if (t.s < 0 || t.t > 2 * this.m.t)
|
|
1201
1078
|
return t.mod(this.m);
|
|
1202
1079
|
if (t.compareTo(this.m) < 0)
|
|
1203
1080
|
return t;
|
|
1204
|
-
var e =
|
|
1081
|
+
var e = p();
|
|
1205
1082
|
return t.copyTo(e), this.reduce(e), e;
|
|
1206
1083
|
}, r.prototype.revert = function(t) {
|
|
1207
1084
|
return t;
|
|
@@ -1217,64 +1094,64 @@ var rt = (
|
|
|
1217
1094
|
}, r;
|
|
1218
1095
|
}()
|
|
1219
1096
|
);
|
|
1220
|
-
function
|
|
1097
|
+
function p() {
|
|
1221
1098
|
return new c(null);
|
|
1222
1099
|
}
|
|
1223
|
-
function
|
|
1100
|
+
function S(r, t) {
|
|
1224
1101
|
return new c(r, t);
|
|
1225
1102
|
}
|
|
1226
1103
|
var yt = typeof navigator < "u";
|
|
1227
1104
|
yt && gt && navigator.appName == "Microsoft Internet Explorer" ? (c.prototype.am = function(t, e, i, n, s, h) {
|
|
1228
|
-
for (var o = e & 32767,
|
|
1229
|
-
var
|
|
1230
|
-
|
|
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;
|
|
1231
1108
|
}
|
|
1232
1109
|
return s;
|
|
1233
|
-
},
|
|
1110
|
+
}, I = 30) : yt && gt && navigator.appName != "Netscape" ? (c.prototype.am = function(t, e, i, n, s, h) {
|
|
1234
1111
|
for (; --h >= 0; ) {
|
|
1235
1112
|
var o = e * this[t++] + i[n] + s;
|
|
1236
1113
|
s = Math.floor(o / 67108864), i[n++] = o & 67108863;
|
|
1237
1114
|
}
|
|
1238
1115
|
return s;
|
|
1239
|
-
},
|
|
1240
|
-
for (var o = e & 16383,
|
|
1241
|
-
var
|
|
1242
|
-
|
|
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;
|
|
1243
1120
|
}
|
|
1244
1121
|
return s;
|
|
1245
|
-
},
|
|
1246
|
-
c.prototype.DB =
|
|
1247
|
-
c.prototype.DM = (1 <<
|
|
1248
|
-
c.prototype.DV = 1 <<
|
|
1249
|
-
var
|
|
1250
|
-
c.prototype.FV = Math.pow(2,
|
|
1251
|
-
c.prototype.F1 =
|
|
1252
|
-
c.prototype.F2 = 2 *
|
|
1253
|
-
var tt = [],
|
|
1254
|
-
|
|
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;
|
|
1255
1132
|
for (D = 0; D <= 9; ++D)
|
|
1256
|
-
tt[
|
|
1257
|
-
|
|
1133
|
+
tt[K++] = D;
|
|
1134
|
+
K = 97;
|
|
1258
1135
|
for (D = 10; D < 36; ++D)
|
|
1259
|
-
tt[
|
|
1260
|
-
|
|
1136
|
+
tt[K++] = D;
|
|
1137
|
+
K = 65;
|
|
1261
1138
|
for (D = 10; D < 36; ++D)
|
|
1262
|
-
tt[
|
|
1139
|
+
tt[K++] = D;
|
|
1263
1140
|
function St(r, t) {
|
|
1264
1141
|
var e = tt[r.charCodeAt(t)];
|
|
1265
1142
|
return e ?? -1;
|
|
1266
1143
|
}
|
|
1267
|
-
function
|
|
1268
|
-
var t =
|
|
1144
|
+
function O(r) {
|
|
1145
|
+
var t = p();
|
|
1269
1146
|
return t.fromInt(r), t;
|
|
1270
1147
|
}
|
|
1271
|
-
function
|
|
1148
|
+
function G(r) {
|
|
1272
1149
|
var t = 1, e;
|
|
1273
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;
|
|
1274
1151
|
}
|
|
1275
|
-
c.ZERO =
|
|
1276
|
-
c.ONE =
|
|
1277
|
-
var
|
|
1152
|
+
c.ZERO = O(0);
|
|
1153
|
+
c.ONE = O(1);
|
|
1154
|
+
var Ht = (
|
|
1278
1155
|
/** @class */
|
|
1279
1156
|
function() {
|
|
1280
1157
|
function r() {
|
|
@@ -1293,42 +1170,42 @@ var Xt = (
|
|
|
1293
1170
|
}, r;
|
|
1294
1171
|
}()
|
|
1295
1172
|
);
|
|
1296
|
-
function
|
|
1297
|
-
return new
|
|
1173
|
+
function Ct() {
|
|
1174
|
+
return new Ht();
|
|
1298
1175
|
}
|
|
1299
|
-
var
|
|
1300
|
-
if (
|
|
1301
|
-
|
|
1176
|
+
var wt = 256, $, V = null, R;
|
|
1177
|
+
if (V == null) {
|
|
1178
|
+
V = [], R = 0;
|
|
1302
1179
|
var J = void 0;
|
|
1303
1180
|
if (typeof window < "u" && window.crypto && window.crypto.getRandomValues) {
|
|
1304
1181
|
var nt = new Uint32Array(256);
|
|
1305
1182
|
for (window.crypto.getRandomValues(nt), J = 0; J < nt.length; ++J)
|
|
1306
|
-
|
|
1183
|
+
V[R++] = nt[J] & 255;
|
|
1307
1184
|
}
|
|
1308
1185
|
var Y = 0, X = function(r) {
|
|
1309
|
-
if (Y = Y || 0, Y >= 256 || R >=
|
|
1186
|
+
if (Y = Y || 0, Y >= 256 || R >= wt) {
|
|
1310
1187
|
window.removeEventListener ? window.removeEventListener("mousemove", X, !1) : window.detachEvent && window.detachEvent("onmousemove", X);
|
|
1311
1188
|
return;
|
|
1312
1189
|
}
|
|
1313
1190
|
try {
|
|
1314
1191
|
var t = r.x + r.y;
|
|
1315
|
-
|
|
1192
|
+
V[R++] = t & 255, Y += 1;
|
|
1316
1193
|
} catch {
|
|
1317
1194
|
}
|
|
1318
1195
|
};
|
|
1319
1196
|
typeof window < "u" && (window.addEventListener ? window.addEventListener("mousemove", X, !1) : window.attachEvent && window.attachEvent("onmousemove", X));
|
|
1320
1197
|
}
|
|
1321
|
-
function
|
|
1322
|
-
if (
|
|
1323
|
-
for (
|
|
1198
|
+
function _t() {
|
|
1199
|
+
if ($ == null) {
|
|
1200
|
+
for ($ = Ct(); R < wt; ) {
|
|
1324
1201
|
var r = Math.floor(65536 * Math.random());
|
|
1325
|
-
|
|
1202
|
+
V[R++] = r & 255;
|
|
1326
1203
|
}
|
|
1327
|
-
for (
|
|
1328
|
-
|
|
1204
|
+
for ($.init(V), R = 0; R < V.length; ++R)
|
|
1205
|
+
V[R] = 0;
|
|
1329
1206
|
R = 0;
|
|
1330
1207
|
}
|
|
1331
|
-
return
|
|
1208
|
+
return $.next();
|
|
1332
1209
|
}
|
|
1333
1210
|
var ht = (
|
|
1334
1211
|
/** @class */
|
|
@@ -1337,19 +1214,19 @@ var ht = (
|
|
|
1337
1214
|
}
|
|
1338
1215
|
return r.prototype.nextBytes = function(t) {
|
|
1339
1216
|
for (var e = 0; e < t.length; ++e)
|
|
1340
|
-
t[e] =
|
|
1217
|
+
t[e] = _t();
|
|
1341
1218
|
}, r;
|
|
1342
1219
|
}()
|
|
1343
1220
|
);
|
|
1344
|
-
function
|
|
1221
|
+
function Ft(r, t) {
|
|
1345
1222
|
if (t < r.length + 22)
|
|
1346
1223
|
return console.error("Message too long for RSA"), null;
|
|
1347
1224
|
for (var e = t - r.length - 6, i = "", n = 0; n < e; n += 2)
|
|
1348
1225
|
i += "ff";
|
|
1349
1226
|
var s = "0001" + i + "00" + r;
|
|
1350
|
-
return
|
|
1227
|
+
return S(s, 16);
|
|
1351
1228
|
}
|
|
1352
|
-
function
|
|
1229
|
+
function Kt(r, t) {
|
|
1353
1230
|
if (t < r.length + 11)
|
|
1354
1231
|
return console.error("Message too long for RSA"), null;
|
|
1355
1232
|
for (var e = [], i = r.length - 1; i >= 0 && t > 0; ) {
|
|
@@ -1364,7 +1241,7 @@ function ee(r, t) {
|
|
|
1364
1241
|
}
|
|
1365
1242
|
return e[--t] = 2, e[--t] = 0, new c(e);
|
|
1366
1243
|
}
|
|
1367
|
-
var
|
|
1244
|
+
var Lt = (
|
|
1368
1245
|
/** @class */
|
|
1369
1246
|
function() {
|
|
1370
1247
|
function r() {
|
|
@@ -1379,9 +1256,9 @@ var ie = (
|
|
|
1379
1256
|
e = e.add(this.p);
|
|
1380
1257
|
return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i);
|
|
1381
1258
|
}, r.prototype.setPublic = function(t, e) {
|
|
1382
|
-
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");
|
|
1383
1260
|
}, r.prototype.encrypt = function(t) {
|
|
1384
|
-
var e = this.n.bitLength() + 7 >> 3, i =
|
|
1261
|
+
var e = this.n.bitLength() + 7 >> 3, i = Kt(t, e);
|
|
1385
1262
|
if (i == null)
|
|
1386
1263
|
return null;
|
|
1387
1264
|
var n = this.doPublic(i);
|
|
@@ -1391,9 +1268,9 @@ var ie = (
|
|
|
1391
1268
|
s = "0" + s;
|
|
1392
1269
|
return s;
|
|
1393
1270
|
}, r.prototype.setPrivate = function(t, e, i) {
|
|
1394
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n =
|
|
1395
|
-
}, r.prototype.setPrivateEx = function(t, e, i, n, s, h, o,
|
|
1396
|
-
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");
|
|
1397
1274
|
}, r.prototype.generate = function(t, e) {
|
|
1398
1275
|
var i = new ht(), n = t >> 1;
|
|
1399
1276
|
this.e = parseInt(e, 16);
|
|
@@ -1406,63 +1283,63 @@ var ie = (
|
|
|
1406
1283
|
var h = this.p;
|
|
1407
1284
|
this.p = this.q, this.q = h;
|
|
1408
1285
|
}
|
|
1409
|
-
var o = this.p.subtract(c.ONE),
|
|
1410
|
-
if (
|
|
1411
|
-
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);
|
|
1412
1289
|
break;
|
|
1413
1290
|
}
|
|
1414
1291
|
}
|
|
1415
1292
|
}, r.prototype.decrypt = function(t) {
|
|
1416
|
-
var e =
|
|
1417
|
-
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);
|
|
1418
1295
|
}, r.prototype.generateAsync = function(t, e, i) {
|
|
1419
1296
|
var n = new ht(), s = t >> 1;
|
|
1420
1297
|
this.e = parseInt(e, 16);
|
|
1421
|
-
var h = new c(e, 16), o = this,
|
|
1422
|
-
var
|
|
1298
|
+
var h = new c(e, 16), o = this, f = function() {
|
|
1299
|
+
var u = function() {
|
|
1423
1300
|
if (o.p.compareTo(o.q) <= 0) {
|
|
1424
1301
|
var d = o.p;
|
|
1425
1302
|
o.p = o.q, o.q = d;
|
|
1426
1303
|
}
|
|
1427
|
-
var y = o.p.subtract(c.ONE),
|
|
1428
|
-
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() {
|
|
1429
1306
|
i();
|
|
1430
|
-
}, 0)) : setTimeout(
|
|
1307
|
+
}, 0)) : setTimeout(f, 0);
|
|
1431
1308
|
}, l = function() {
|
|
1432
|
-
o.q =
|
|
1309
|
+
o.q = p(), o.q.fromNumberAsync(s, 1, n, function() {
|
|
1433
1310
|
o.q.subtract(c.ONE).gcda(h, function(d) {
|
|
1434
|
-
d.compareTo(c.ONE) == 0 && o.q.isProbablePrime(10) ? setTimeout(
|
|
1311
|
+
d.compareTo(c.ONE) == 0 && o.q.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(l, 0);
|
|
1435
1312
|
});
|
|
1436
1313
|
});
|
|
1437
|
-
},
|
|
1438
|
-
o.p =
|
|
1314
|
+
}, g = function() {
|
|
1315
|
+
o.p = p(), o.p.fromNumberAsync(t - s, 1, n, function() {
|
|
1439
1316
|
o.p.subtract(c.ONE).gcda(h, function(d) {
|
|
1440
|
-
d.compareTo(c.ONE) == 0 && o.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(
|
|
1317
|
+
d.compareTo(c.ONE) == 0 && o.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(g, 0);
|
|
1441
1318
|
});
|
|
1442
1319
|
});
|
|
1443
1320
|
};
|
|
1444
|
-
setTimeout(
|
|
1321
|
+
setTimeout(g, 0);
|
|
1445
1322
|
};
|
|
1446
|
-
setTimeout(
|
|
1323
|
+
setTimeout(f, 0);
|
|
1447
1324
|
}, r.prototype.sign = function(t, e, i) {
|
|
1448
|
-
var n =
|
|
1325
|
+
var n = jt(i), s = n + e(t).toString(), h = Ft(s, this.n.bitLength() / 4);
|
|
1449
1326
|
if (h == null)
|
|
1450
1327
|
return null;
|
|
1451
1328
|
var o = this.doPrivate(h);
|
|
1452
1329
|
if (o == null)
|
|
1453
1330
|
return null;
|
|
1454
|
-
var
|
|
1455
|
-
return (
|
|
1331
|
+
var f = o.toString(16);
|
|
1332
|
+
return (f.length & 1) == 0 ? f : "0" + f;
|
|
1456
1333
|
}, r.prototype.verify = function(t, e, i) {
|
|
1457
|
-
var n =
|
|
1334
|
+
var n = S(e, 16), s = this.doPublic(n);
|
|
1458
1335
|
if (s == null)
|
|
1459
1336
|
return null;
|
|
1460
|
-
var h = s.toString(16).replace(/^1f+00/, ""), o =
|
|
1337
|
+
var h = s.toString(16).replace(/^1f+00/, ""), o = kt(h);
|
|
1461
1338
|
return o == i(t).toString();
|
|
1462
1339
|
}, r;
|
|
1463
1340
|
}()
|
|
1464
1341
|
);
|
|
1465
|
-
function
|
|
1342
|
+
function Ut(r, t) {
|
|
1466
1343
|
for (var e = r.toByteArray(), i = 0; i < e.length && e[i] == 0; )
|
|
1467
1344
|
++i;
|
|
1468
1345
|
if (e.length - i != t - 1 || e[i] != 2)
|
|
@@ -1486,10 +1363,10 @@ var Q = {
|
|
|
1486
1363
|
sha512: "3051300d060960864801650304020305000440",
|
|
1487
1364
|
ripemd160: "3021300906052b2403020105000414"
|
|
1488
1365
|
};
|
|
1489
|
-
function
|
|
1366
|
+
function jt(r) {
|
|
1490
1367
|
return Q[r] || "";
|
|
1491
1368
|
}
|
|
1492
|
-
function
|
|
1369
|
+
function kt(r) {
|
|
1493
1370
|
for (var t in Q)
|
|
1494
1371
|
if (Q.hasOwnProperty(t)) {
|
|
1495
1372
|
var e = Q[t], i = e.length;
|
|
@@ -1504,8 +1381,8 @@ Code licensed under the BSD License:
|
|
|
1504
1381
|
http://developer.yahoo.com/yui/license.html
|
|
1505
1382
|
version: 2.9.0
|
|
1506
1383
|
*/
|
|
1507
|
-
var
|
|
1508
|
-
|
|
1384
|
+
var m = {};
|
|
1385
|
+
m.lang = {
|
|
1509
1386
|
/**
|
|
1510
1387
|
* Utility to set up the prototype, constructor and superclass properties to
|
|
1511
1388
|
* support an inheritance strategy that can chain constructors and methods.
|
|
@@ -1532,10 +1409,10 @@ T.lang = {
|
|
|
1532
1409
|
var s = function() {
|
|
1533
1410
|
}, h = ["toString", "valueOf"];
|
|
1534
1411
|
try {
|
|
1535
|
-
/MSIE/.test(navigator.userAgent) && (s = function(o,
|
|
1412
|
+
/MSIE/.test(navigator.userAgent) && (s = function(o, f) {
|
|
1536
1413
|
for (n = 0; n < h.length; n = n + 1) {
|
|
1537
|
-
var
|
|
1538
|
-
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);
|
|
1539
1416
|
}
|
|
1540
1417
|
});
|
|
1541
1418
|
} catch {
|
|
@@ -1552,9 +1429,9 @@ T.lang = {
|
|
|
1552
1429
|
* @since jsrsasign 2.1
|
|
1553
1430
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
1554
1431
|
*/
|
|
1555
|
-
var
|
|
1556
|
-
(typeof
|
|
1557
|
-
|
|
1432
|
+
var a = {};
|
|
1433
|
+
(typeof a.asn1 > "u" || !a.asn1) && (a.asn1 = {});
|
|
1434
|
+
a.asn1.ASN1Util = new function() {
|
|
1558
1435
|
this.integerToByteHex = function(r) {
|
|
1559
1436
|
var t = r.toString(16);
|
|
1560
1437
|
return t.length % 2 == 1 && (t = "0" + t), t;
|
|
@@ -1574,10 +1451,10 @@ u.asn1.ASN1Util = new function() {
|
|
|
1574
1451
|
}, this.getPEMStringFromHex = function(r, t) {
|
|
1575
1452
|
return hextopem(r, t);
|
|
1576
1453
|
}, this.newObject = function(r) {
|
|
1577
|
-
var t =
|
|
1578
|
-
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)
|
|
1579
1456
|
throw "key of param shall be only one.";
|
|
1580
|
-
var v =
|
|
1457
|
+
var v = at[0];
|
|
1581
1458
|
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + v + ":") == -1)
|
|
1582
1459
|
throw "undefined key: " + v;
|
|
1583
1460
|
if (v == "bool")
|
|
@@ -1591,19 +1468,19 @@ u.asn1.ASN1Util = new function() {
|
|
|
1591
1468
|
if (v == "null")
|
|
1592
1469
|
return new o(r[v]);
|
|
1593
1470
|
if (v == "oid")
|
|
1594
|
-
return new a(r[v]);
|
|
1595
|
-
if (v == "enum")
|
|
1596
1471
|
return new f(r[v]);
|
|
1472
|
+
if (v == "enum")
|
|
1473
|
+
return new u(r[v]);
|
|
1597
1474
|
if (v == "utf8str")
|
|
1598
1475
|
return new l(r[v]);
|
|
1599
1476
|
if (v == "numstr")
|
|
1600
|
-
return new
|
|
1477
|
+
return new g(r[v]);
|
|
1601
1478
|
if (v == "prnstr")
|
|
1602
1479
|
return new d(r[v]);
|
|
1603
1480
|
if (v == "telstr")
|
|
1604
1481
|
return new y(r[v]);
|
|
1605
1482
|
if (v == "ia5str")
|
|
1606
|
-
return new
|
|
1483
|
+
return new T(r[v]);
|
|
1607
1484
|
if (v == "utctime")
|
|
1608
1485
|
return new b(r[v]);
|
|
1609
1486
|
if (v == "gentime")
|
|
@@ -1620,22 +1497,22 @@ u.asn1.ASN1Util = new function() {
|
|
|
1620
1497
|
var it = k(L[N]);
|
|
1621
1498
|
U.push(it);
|
|
1622
1499
|
}
|
|
1623
|
-
return new
|
|
1500
|
+
return new B({ array: U });
|
|
1624
1501
|
}
|
|
1625
1502
|
if (v == "tag") {
|
|
1626
1503
|
var x = r[v];
|
|
1627
1504
|
if (Object.prototype.toString.call(x) === "[object Array]" && x.length == 3) {
|
|
1628
|
-
var
|
|
1629
|
-
return new
|
|
1505
|
+
var Et = k(x[2]);
|
|
1506
|
+
return new q({
|
|
1630
1507
|
tag: x[0],
|
|
1631
1508
|
explicit: x[1],
|
|
1632
|
-
obj:
|
|
1509
|
+
obj: Et
|
|
1633
1510
|
});
|
|
1634
1511
|
} else {
|
|
1635
1512
|
var z = {};
|
|
1636
1513
|
if (x.explicit !== void 0 && (z.explicit = x.explicit), x.tag !== void 0 && (z.tag = x.tag), x.obj === void 0)
|
|
1637
1514
|
throw "obj shall be specified for 'tag'.";
|
|
1638
|
-
return z.obj = k(x.obj), new
|
|
1515
|
+
return z.obj = k(x.obj), new q(z);
|
|
1639
1516
|
}
|
|
1640
1517
|
}
|
|
1641
1518
|
}, this.jsonToASN1HEX = function(r) {
|
|
@@ -1643,31 +1520,31 @@ u.asn1.ASN1Util = new function() {
|
|
|
1643
1520
|
return t.getEncodedHex();
|
|
1644
1521
|
};
|
|
1645
1522
|
}();
|
|
1646
|
-
|
|
1523
|
+
a.asn1.ASN1Util.oidHexToInt = function(r) {
|
|
1647
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) {
|
|
1648
|
-
var o = parseInt(r.substr(h, 2), 16),
|
|
1649
|
-
if (s = s +
|
|
1650
|
-
var
|
|
1651
|
-
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 = "";
|
|
1652
1529
|
}
|
|
1653
1530
|
}
|
|
1654
1531
|
return n;
|
|
1655
1532
|
};
|
|
1656
|
-
|
|
1533
|
+
a.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
1657
1534
|
var t = function(o) {
|
|
1658
|
-
var
|
|
1659
|
-
return
|
|
1535
|
+
var f = o.toString(16);
|
|
1536
|
+
return f.length == 1 && (f = "0" + f), f;
|
|
1660
1537
|
}, e = function(o) {
|
|
1661
|
-
var
|
|
1662
|
-
|
|
1663
|
-
for (var d = "", y = 0; y <
|
|
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++)
|
|
1664
1541
|
d += "0";
|
|
1665
1542
|
l = d + l;
|
|
1666
1543
|
for (var y = 0; y < l.length - 1; y += 7) {
|
|
1667
|
-
var
|
|
1668
|
-
y != l.length - 7 && (
|
|
1544
|
+
var T = l.substr(y, 7);
|
|
1545
|
+
y != l.length - 7 && (T = "1" + T), f += t(parseInt(T, 2));
|
|
1669
1546
|
}
|
|
1670
|
-
return
|
|
1547
|
+
return f;
|
|
1671
1548
|
};
|
|
1672
1549
|
if (!r.match(/^[0-9.]+$/))
|
|
1673
1550
|
throw "malformed oid string: " + r;
|
|
@@ -1677,7 +1554,7 @@ u.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
|
1677
1554
|
i += e(n[h]);
|
|
1678
1555
|
return i;
|
|
1679
1556
|
};
|
|
1680
|
-
|
|
1557
|
+
a.asn1.ASN1Object = function() {
|
|
1681
1558
|
var r = "";
|
|
1682
1559
|
this.getLengthHexFromValue = function() {
|
|
1683
1560
|
if (typeof this.hV > "u" || this.hV == null)
|
|
@@ -1700,8 +1577,8 @@ u.asn1.ASN1Object = function() {
|
|
|
1700
1577
|
return "";
|
|
1701
1578
|
};
|
|
1702
1579
|
};
|
|
1703
|
-
|
|
1704
|
-
|
|
1580
|
+
a.asn1.DERAbstractString = function(r) {
|
|
1581
|
+
a.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
|
|
1705
1582
|
return this.s;
|
|
1706
1583
|
}, this.setString = function(t) {
|
|
1707
1584
|
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s);
|
|
@@ -1711,21 +1588,21 @@ u.asn1.DERAbstractString = function(r) {
|
|
|
1711
1588
|
return this.hV;
|
|
1712
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));
|
|
1713
1590
|
};
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
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) {
|
|
1717
1594
|
utc = t.getTime() + t.getTimezoneOffset() * 6e4;
|
|
1718
1595
|
var e = new Date(utc);
|
|
1719
1596
|
return e;
|
|
1720
1597
|
}, this.formatDate = function(t, e, i) {
|
|
1721
1598
|
var n = this.zeroPadding, s = this.localDateToUTC(t), h = String(s.getFullYear());
|
|
1722
1599
|
e == "utc" && (h = h.substr(2, 2));
|
|
1723
|
-
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;
|
|
1724
1601
|
if (i === !0) {
|
|
1725
1602
|
var y = s.getMilliseconds();
|
|
1726
1603
|
if (y != 0) {
|
|
1727
|
-
var
|
|
1728
|
-
|
|
1604
|
+
var T = n(String(y), 3);
|
|
1605
|
+
T = T.replace(/[0]+$/, ""), d = d + "." + T;
|
|
1729
1606
|
}
|
|
1730
1607
|
}
|
|
1731
1608
|
return d + "Z";
|
|
@@ -1742,22 +1619,22 @@ u.asn1.DERAbstractTime = function(r) {
|
|
|
1742
1619
|
return this.hV;
|
|
1743
1620
|
};
|
|
1744
1621
|
};
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
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) {
|
|
1748
1625
|
this.hTLV = null, this.isModified = !0, this.asn1Array = t;
|
|
1749
1626
|
}, this.appendASN1Object = function(t) {
|
|
1750
1627
|
this.hTLV = null, this.isModified = !0, this.asn1Array.push(t);
|
|
1751
1628
|
}, this.asn1Array = new Array(), typeof r < "u" && typeof r.array < "u" && (this.asn1Array = r.array);
|
|
1752
1629
|
};
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
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";
|
|
1756
1633
|
};
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
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);
|
|
1761
1638
|
}, this.setByInteger = function(t) {
|
|
1762
1639
|
var e = new c(String(t), 10);
|
|
1763
1640
|
this.setByBigInteger(e);
|
|
@@ -1767,13 +1644,13 @@ u.asn1.DERInteger = function(r) {
|
|
|
1767
1644
|
return this.hV;
|
|
1768
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));
|
|
1769
1646
|
};
|
|
1770
|
-
|
|
1771
|
-
|
|
1647
|
+
m.lang.extend(a.asn1.DERInteger, a.asn1.ASN1Object);
|
|
1648
|
+
a.asn1.DERBitString = function(r) {
|
|
1772
1649
|
if (r !== void 0 && typeof r.obj < "u") {
|
|
1773
|
-
var t =
|
|
1650
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1774
1651
|
r.hex = "00" + t.getEncodedHex();
|
|
1775
1652
|
}
|
|
1776
|
-
|
|
1653
|
+
a.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
|
|
1777
1654
|
this.hTLV = null, this.isModified = !0, this.hV = e;
|
|
1778
1655
|
}, this.setUnusedBitsAndHexValue = function(e, i) {
|
|
1779
1656
|
if (e < 0 || 7 < e)
|
|
@@ -1803,36 +1680,36 @@ u.asn1.DERBitString = function(r) {
|
|
|
1803
1680
|
return this.hV;
|
|
1804
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));
|
|
1805
1682
|
};
|
|
1806
|
-
|
|
1807
|
-
|
|
1683
|
+
m.lang.extend(a.asn1.DERBitString, a.asn1.ASN1Object);
|
|
1684
|
+
a.asn1.DEROctetString = function(r) {
|
|
1808
1685
|
if (r !== void 0 && typeof r.obj < "u") {
|
|
1809
|
-
var t =
|
|
1686
|
+
var t = a.asn1.ASN1Util.newObject(r.obj);
|
|
1810
1687
|
r.hex = t.getEncodedHex();
|
|
1811
1688
|
}
|
|
1812
|
-
|
|
1689
|
+
a.asn1.DEROctetString.superclass.constructor.call(this, r), this.hT = "04";
|
|
1813
1690
|
};
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
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";
|
|
1817
1694
|
};
|
|
1818
|
-
|
|
1819
|
-
|
|
1695
|
+
m.lang.extend(a.asn1.DERNull, a.asn1.ASN1Object);
|
|
1696
|
+
a.asn1.DERObjectIdentifier = function(r) {
|
|
1820
1697
|
var t = function(i) {
|
|
1821
1698
|
var n = i.toString(16);
|
|
1822
1699
|
return n.length == 1 && (n = "0" + n), n;
|
|
1823
1700
|
}, e = function(i) {
|
|
1824
1701
|
var n = "", s = new c(i, 10), h = s.toString(2), o = 7 - h.length % 7;
|
|
1825
1702
|
o == 7 && (o = 0);
|
|
1826
|
-
for (var
|
|
1827
|
-
|
|
1828
|
-
h =
|
|
1829
|
-
for (var
|
|
1830
|
-
var l = h.substr(
|
|
1831
|
-
|
|
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));
|
|
1832
1709
|
}
|
|
1833
1710
|
return n;
|
|
1834
1711
|
};
|
|
1835
|
-
|
|
1712
|
+
a.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(i) {
|
|
1836
1713
|
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = i;
|
|
1837
1714
|
}, this.setValueOidString = function(i) {
|
|
1838
1715
|
if (!i.match(/^[0-9.]+$/))
|
|
@@ -1843,7 +1720,7 @@ u.asn1.DERObjectIdentifier = function(r) {
|
|
|
1843
1720
|
n += e(s[o]);
|
|
1844
1721
|
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n;
|
|
1845
1722
|
}, this.setValueName = function(i) {
|
|
1846
|
-
var n =
|
|
1723
|
+
var n = a.asn1.x509.OID.name2oid(i);
|
|
1847
1724
|
if (n !== "")
|
|
1848
1725
|
this.setValueOidString(n);
|
|
1849
1726
|
else
|
|
@@ -1852,10 +1729,10 @@ u.asn1.DERObjectIdentifier = function(r) {
|
|
|
1852
1729
|
return this.hV;
|
|
1853
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));
|
|
1854
1731
|
};
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
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);
|
|
1859
1736
|
}, this.setByInteger = function(t) {
|
|
1860
1737
|
var e = new c(String(t), 10);
|
|
1861
1738
|
this.setByBigInteger(e);
|
|
@@ -1865,45 +1742,45 @@ u.asn1.DEREnumerated = function(r) {
|
|
|
1865
1742
|
return this.hV;
|
|
1866
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));
|
|
1867
1744
|
};
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
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";
|
|
1871
1748
|
};
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
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";
|
|
1875
1752
|
};
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
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";
|
|
1879
1756
|
};
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
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";
|
|
1883
1760
|
};
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
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";
|
|
1887
1764
|
};
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
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) {
|
|
1891
1768
|
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
|
|
1892
1769
|
}, this.getFreshValueHex = function() {
|
|
1893
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;
|
|
1894
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));
|
|
1895
1772
|
};
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
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) {
|
|
1899
1776
|
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
|
|
1900
1777
|
}, this.getFreshValueHex = function() {
|
|
1901
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;
|
|
1902
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));
|
|
1903
1780
|
};
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
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() {
|
|
1907
1784
|
for (var t = "", e = 0; e < this.asn1Array.length; e++) {
|
|
1908
1785
|
var i = this.asn1Array[e];
|
|
1909
1786
|
t += i.getEncodedHex();
|
|
@@ -1911,9 +1788,9 @@ u.asn1.DERSequence = function(r) {
|
|
|
1911
1788
|
return this.hV = t, this.hV;
|
|
1912
1789
|
};
|
|
1913
1790
|
};
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
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() {
|
|
1917
1794
|
for (var t = new Array(), e = 0; e < this.asn1Array.length; e++) {
|
|
1918
1795
|
var i = this.asn1Array[e];
|
|
1919
1796
|
t.push(i.getEncodedHex());
|
|
@@ -1921,16 +1798,16 @@ u.asn1.DERSet = function(r) {
|
|
|
1921
1798
|
return this.sortFlag == !0 && t.sort(), this.hV = t.join(""), this.hV;
|
|
1922
1799
|
}, typeof r < "u" && typeof r.sortflag < "u" && r.sortflag == !1 && (this.sortFlag = !1);
|
|
1923
1800
|
};
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
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) {
|
|
1927
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);
|
|
1928
1805
|
}, this.getFreshValueHex = function() {
|
|
1929
1806
|
return this.hV;
|
|
1930
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)));
|
|
1931
1808
|
};
|
|
1932
|
-
|
|
1933
|
-
var
|
|
1809
|
+
m.lang.extend(a.asn1.DERTaggedObject, a.asn1.ASN1Object);
|
|
1810
|
+
var zt = /* @__PURE__ */ function() {
|
|
1934
1811
|
var r = function(t, e) {
|
|
1935
1812
|
return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, n) {
|
|
1936
1813
|
i.__proto__ = n;
|
|
@@ -1947,37 +1824,37 @@ var oe = /* @__PURE__ */ function() {
|
|
|
1947
1824
|
}
|
|
1948
1825
|
t.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i());
|
|
1949
1826
|
};
|
|
1950
|
-
}(),
|
|
1827
|
+
}(), Tt = (
|
|
1951
1828
|
/** @class */
|
|
1952
1829
|
function(r) {
|
|
1953
|
-
|
|
1830
|
+
zt(t, r);
|
|
1954
1831
|
function t(e) {
|
|
1955
1832
|
var i = r.call(this) || this;
|
|
1956
1833
|
return e && (typeof e == "string" ? i.parseKey(e) : (t.hasPrivateKeyProperty(e) || t.hasPublicKeyProperty(e)) && i.parsePropertiesFrom(e)), i;
|
|
1957
1834
|
}
|
|
1958
1835
|
return t.prototype.parseKey = function(e) {
|
|
1959
1836
|
try {
|
|
1960
|
-
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);
|
|
1961
1838
|
if (o.sub.length === 3 && (o = o.sub[2].sub[0]), o.sub.length === 9) {
|
|
1962
|
-
i = o.sub[1].getHexStringValue(), this.n =
|
|
1963
|
-
var
|
|
1964
|
-
this.d =
|
|
1965
|
-
var
|
|
1966
|
-
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);
|
|
1967
1844
|
var l = o.sub[5].getHexStringValue();
|
|
1968
|
-
this.q =
|
|
1969
|
-
var
|
|
1970
|
-
this.dmp1 =
|
|
1845
|
+
this.q = S(l, 16);
|
|
1846
|
+
var g = o.sub[6].getHexStringValue();
|
|
1847
|
+
this.dmp1 = S(g, 16);
|
|
1971
1848
|
var d = o.sub[7].getHexStringValue();
|
|
1972
|
-
this.dmq1 =
|
|
1849
|
+
this.dmq1 = S(d, 16);
|
|
1973
1850
|
var y = o.sub[8].getHexStringValue();
|
|
1974
|
-
this.coeff =
|
|
1851
|
+
this.coeff = S(y, 16);
|
|
1975
1852
|
} else if (o.sub.length === 2)
|
|
1976
1853
|
if (o.sub[0].sub) {
|
|
1977
|
-
var
|
|
1978
|
-
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);
|
|
1979
1856
|
} else
|
|
1980
|
-
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);
|
|
1981
1858
|
else
|
|
1982
1859
|
return !1;
|
|
1983
1860
|
return !0;
|
|
@@ -1987,34 +1864,34 @@ var oe = /* @__PURE__ */ function() {
|
|
|
1987
1864
|
}, t.prototype.getPrivateBaseKey = function() {
|
|
1988
1865
|
var e = {
|
|
1989
1866
|
array: [
|
|
1990
|
-
new
|
|
1991
|
-
new
|
|
1992
|
-
new
|
|
1993
|
-
new
|
|
1994
|
-
new
|
|
1995
|
-
new
|
|
1996
|
-
new
|
|
1997
|
-
new
|
|
1998
|
-
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 })
|
|
1999
1876
|
]
|
|
2000
|
-
}, i = new
|
|
1877
|
+
}, i = new a.asn1.DERSequence(e);
|
|
2001
1878
|
return i.getEncodedHex();
|
|
2002
1879
|
}, t.prototype.getPrivateBaseKeyB64 = function() {
|
|
2003
1880
|
return W(this.getPrivateBaseKey());
|
|
2004
1881
|
}, t.prototype.getPublicBaseKey = function() {
|
|
2005
|
-
var e = new
|
|
1882
|
+
var e = new a.asn1.DERSequence({
|
|
2006
1883
|
array: [
|
|
2007
|
-
new
|
|
2008
|
-
new
|
|
1884
|
+
new a.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }),
|
|
1885
|
+
new a.asn1.DERNull()
|
|
2009
1886
|
]
|
|
2010
|
-
}), i = new
|
|
1887
|
+
}), i = new a.asn1.DERSequence({
|
|
2011
1888
|
array: [
|
|
2012
|
-
new
|
|
2013
|
-
new
|
|
1889
|
+
new a.asn1.DERInteger({ bigint: this.n }),
|
|
1890
|
+
new a.asn1.DERInteger({ int: this.e })
|
|
2014
1891
|
]
|
|
2015
|
-
}), n = new
|
|
1892
|
+
}), n = new a.asn1.DERBitString({
|
|
2016
1893
|
hex: "00" + i.getEncodedHex()
|
|
2017
|
-
}), s = new
|
|
1894
|
+
}), s = new a.asn1.DERSequence({
|
|
2018
1895
|
array: [e, n]
|
|
2019
1896
|
});
|
|
2020
1897
|
return s.getEncodedHex();
|
|
@@ -2044,15 +1921,15 @@ var oe = /* @__PURE__ */ function() {
|
|
|
2044
1921
|
}, t.prototype.parsePropertiesFrom = function(e) {
|
|
2045
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);
|
|
2046
1923
|
}, t;
|
|
2047
|
-
}(
|
|
2048
|
-
), 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 = (
|
|
2049
1926
|
/** @class */
|
|
2050
1927
|
function() {
|
|
2051
1928
|
function r(t) {
|
|
2052
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;
|
|
2053
1930
|
}
|
|
2054
1931
|
return r.prototype.setKey = function(t) {
|
|
2055
|
-
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);
|
|
2056
1933
|
}, r.prototype.setPrivateKey = function(t) {
|
|
2057
1934
|
this.setKey(t);
|
|
2058
1935
|
}, r.prototype.setPublicKey = function(t) {
|
|
@@ -2083,7 +1960,7 @@ var oe = /* @__PURE__ */ function() {
|
|
|
2083
1960
|
}
|
|
2084
1961
|
}, r.prototype.getKey = function(t) {
|
|
2085
1962
|
if (!this.key) {
|
|
2086
|
-
if (this.key = new
|
|
1963
|
+
if (this.key = new Tt(), t && {}.toString.call(t) === "[object Function]") {
|
|
2087
1964
|
this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
|
|
2088
1965
|
return;
|
|
2089
1966
|
}
|
|
@@ -2098,34 +1975,30 @@ var oe = /* @__PURE__ */ function() {
|
|
|
2098
1975
|
return this.getKey().getPublicKey();
|
|
2099
1976
|
}, r.prototype.getPublicKeyB64 = function() {
|
|
2100
1977
|
return this.getKey().getPublicBaseKeyB64();
|
|
2101
|
-
}, r.version =
|
|
1978
|
+
}, r.version = Zt, r;
|
|
2102
1979
|
}()
|
|
2103
1980
|
);
|
|
2104
|
-
function
|
|
1981
|
+
function Gt() {
|
|
2105
1982
|
const r = new et({ default_key_size: "2048" });
|
|
2106
1983
|
return {
|
|
2107
1984
|
publicKey: r.getPublicKey(),
|
|
2108
1985
|
privateKey: r.getPrivateKey()
|
|
2109
1986
|
};
|
|
2110
1987
|
}
|
|
2111
|
-
function
|
|
1988
|
+
function $t(r, t) {
|
|
2112
1989
|
const e = new et();
|
|
2113
1990
|
return e.setPublicKey(t), e.encrypt(r) || "";
|
|
2114
1991
|
}
|
|
2115
|
-
function
|
|
1992
|
+
function Jt(r, t) {
|
|
2116
1993
|
const e = new et();
|
|
2117
1994
|
return e.setPrivateKey(t), e.decrypt(r) || "";
|
|
2118
1995
|
}
|
|
2119
|
-
function
|
|
1996
|
+
function Yt() {
|
|
2120
1997
|
return typeof new et().encrypt == "function";
|
|
2121
1998
|
}
|
|
2122
1999
|
export {
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
Tt as f,
|
|
2128
|
-
ce as g,
|
|
2129
|
-
de as i,
|
|
2130
|
-
le as u
|
|
2000
|
+
Jt as d,
|
|
2001
|
+
$t as e,
|
|
2002
|
+
Gt as g,
|
|
2003
|
+
Yt as i
|
|
2131
2004
|
};
|