@solar-taro/ui-sun 1.6.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/accordion/index.vue.d.ts +22 -16
- package/chip/index.vue.d.ts +15 -36
- package/circular-progress/index.vue.d.ts +4 -30
- package/fab/fab-group.vue.d.ts +9 -3
- package/fab/fab.vue.d.ts +9 -3
- package/fab/index.scss +11 -3
- package/icon/index.scss +4 -3
- package/icon/index.vue.d.ts +3 -22
- package/index.d.ts +2 -0
- package/index.js +24 -20
- package/index10.js +24 -33
- package/index11.js +33 -75
- package/index12.js +75 -19
- package/index13.js +19 -49
- package/index14.js +46 -141
- package/index15.js +142 -27
- package/index16.js +29 -21
- package/index17.js +18 -21
- package/index18.js +42 -11
- package/index19.js +21 -26
- package/index20.js +11 -118
- package/index21.js +33 -10
- package/index22.js +123 -10
- package/index23.js +12 -8
- package/index24.js +10 -2
- package/index25.js +10 -2
- package/index26.js +1 -1
- package/index27.js +1 -1
- package/index28.js +1 -1
- package/index29.js +7 -2
- package/index30.js +2 -7
- package/index31.js +1 -1
- package/index33.js +1 -1
- package/index34.js +1 -1
- package/index35.js +1 -1
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/index38.js +1 -1
- package/index39.js +1 -1
- package/index40.js +1 -1
- package/index41.js +1 -1
- package/index42.js +1 -1
- package/index43.js +2 -526
- package/index44.js +2 -3
- package/index45.js +2 -66
- package/index46.js +2 -12
- package/index47.js +3 -25
- package/index48.js +65 -13
- package/index49.js +12 -5
- package/index50.js +25 -26
- package/index51.js +14 -2
- package/index52.js +4 -505
- package/index53.js +524 -77
- package/index54.js +24 -68
- package/index55.js +2 -69
- package/index56.js +331 -368
- package/index57.js +79 -2
- package/index58.js +70 -2
- package/index59.js +69 -2
- package/index60.js +542 -3
- package/index62.js +2 -4
- package/index63.js +2 -2
- package/index64.js +4 -2
- package/index66.js +4 -48
- package/index67.js +2 -82
- package/index69.js +2 -2
- package/index7.js +7 -9
- package/index70.js +2 -2
- package/index71.js +48 -2
- package/index72.js +84 -0
- package/index73.js +4 -0
- package/index74.js +4 -0
- package/index75.js +4 -0
- package/index8.js +29 -17
- package/index9.js +19 -25
- package/item/index.d.ts +1 -0
- package/item/index.scss +40 -0
- package/item/index.vue.d.ts +26 -0
- package/lazy-render/index.vue.d.ts +13 -29
- package/list-header/index.scss +1 -1
- package/list-header/index.vue.d.ts +9 -3
- package/navbar/index.vue.d.ts +10 -4
- package/package.json +2 -2
- package/plugin.d.ts +0 -1
- package/popover/index.vue.d.ts +24 -41
- package/qrcode/index.vue.d.ts +6 -31
- package/segment/injection.d.ts +0 -1
- package/segment/segment-btn.vue.d.ts +12 -16
- package/segment/segment.vue.d.ts +16 -20
- package/slider-captcha/index.vue.d.ts +7 -36
- package/spinner/index.scss +1 -0
- package/spinner/index.vue.d.ts +14 -33
- package/sudoku/sudoku-item.vue.d.ts +9 -3
- package/sudoku/sudoku.vue.d.ts +9 -3
- package/tabbar/index.d.ts +1 -0
- package/tabbar/index.scss +74 -0
- package/tabbar/index.vue.d.ts +38 -0
- package/table/_table.scss +1 -1
- package/table/table-cell.vue.d.ts +13 -24
- package/table/table-row.vue.d.ts +12 -17
- package/table/table.vue.d.ts +17 -43
- package/virtual-scroll/index.vue.d.ts +35 -74
package/index56.js
CHANGED
|
@@ -1,545 +1,508 @@
|
|
|
1
|
-
import { commonjsGlobal as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
return
|
|
8
|
-
(function(
|
|
9
|
-
|
|
10
|
-
})(
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { commonjsGlobal as p } from "./index54.js";
|
|
2
|
+
import { commonjsRequire as W } from "./index64.js";
|
|
3
|
+
import { __module as w } from "./index65.js";
|
|
4
|
+
import q from "./index66.js";
|
|
5
|
+
var S;
|
|
6
|
+
function T() {
|
|
7
|
+
return S ? w.exports : (S = 1, function(C, L) {
|
|
8
|
+
(function(y, f) {
|
|
9
|
+
C.exports = f();
|
|
10
|
+
})(p, function() {
|
|
11
|
+
var y = y || function(f, b) {
|
|
12
|
+
var s;
|
|
13
|
+
if (typeof window != "undefined" && window.crypto && (s = window.crypto), typeof self != "undefined" && self.crypto && (s = self.crypto), typeof globalThis != "undefined" && globalThis.crypto && (s = globalThis.crypto), !s && typeof window != "undefined" && window.msCrypto && (s = window.msCrypto), !s && typeof p != "undefined" && p.crypto && (s = p.crypto), !s && typeof W == "function")
|
|
14
|
+
try {
|
|
15
|
+
s = q;
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
var R = function() {
|
|
19
|
+
if (s) {
|
|
20
|
+
if (typeof s.getRandomValues == "function")
|
|
21
|
+
try {
|
|
22
|
+
return s.getRandomValues(new Uint32Array(1))[0];
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
if (typeof s.randomBytes == "function")
|
|
26
|
+
try {
|
|
27
|
+
return s.randomBytes(4).readInt32LE();
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
32
|
+
}, z = Object.create || /* @__PURE__ */ function() {
|
|
33
|
+
function t() {
|
|
34
|
+
}
|
|
35
|
+
return function(r) {
|
|
36
|
+
var n;
|
|
37
|
+
return t.prototype = r, n = new t(), t.prototype = null, n;
|
|
38
|
+
};
|
|
39
|
+
}(), h = {}, d = h.lib = {}, c = d.Base = /* @__PURE__ */ function() {
|
|
40
|
+
return {
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new object that inherits from this object.
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} overrides Properties to copy into the new object.
|
|
45
|
+
*
|
|
46
|
+
* @return {Object} The new object.
|
|
47
|
+
*
|
|
48
|
+
* @static
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
*
|
|
52
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
53
|
+
* field: 'value',
|
|
54
|
+
*
|
|
55
|
+
* method: function () {
|
|
56
|
+
* }
|
|
57
|
+
* });
|
|
58
|
+
*/
|
|
59
|
+
extend: function(t) {
|
|
60
|
+
var r = z(this);
|
|
61
|
+
return t && r.mixIn(t), (!r.hasOwnProperty("init") || this.init === r.init) && (r.init = function() {
|
|
62
|
+
r.$super.init.apply(this, arguments);
|
|
63
|
+
}), r.init.prototype = r, r.$super = this, r;
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Extends this object and runs the init method.
|
|
67
|
+
* Arguments to create() will be passed to init().
|
|
68
|
+
*
|
|
69
|
+
* @return {Object} The new object.
|
|
70
|
+
*
|
|
71
|
+
* @static
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
*
|
|
75
|
+
* var instance = MyType.create();
|
|
76
|
+
*/
|
|
77
|
+
create: function() {
|
|
78
|
+
var t = this.extend();
|
|
79
|
+
return t.init.apply(t, arguments), t;
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Initializes a newly created object.
|
|
83
|
+
* Override this method to add some logic when your objects are created.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
*
|
|
87
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
88
|
+
* init: function () {
|
|
89
|
+
* // ...
|
|
90
|
+
* }
|
|
91
|
+
* });
|
|
92
|
+
*/
|
|
93
|
+
init: function() {
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Copies properties into this object.
|
|
97
|
+
*
|
|
98
|
+
* @param {Object} properties The properties to mix in.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
*
|
|
102
|
+
* MyType.mixIn({
|
|
103
|
+
* field: 'value'
|
|
104
|
+
* });
|
|
105
|
+
*/
|
|
106
|
+
mixIn: function(t) {
|
|
107
|
+
for (var r in t)
|
|
108
|
+
t.hasOwnProperty(r) && (this[r] = t[r]);
|
|
109
|
+
t.hasOwnProperty("toString") && (this.toString = t.toString);
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Creates a copy of this object.
|
|
113
|
+
*
|
|
114
|
+
* @return {Object} The clone.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
*
|
|
118
|
+
* var clone = instance.clone();
|
|
119
|
+
*/
|
|
120
|
+
clone: function() {
|
|
121
|
+
return this.init.prototype.extend(this);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}(), u = d.WordArray = c.extend({
|
|
21
125
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param {WordArray} key The key.
|
|
25
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
126
|
+
* Initializes a newly created word array.
|
|
26
127
|
*
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
29
|
-
* @static
|
|
128
|
+
* @param {Array} words (Optional) An array of 32-bit words.
|
|
129
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
30
130
|
*
|
|
31
131
|
* @example
|
|
32
132
|
*
|
|
33
|
-
* var
|
|
133
|
+
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
134
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
135
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
34
136
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
137
|
+
init: function(t, r) {
|
|
138
|
+
t = this.words = t || [], r != b ? this.sigBytes = r : this.sigBytes = t.length * 4;
|
|
37
139
|
},
|
|
38
140
|
/**
|
|
39
|
-
*
|
|
141
|
+
* Converts this word array to a string.
|
|
40
142
|
*
|
|
41
|
-
* @param {
|
|
42
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
143
|
+
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
43
144
|
*
|
|
44
|
-
* @return {
|
|
45
|
-
*
|
|
46
|
-
* @static
|
|
145
|
+
* @return {string} The stringified word array.
|
|
47
146
|
*
|
|
48
147
|
* @example
|
|
49
148
|
*
|
|
50
|
-
* var
|
|
149
|
+
* var string = wordArray + '';
|
|
150
|
+
* var string = wordArray.toString();
|
|
151
|
+
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
51
152
|
*/
|
|
52
|
-
|
|
53
|
-
return
|
|
153
|
+
toString: function(t) {
|
|
154
|
+
return (t || k).stringify(this);
|
|
54
155
|
},
|
|
55
156
|
/**
|
|
56
|
-
*
|
|
157
|
+
* Concatenates a word array to this word array.
|
|
57
158
|
*
|
|
58
|
-
* @param {
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
159
|
+
* @param {WordArray} wordArray The word array to append.
|
|
160
|
+
*
|
|
161
|
+
* @return {WordArray} This word array.
|
|
61
162
|
*
|
|
62
163
|
* @example
|
|
63
164
|
*
|
|
64
|
-
*
|
|
165
|
+
* wordArray1.concat(wordArray2);
|
|
65
166
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
167
|
+
concat: function(t) {
|
|
168
|
+
var r = this.words, n = t.words, e = this.sigBytes, i = t.sigBytes;
|
|
169
|
+
if (this.clamp(), e % 4)
|
|
170
|
+
for (var o = 0; o < i; o++) {
|
|
171
|
+
var g = n[o >>> 2] >>> 24 - o % 4 * 8 & 255;
|
|
172
|
+
r[e + o >>> 2] |= g << 24 - (e + o) % 4 * 8;
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
for (var a = 0; a < i; a += 4)
|
|
176
|
+
r[e + a >>> 2] = n[a >>> 2];
|
|
177
|
+
return this.sigBytes += i, this;
|
|
68
178
|
},
|
|
69
179
|
/**
|
|
70
|
-
*
|
|
180
|
+
* Removes insignificant bits.
|
|
71
181
|
*
|
|
72
182
|
* @example
|
|
73
183
|
*
|
|
74
|
-
*
|
|
184
|
+
* wordArray.clamp();
|
|
75
185
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
186
|
+
clamp: function() {
|
|
187
|
+
var t = this.words, r = this.sigBytes;
|
|
188
|
+
t[r >>> 2] &= 4294967295 << 32 - r % 4 * 8, t.length = f.ceil(r / 4);
|
|
78
189
|
},
|
|
79
190
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
|
|
191
|
+
* Creates a copy of this word array.
|
|
83
192
|
*
|
|
84
|
-
* @return {WordArray} The
|
|
193
|
+
* @return {WordArray} The clone.
|
|
85
194
|
*
|
|
86
195
|
* @example
|
|
87
196
|
*
|
|
88
|
-
* var
|
|
89
|
-
* var encrypted = cipher.process(wordArray);
|
|
197
|
+
* var clone = wordArray.clone();
|
|
90
198
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
199
|
+
clone: function() {
|
|
200
|
+
var t = c.clone.call(this);
|
|
201
|
+
return t.words = this.words.slice(0), t;
|
|
93
202
|
},
|
|
94
203
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
204
|
+
* Creates a word array filled with random bytes.
|
|
205
|
+
*
|
|
206
|
+
* @param {number} nBytes The number of random bytes to generate.
|
|
97
207
|
*
|
|
98
|
-
* @
|
|
208
|
+
* @return {WordArray} The random word array.
|
|
99
209
|
*
|
|
100
|
-
* @
|
|
210
|
+
* @static
|
|
101
211
|
*
|
|
102
212
|
* @example
|
|
103
213
|
*
|
|
104
|
-
* var
|
|
105
|
-
* var encrypted = cipher.finalize('data');
|
|
106
|
-
* var encrypted = cipher.finalize(wordArray);
|
|
214
|
+
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
107
215
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return t;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
ivSize: 128 / 32,
|
|
115
|
-
_ENC_XFORM_MODE: 1,
|
|
116
|
-
_DEC_XFORM_MODE: 2,
|
|
216
|
+
random: function(t) {
|
|
217
|
+
for (var r = [], n = 0; n < t; n += 4)
|
|
218
|
+
r.push(R());
|
|
219
|
+
return new u.init(r, t);
|
|
220
|
+
}
|
|
221
|
+
}), v = h.enc = {}, k = v.Hex = {
|
|
117
222
|
/**
|
|
118
|
-
*
|
|
223
|
+
* Converts a word array to a hex string.
|
|
119
224
|
*
|
|
120
|
-
* @param {
|
|
225
|
+
* @param {WordArray} wordArray The word array.
|
|
121
226
|
*
|
|
122
|
-
* @return {
|
|
227
|
+
* @return {string} The hex string.
|
|
123
228
|
*
|
|
124
229
|
* @static
|
|
125
230
|
*
|
|
126
231
|
* @example
|
|
127
232
|
*
|
|
128
|
-
* var
|
|
233
|
+
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
129
234
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
235
|
+
stringify: function(t) {
|
|
236
|
+
for (var r = t.words, n = t.sigBytes, e = [], i = 0; i < n; i++) {
|
|
237
|
+
var o = r[i >>> 2] >>> 24 - i % 4 * 8 & 255;
|
|
238
|
+
e.push((o >>> 4).toString(16)), e.push((o & 15).toString(16));
|
|
133
239
|
}
|
|
134
|
-
return
|
|
135
|
-
return {
|
|
136
|
-
encrypt: function(i, r, n) {
|
|
137
|
-
return e(r).encrypt(t, i, r, n);
|
|
138
|
-
},
|
|
139
|
-
decrypt: function(i, r, n) {
|
|
140
|
-
return e(r).decrypt(t, i, r, n);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
}()
|
|
145
|
-
});
|
|
146
|
-
s.StreamCipher = f.extend({
|
|
147
|
-
_doFinalize: function() {
|
|
148
|
-
var e = this._process(!0);
|
|
149
|
-
return e;
|
|
240
|
+
return e.join("");
|
|
150
241
|
},
|
|
151
|
-
blockSize: 1
|
|
152
|
-
});
|
|
153
|
-
var z = c.mode = {}, E = s.BlockCipherMode = p.extend({
|
|
154
242
|
/**
|
|
155
|
-
*
|
|
243
|
+
* Converts a hex string to a word array.
|
|
156
244
|
*
|
|
157
|
-
* @param {
|
|
158
|
-
*
|
|
245
|
+
* @param {string} hexStr The hex string.
|
|
246
|
+
*
|
|
247
|
+
* @return {WordArray} The word array.
|
|
159
248
|
*
|
|
160
249
|
* @static
|
|
161
250
|
*
|
|
162
251
|
* @example
|
|
163
252
|
*
|
|
164
|
-
* var
|
|
253
|
+
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
165
254
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
255
|
+
parse: function(t) {
|
|
256
|
+
for (var r = t.length, n = [], e = 0; e < r; e += 2)
|
|
257
|
+
n[e >>> 3] |= parseInt(t.substr(e, 2), 16) << 24 - e % 8 * 4;
|
|
258
|
+
return new u.init(n, r / 2);
|
|
259
|
+
}
|
|
260
|
+
}, B = v.Latin1 = {
|
|
169
261
|
/**
|
|
170
|
-
*
|
|
262
|
+
* Converts a word array to a Latin1 string.
|
|
263
|
+
*
|
|
264
|
+
* @param {WordArray} wordArray The word array.
|
|
171
265
|
*
|
|
172
|
-
* @
|
|
173
|
-
* @param {Array} iv The IV words.
|
|
266
|
+
* @return {string} The Latin1 string.
|
|
174
267
|
*
|
|
175
268
|
* @static
|
|
176
269
|
*
|
|
177
270
|
* @example
|
|
178
271
|
*
|
|
179
|
-
* var
|
|
272
|
+
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
180
273
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
274
|
+
stringify: function(t) {
|
|
275
|
+
for (var r = t.words, n = t.sigBytes, e = [], i = 0; i < n; i++) {
|
|
276
|
+
var o = r[i >>> 2] >>> 24 - i % 4 * 8 & 255;
|
|
277
|
+
e.push(String.fromCharCode(o));
|
|
278
|
+
}
|
|
279
|
+
return e.join("");
|
|
183
280
|
},
|
|
184
281
|
/**
|
|
185
|
-
*
|
|
282
|
+
* Converts a Latin1 string to a word array.
|
|
283
|
+
*
|
|
284
|
+
* @param {string} latin1Str The Latin1 string.
|
|
186
285
|
*
|
|
187
|
-
* @
|
|
188
|
-
*
|
|
286
|
+
* @return {WordArray} The word array.
|
|
287
|
+
*
|
|
288
|
+
* @static
|
|
189
289
|
*
|
|
190
290
|
* @example
|
|
191
291
|
*
|
|
192
|
-
* var
|
|
292
|
+
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
193
293
|
*/
|
|
194
|
-
|
|
195
|
-
|
|
294
|
+
parse: function(t) {
|
|
295
|
+
for (var r = t.length, n = [], e = 0; e < r; e++)
|
|
296
|
+
n[e >>> 2] |= (t.charCodeAt(e) & 255) << 24 - e % 4 * 8;
|
|
297
|
+
return new u.init(n, r);
|
|
196
298
|
}
|
|
197
|
-
}
|
|
198
|
-
var e = E.extend();
|
|
199
|
-
e.Encryptor = e.extend({
|
|
200
|
-
/**
|
|
201
|
-
* Processes the data block at offset.
|
|
202
|
-
*
|
|
203
|
-
* @param {Array} words The data words to operate on.
|
|
204
|
-
* @param {number} offset The offset where the block starts.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
*
|
|
208
|
-
* mode.processBlock(data.words, offset);
|
|
209
|
-
*/
|
|
210
|
-
processBlock: function(i, r) {
|
|
211
|
-
var n = this._cipher, a = n.blockSize;
|
|
212
|
-
t.call(this, i, r, a), n.encryptBlock(i, r), this._prevBlock = i.slice(r, r + a);
|
|
213
|
-
}
|
|
214
|
-
}), e.Decryptor = e.extend({
|
|
215
|
-
/**
|
|
216
|
-
* Processes the data block at offset.
|
|
217
|
-
*
|
|
218
|
-
* @param {Array} words The data words to operate on.
|
|
219
|
-
* @param {number} offset The offset where the block starts.
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
*
|
|
223
|
-
* mode.processBlock(data.words, offset);
|
|
224
|
-
*/
|
|
225
|
-
processBlock: function(i, r) {
|
|
226
|
-
var n = this._cipher, a = n.blockSize, o = i.slice(r, r + a);
|
|
227
|
-
n.decryptBlock(i, r), t.call(this, i, r, a), this._prevBlock = o;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
function t(i, r, n) {
|
|
231
|
-
var a, o = this._iv;
|
|
232
|
-
o ? (a = o, this._iv = v) : a = this._prevBlock;
|
|
233
|
-
for (var d = 0; d < n; d++)
|
|
234
|
-
i[r + d] ^= a[d];
|
|
235
|
-
}
|
|
236
|
-
return e;
|
|
237
|
-
}(), D = c.pad = {}, M = D.Pkcs7 = {
|
|
299
|
+
}, H = v.Utf8 = {
|
|
238
300
|
/**
|
|
239
|
-
*
|
|
301
|
+
* Converts a word array to a UTF-8 string.
|
|
240
302
|
*
|
|
241
|
-
* @param {WordArray}
|
|
242
|
-
*
|
|
303
|
+
* @param {WordArray} wordArray The word array.
|
|
304
|
+
*
|
|
305
|
+
* @return {string} The UTF-8 string.
|
|
243
306
|
*
|
|
244
307
|
* @static
|
|
245
308
|
*
|
|
246
309
|
* @example
|
|
247
310
|
*
|
|
248
|
-
* CryptoJS.
|
|
311
|
+
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
249
312
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
313
|
+
stringify: function(t) {
|
|
314
|
+
try {
|
|
315
|
+
return decodeURIComponent(escape(B.stringify(t)));
|
|
316
|
+
} catch {
|
|
317
|
+
throw new Error("Malformed UTF-8 data");
|
|
318
|
+
}
|
|
255
319
|
},
|
|
256
320
|
/**
|
|
257
|
-
*
|
|
321
|
+
* Converts a UTF-8 string to a word array.
|
|
258
322
|
*
|
|
259
|
-
* @param {
|
|
323
|
+
* @param {string} utf8Str The UTF-8 string.
|
|
324
|
+
*
|
|
325
|
+
* @return {WordArray} The word array.
|
|
260
326
|
*
|
|
261
327
|
* @static
|
|
262
328
|
*
|
|
263
329
|
* @example
|
|
264
330
|
*
|
|
265
|
-
* CryptoJS.
|
|
331
|
+
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
266
332
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
e.sigBytes -= t;
|
|
333
|
+
parse: function(t) {
|
|
334
|
+
return B.parse(unescape(encodeURIComponent(t)));
|
|
270
335
|
}
|
|
271
|
-
}
|
|
272
|
-
s.BlockCipher = f.extend({
|
|
273
|
-
/**
|
|
274
|
-
* Configuration options.
|
|
275
|
-
*
|
|
276
|
-
* @property {Mode} mode The block mode to use. Default: CBC
|
|
277
|
-
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
|
|
278
|
-
*/
|
|
279
|
-
cfg: f.cfg.extend({
|
|
280
|
-
mode: b,
|
|
281
|
-
padding: M
|
|
282
|
-
}),
|
|
283
|
-
reset: function() {
|
|
284
|
-
var e;
|
|
285
|
-
f.reset.call(this);
|
|
286
|
-
var t = this.cfg, i = t.iv, r = t.mode;
|
|
287
|
-
this._xformMode == this._ENC_XFORM_MODE ? e = r.createEncryptor : (e = r.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, i && i.words) : (this._mode = e.call(r, this, i && i.words), this._mode.__creator = e);
|
|
288
|
-
},
|
|
289
|
-
_doProcessBlock: function(e, t) {
|
|
290
|
-
this._mode.processBlock(e, t);
|
|
291
|
-
},
|
|
292
|
-
_doFinalize: function() {
|
|
293
|
-
var e, t = this.cfg.padding;
|
|
294
|
-
return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e;
|
|
295
|
-
},
|
|
296
|
-
blockSize: 128 / 32
|
|
297
|
-
});
|
|
298
|
-
var _ = s.CipherParams = p.extend({
|
|
336
|
+
}, _ = d.BufferedBlockAlgorithm = c.extend({
|
|
299
337
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* @param {Object} cipherParams An object with any of the possible cipher parameters.
|
|
338
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
303
339
|
*
|
|
304
340
|
* @example
|
|
305
341
|
*
|
|
306
|
-
*
|
|
307
|
-
* ciphertext: ciphertextWordArray,
|
|
308
|
-
* key: keyWordArray,
|
|
309
|
-
* iv: ivWordArray,
|
|
310
|
-
* salt: saltWordArray,
|
|
311
|
-
* algorithm: CryptoJS.algo.AES,
|
|
312
|
-
* mode: CryptoJS.mode.CBC,
|
|
313
|
-
* padding: CryptoJS.pad.PKCS7,
|
|
314
|
-
* blockSize: 4,
|
|
315
|
-
* formatter: CryptoJS.format.OpenSSL
|
|
316
|
-
* });
|
|
342
|
+
* bufferedBlockAlgorithm.reset();
|
|
317
343
|
*/
|
|
318
|
-
|
|
319
|
-
this.
|
|
344
|
+
reset: function() {
|
|
345
|
+
this._data = new u.init(), this._nDataBytes = 0;
|
|
320
346
|
},
|
|
321
347
|
/**
|
|
322
|
-
*
|
|
348
|
+
* Adds new data to this block algorithm's buffer.
|
|
323
349
|
*
|
|
324
|
-
* @param {
|
|
325
|
-
*
|
|
326
|
-
* @return {string} The stringified cipher params.
|
|
327
|
-
*
|
|
328
|
-
* @throws Error If neither the formatter nor the default formatter is set.
|
|
350
|
+
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
329
351
|
*
|
|
330
352
|
* @example
|
|
331
353
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
|
354
|
+
* bufferedBlockAlgorithm._append('data');
|
|
355
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
335
356
|
*/
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
}), O = c.format = {}, P = O.OpenSSL = {
|
|
357
|
+
_append: function(t) {
|
|
358
|
+
typeof t == "string" && (t = H.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;
|
|
359
|
+
},
|
|
340
360
|
/**
|
|
341
|
-
*
|
|
361
|
+
* Processes available data blocks.
|
|
342
362
|
*
|
|
343
|
-
*
|
|
363
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
344
364
|
*
|
|
345
|
-
* @
|
|
365
|
+
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
346
366
|
*
|
|
347
|
-
* @
|
|
367
|
+
* @return {WordArray} The processed data.
|
|
348
368
|
*
|
|
349
369
|
* @example
|
|
350
370
|
*
|
|
351
|
-
* var
|
|
371
|
+
* var processedData = bufferedBlockAlgorithm._process();
|
|
372
|
+
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
352
373
|
*/
|
|
353
|
-
|
|
354
|
-
var
|
|
355
|
-
|
|
374
|
+
_process: function(t) {
|
|
375
|
+
var r, n = this._data, e = n.words, i = n.sigBytes, o = this.blockSize, g = o * 4, a = i / g;
|
|
376
|
+
t ? a = f.ceil(a) : a = f.max((a | 0) - this._minBufferSize, 0);
|
|
377
|
+
var l = a * o, x = f.min(l * 4, i);
|
|
378
|
+
if (l) {
|
|
379
|
+
for (var m = 0; m < l; m += o)
|
|
380
|
+
this._doProcessBlock(e, m);
|
|
381
|
+
r = e.splice(0, l), n.sigBytes -= x;
|
|
382
|
+
}
|
|
383
|
+
return new u.init(r, x);
|
|
356
384
|
},
|
|
357
385
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* @param {string} openSSLStr The OpenSSL-compatible string.
|
|
386
|
+
* Creates a copy of this object.
|
|
361
387
|
*
|
|
362
|
-
* @return {
|
|
363
|
-
*
|
|
364
|
-
* @static
|
|
388
|
+
* @return {Object} The clone.
|
|
365
389
|
*
|
|
366
390
|
* @example
|
|
367
391
|
*
|
|
368
|
-
* var
|
|
392
|
+
* var clone = bufferedBlockAlgorithm.clone();
|
|
369
393
|
*/
|
|
370
|
-
|
|
371
|
-
var t
|
|
372
|
-
return
|
|
373
|
-
}
|
|
374
|
-
|
|
394
|
+
clone: function() {
|
|
395
|
+
var t = c.clone.call(this);
|
|
396
|
+
return t._data = this._data.clone(), t;
|
|
397
|
+
},
|
|
398
|
+
_minBufferSize: 0
|
|
399
|
+
});
|
|
400
|
+
d.Hasher = _.extend({
|
|
375
401
|
/**
|
|
376
402
|
* Configuration options.
|
|
377
|
-
*
|
|
378
|
-
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
|
|
379
403
|
*/
|
|
380
|
-
cfg:
|
|
381
|
-
format: P
|
|
382
|
-
}),
|
|
404
|
+
cfg: c.extend(),
|
|
383
405
|
/**
|
|
384
|
-
*
|
|
406
|
+
* Initializes a newly created hasher.
|
|
385
407
|
*
|
|
386
|
-
* @param {
|
|
387
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
388
|
-
* @param {WordArray} key The key.
|
|
389
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
390
|
-
*
|
|
391
|
-
* @return {CipherParams} A cipher params object.
|
|
392
|
-
*
|
|
393
|
-
* @static
|
|
408
|
+
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
394
409
|
*
|
|
395
410
|
* @example
|
|
396
411
|
*
|
|
397
|
-
* var
|
|
398
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
|
|
399
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
412
|
+
* var hasher = CryptoJS.algo.SHA256.create();
|
|
400
413
|
*/
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
var n = e.createEncryptor(i, r), a = n.finalize(t), o = n.cfg;
|
|
404
|
-
return _.create({
|
|
405
|
-
ciphertext: a,
|
|
406
|
-
key: i,
|
|
407
|
-
iv: o.iv,
|
|
408
|
-
algorithm: e,
|
|
409
|
-
mode: o.mode,
|
|
410
|
-
padding: o.padding,
|
|
411
|
-
blockSize: e.blockSize,
|
|
412
|
-
formatter: r.format
|
|
413
|
-
});
|
|
414
|
+
init: function(t) {
|
|
415
|
+
this.cfg = this.cfg.extend(t), this.reset();
|
|
414
416
|
},
|
|
415
417
|
/**
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
419
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
420
|
-
* @param {WordArray} key The key.
|
|
421
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
422
|
-
*
|
|
423
|
-
* @return {WordArray} The plaintext.
|
|
424
|
-
*
|
|
425
|
-
* @static
|
|
418
|
+
* Resets this hasher to its initial state.
|
|
426
419
|
*
|
|
427
420
|
* @example
|
|
428
421
|
*
|
|
429
|
-
*
|
|
430
|
-
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
422
|
+
* hasher.reset();
|
|
431
423
|
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
var n = e.createDecryptor(i, r).finalize(t.ciphertext);
|
|
435
|
-
return n;
|
|
424
|
+
reset: function() {
|
|
425
|
+
_.reset.call(this), this._doReset();
|
|
436
426
|
},
|
|
437
427
|
/**
|
|
438
|
-
*
|
|
439
|
-
* else assumed CipherParams already and returns ciphertext unchanged.
|
|
428
|
+
* Updates this hasher with a message.
|
|
440
429
|
*
|
|
441
|
-
* @param {
|
|
442
|
-
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
|
|
430
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
443
431
|
*
|
|
444
|
-
* @return {
|
|
445
|
-
*
|
|
446
|
-
* @static
|
|
432
|
+
* @return {Hasher} This hasher.
|
|
447
433
|
*
|
|
448
434
|
* @example
|
|
449
435
|
*
|
|
450
|
-
*
|
|
436
|
+
* hasher.update('message');
|
|
437
|
+
* hasher.update(wordArray);
|
|
451
438
|
*/
|
|
452
|
-
|
|
453
|
-
return
|
|
454
|
-
}
|
|
455
|
-
}), F = c.kdf = {}, R = F.OpenSSL = {
|
|
439
|
+
update: function(t) {
|
|
440
|
+
return this._append(t), this._process(), this;
|
|
441
|
+
},
|
|
456
442
|
/**
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
* @param {string} password The password to derive from.
|
|
460
|
-
* @param {number} keySize The size in words of the key to generate.
|
|
461
|
-
* @param {number} ivSize The size in words of the IV to generate.
|
|
462
|
-
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
|
|
443
|
+
* Finalizes the hash computation.
|
|
444
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
463
445
|
*
|
|
464
|
-
* @
|
|
446
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
465
447
|
*
|
|
466
|
-
* @
|
|
448
|
+
* @return {WordArray} The hash.
|
|
467
449
|
*
|
|
468
450
|
* @example
|
|
469
451
|
*
|
|
470
|
-
* var
|
|
471
|
-
* var
|
|
472
|
-
|
|
473
|
-
execute: function(e, t, i, r, n) {
|
|
474
|
-
if (r || (r = h.random(64 / 8)), n)
|
|
475
|
-
var a = k.create({ keySize: t + i, hasher: n }).compute(e, r);
|
|
476
|
-
else
|
|
477
|
-
var a = k.create({ keySize: t + i }).compute(e, r);
|
|
478
|
-
var o = h.create(a.words.slice(t), i * 4);
|
|
479
|
-
return a.sigBytes = t * 4, _.create({ key: a, iv: o, salt: r });
|
|
480
|
-
}
|
|
481
|
-
}, q = s.PasswordBasedCipher = l.extend({
|
|
482
|
-
/**
|
|
483
|
-
* Configuration options.
|
|
484
|
-
*
|
|
485
|
-
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
|
|
452
|
+
* var hash = hasher.finalize();
|
|
453
|
+
* var hash = hasher.finalize('message');
|
|
454
|
+
* var hash = hasher.finalize(wordArray);
|
|
486
455
|
*/
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
456
|
+
finalize: function(t) {
|
|
457
|
+
t && this._append(t);
|
|
458
|
+
var r = this._doFinalize();
|
|
459
|
+
return r;
|
|
460
|
+
},
|
|
461
|
+
blockSize: 16,
|
|
490
462
|
/**
|
|
491
|
-
*
|
|
463
|
+
* Creates a shortcut function to a hasher's object interface.
|
|
492
464
|
*
|
|
493
|
-
* @param {
|
|
494
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
495
|
-
* @param {string} password The password.
|
|
496
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
465
|
+
* @param {Hasher} hasher The hasher to create a helper for.
|
|
497
466
|
*
|
|
498
|
-
* @return {
|
|
467
|
+
* @return {Function} The shortcut function.
|
|
499
468
|
*
|
|
500
469
|
* @static
|
|
501
470
|
*
|
|
502
471
|
* @example
|
|
503
472
|
*
|
|
504
|
-
* var
|
|
505
|
-
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
|
|
473
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
506
474
|
*/
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
var a = l.encrypt.call(this, e, t, n.key, r);
|
|
512
|
-
return a.mixIn(n), a;
|
|
475
|
+
_createHelper: function(t) {
|
|
476
|
+
return function(r, n) {
|
|
477
|
+
return new t.init(n).finalize(r);
|
|
478
|
+
};
|
|
513
479
|
},
|
|
514
480
|
/**
|
|
515
|
-
*
|
|
481
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
516
482
|
*
|
|
517
|
-
* @param {
|
|
518
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
519
|
-
* @param {string} password The password.
|
|
520
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
483
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
521
484
|
*
|
|
522
|
-
* @return {
|
|
485
|
+
* @return {Function} The shortcut function.
|
|
523
486
|
*
|
|
524
487
|
* @static
|
|
525
488
|
*
|
|
526
489
|
* @example
|
|
527
490
|
*
|
|
528
|
-
* var
|
|
529
|
-
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
|
|
491
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
530
492
|
*/
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
var a = l.decrypt.call(this, e, t, n.key, r);
|
|
536
|
-
return a;
|
|
493
|
+
_createHmacHelper: function(t) {
|
|
494
|
+
return function(r, n) {
|
|
495
|
+
return new I.HMAC.init(t, n).finalize(r);
|
|
496
|
+
};
|
|
537
497
|
}
|
|
538
498
|
});
|
|
539
|
-
|
|
499
|
+
var I = h.algo = {};
|
|
500
|
+
return h;
|
|
501
|
+
}(Math);
|
|
502
|
+
return y;
|
|
540
503
|
});
|
|
541
|
-
}(
|
|
504
|
+
}(w), w.exports);
|
|
542
505
|
}
|
|
543
506
|
export {
|
|
544
|
-
|
|
507
|
+
T as __require
|
|
545
508
|
};
|