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