Browse code

Created repository.

DoubleBastionAdmin authored on 26/01/2022 20:32:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,6232 @@
1
+/**
2
+ *  Copyright (C) 2021  Double Bastion LLC
3
+ *
4
+ *  This file is part of Roundpin, which is licensed under the
5
+ *  GNU Affero General Public License Version 3.0. The license terms
6
+ *  are detailed in the "LICENSE.txt" file located in the root directory.
7
+ *
8
+ *  The code contained in this file is identical with that of the
9
+ *  original file "crypto-js.js" downloaded from
10
+ *  https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.js .
11
+ *
12
+ *  The copyright notice for the whole "crypto-js" library, which includes
13
+ *  the code from below, follows:
14
+
15
+/*
16
+# License
17
+
18
+[The MIT License (MIT)](http://opensource.org/licenses/MIT)
19
+
20
+Copyright (c) 2009-2013 Jeff Mott  
21
+Copyright (c) 2013-2016 Evan Vosberg
22
+
23
+Permission is hereby granted, free of charge, to any person obtaining a copy
24
+of this software and associated documentation files (the "Software"), to deal
25
+in the Software without restriction, including without limitation the rights
26
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+copies of the Software, and to permit persons to whom the Software is
28
+furnished to do so, subject to the following conditions:
29
+
30
+The above copyright notice and this permission notice shall be included in
31
+all copies or substantial portions of the Software.
32
+
33
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
39
+THE SOFTWARE.
40
+*/
41
+
42
+;(function (root, factory) {
43
+	if (typeof exports === "object") {
44
+		// CommonJS
45
+		module.exports = exports = factory();
46
+	}
47
+	else if (typeof define === "function" && define.amd) {
48
+		// AMD
49
+		define([], factory);
50
+	}
51
+	else {
52
+		// Global (browser)
53
+		root.CryptoJS = factory();
54
+	}
55
+}(this, function () {
56
+
57
+	/*globals window, global, require*/
58
+
59
+	/**
60
+	 * CryptoJS core components.
61
+	 */
62
+	var CryptoJS = CryptoJS || (function (Math, undefined) {
63
+
64
+	    var crypto;
65
+
66
+	    // Native crypto from window (Browser)
67
+	    if (typeof window !== 'undefined' && window.crypto) {
68
+	        crypto = window.crypto;
69
+	    }
70
+
71
+	    // Native crypto in web worker (Browser)
72
+	    if (typeof self !== 'undefined' && self.crypto) {
73
+	        crypto = self.crypto;
74
+	    }
75
+
76
+	    // Native crypto from worker
77
+	    if (typeof globalThis !== 'undefined' && globalThis.crypto) {
78
+	        crypto = globalThis.crypto;
79
+	    }
80
+
81
+	    // Native (experimental IE 11) crypto from window (Browser)
82
+	    if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
83
+	        crypto = window.msCrypto;
84
+	    }
85
+
86
+	    // Native crypto from global (NodeJS)
87
+	    if (!crypto && typeof global !== 'undefined' && global.crypto) {
88
+	        crypto = global.crypto;
89
+	    }
90
+
91
+	    // Native crypto import via require (NodeJS)
92
+	    if (!crypto && typeof require === 'function') {
93
+	        try {
94
+	            crypto = require('crypto');
95
+	        } catch (err) {}
96
+	    }
97
+
98
+	    /*
99
+	     * Cryptographically secure pseudorandom number generator
100
+	     *
101
+	     * As Math.random() is cryptographically not safe to use
102
+	     */
103
+	    var cryptoSecureRandomInt = function () {
104
+	        if (crypto) {
105
+	            // Use getRandomValues method (Browser)
106
+	            if (typeof crypto.getRandomValues === 'function') {
107
+	                try {
108
+	                    return crypto.getRandomValues(new Uint32Array(1))[0];
109
+	                } catch (err) {}
110
+	            }
111
+
112
+	            // Use randomBytes method (NodeJS)
113
+	            if (typeof crypto.randomBytes === 'function') {
114
+	                try {
115
+	                    return crypto.randomBytes(4).readInt32LE();
116
+	                } catch (err) {}
117
+	            }
118
+	        }
119
+
120
+	        throw new Error('Native crypto module could not be used to get secure random number.');
121
+	    };
122
+
123
+	    /*
124
+	     * Local polyfill of Object.create
125
+
126
+	     */
127
+	    var create = Object.create || (function () {
128
+	        function F() {}
129
+
130
+	        return function (obj) {
131
+	            var subtype;
132
+
133
+	            F.prototype = obj;
134
+
135
+	            subtype = new F();
136
+
137
+	            F.prototype = null;
138
+
139
+	            return subtype;
140
+	        };
141
+	    }());
142
+
143
+	    /**
144
+	     * CryptoJS namespace.
145
+	     */
146
+	    var C = {};
147
+
148
+	    /**
149
+	     * Library namespace.
150
+	     */
151
+	    var C_lib = C.lib = {};
152
+
153
+	    /**
154
+	     * Base object for prototypal inheritance.
155
+	     */
156
+	    var Base = C_lib.Base = (function () {
157
+
158
+
159
+	        return {
160
+	            /**
161
+	             * Creates a new object that inherits from this object.
162
+	             *
163
+	             * @param {Object} overrides Properties to copy into the new object.
164
+	             *
165
+	             * @return {Object} The new object.
166
+	             *
167
+	             * @static
168
+	             *
169
+	             * @example
170
+	             *
171
+	             *     var MyType = CryptoJS.lib.Base.extend({
172
+	             *         field: 'value',
173
+	             *
174
+	             *         method: function () {
175
+	             *         }
176
+	             *     });
177
+	             */
178
+	            extend: function (overrides) {
179
+	                // Spawn
180
+	                var subtype = create(this);
181
+
182
+	                // Augment
183
+	                if (overrides) {
184
+	                    subtype.mixIn(overrides);
185
+	                }
186
+
187
+	                // Create default initializer
188
+	                if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
189
+	                    subtype.init = function () {
190
+	                        subtype.$super.init.apply(this, arguments);
191
+	                    };
192
+	                }
193
+
194
+	                // Initializer's prototype is the subtype object
195
+	                subtype.init.prototype = subtype;
196
+
197
+	                // Reference supertype
198
+	                subtype.$super = this;
199
+
200
+	                return subtype;
201
+	            },
202
+
203
+	            /**
204
+	             * Extends this object and runs the init method.
205
+	             * Arguments to create() will be passed to init().
206
+	             *
207
+	             * @return {Object} The new object.
208
+	             *
209
+	             * @static
210
+	             *
211
+	             * @example
212
+	             *
213
+	             *     var instance = MyType.create();
214
+	             */
215
+	            create: function () {
216
+	                var instance = this.extend();
217
+	                instance.init.apply(instance, arguments);
218
+
219
+	                return instance;
220
+	            },
221
+
222
+	            /**
223
+	             * Initializes a newly created object.
224
+	             * Override this method to add some logic when your objects are created.
225
+	             *
226
+	             * @example
227
+	             *
228
+	             *     var MyType = CryptoJS.lib.Base.extend({
229
+	             *         init: function () {
230
+	             *             // ...
231
+	             *         }
232
+	             *     });
233
+	             */
234
+	            init: function () {
235
+	            },
236
+
237
+	            /**
238
+	             * Copies properties into this object.
239
+	             *
240
+	             * @param {Object} properties The properties to mix in.
241
+	             *
242
+	             * @example
243
+	             *
244
+	             *     MyType.mixIn({
245
+	             *         field: 'value'
246
+	             *     });
247
+	             */
248
+	            mixIn: function (properties) {
249
+	                for (var propertyName in properties) {
250
+	                    if (properties.hasOwnProperty(propertyName)) {
251
+	                        this[propertyName] = properties[propertyName];
252
+	                    }
253
+	                }
254
+
255
+	                // IE won't copy toString using the loop above
256
+	                if (properties.hasOwnProperty('toString')) {
257
+	                    this.toString = properties.toString;
258
+	                }
259
+	            },
260
+
261
+	            /**
262
+	             * Creates a copy of this object.
263
+	             *
264
+	             * @return {Object} The clone.
265
+	             *
266
+	             * @example
267
+	             *
268
+	             *     var clone = instance.clone();
269
+	             */
270
+	            clone: function () {
271
+	                return this.init.prototype.extend(this);
272
+	            }
273
+	        };
274
+	    }());
275
+
276
+	    /**
277
+	     * An array of 32-bit words.
278
+	     *
279
+	     * @property {Array} words The array of 32-bit words.
280
+	     * @property {number} sigBytes The number of significant bytes in this word array.
281
+	     */
282
+	    var WordArray = C_lib.WordArray = Base.extend({
283
+	        /**
284
+	         * Initializes a newly created word array.
285
+	         *
286
+	         * @param {Array} words (Optional) An array of 32-bit words.
287
+	         * @param {number} sigBytes (Optional) The number of significant bytes in the words.
288
+	         *
289
+	         * @example
290
+	         *
291
+	         *     var wordArray = CryptoJS.lib.WordArray.create();
292
+	         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
293
+	         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
294
+	         */
295
+	        init: function (words, sigBytes) {
296
+	            words = this.words = words || [];
297
+
298
+	            if (sigBytes != undefined) {
299
+	                this.sigBytes = sigBytes;
300
+	            } else {
301
+	                this.sigBytes = words.length * 4;
302
+	            }
303
+	        },
304
+
305
+	        /**
306
+	         * Converts this word array to a string.
307
+	         *
308
+	         * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
309
+	         *
310
+	         * @return {string} The stringified word array.
311
+	         *
312
+	         * @example
313
+	         *
314
+	         *     var string = wordArray + '';
315
+	         *     var string = wordArray.toString();
316
+	         *     var string = wordArray.toString(CryptoJS.enc.Utf8);
317
+	         */
318
+	        toString: function (encoder) {
319
+	            return (encoder || Hex).stringify(this);
320
+	        },
321
+
322
+	        /**
323
+	         * Concatenates a word array to this word array.
324
+	         *
325
+	         * @param {WordArray} wordArray The word array to append.
326
+	         *
327
+	         * @return {WordArray} This word array.
328
+	         *
329
+	         * @example
330
+	         *
331
+	         *     wordArray1.concat(wordArray2);
332
+	         */
333
+	        concat: function (wordArray) {
334
+	            // Shortcuts
335
+	            var thisWords = this.words;
336
+	            var thatWords = wordArray.words;
337
+	            var thisSigBytes = this.sigBytes;
338
+	            var thatSigBytes = wordArray.sigBytes;
339
+
340
+	            // Clamp excess bits
341
+	            this.clamp();
342
+
343
+	            // Concat
344
+	            if (thisSigBytes % 4) {
345
+	                // Copy one byte at a time
346
+	                for (var i = 0; i < thatSigBytes; i++) {
347
+	                    var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
348
+	                    thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
349
+	                }
350
+	            } else {
351
+	                // Copy one word at a time
352
+	                for (var j = 0; j < thatSigBytes; j += 4) {
353
+	                    thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];
354
+	                }
355
+	            }
356
+	            this.sigBytes += thatSigBytes;
357
+
358
+	            // Chainable
359
+	            return this;
360
+	        },
361
+
362
+	        /**
363
+	         * Removes insignificant bits.
364
+	         *
365
+	         * @example
366
+	         *
367
+	         *     wordArray.clamp();
368
+	         */
369
+	        clamp: function () {
370
+	            // Shortcuts
371
+	            var words = this.words;
372
+	            var sigBytes = this.sigBytes;
373
+
374
+	            // Clamp
375
+	            words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
376
+	            words.length = Math.ceil(sigBytes / 4);
377
+	        },
378
+
379
+	        /**
380
+	         * Creates a copy of this word array.
381
+	         *
382
+	         * @return {WordArray} The clone.
383
+	         *
384
+	         * @example
385
+	         *
386
+	         *     var clone = wordArray.clone();
387
+	         */
388
+	        clone: function () {
389
+	            var clone = Base.clone.call(this);
390
+	            clone.words = this.words.slice(0);
391
+
392
+	            return clone;
393
+	        },
394
+
395
+	        /**
396
+	         * Creates a word array filled with random bytes.
397
+	         *
398
+	         * @param {number} nBytes The number of random bytes to generate.
399
+	         *
400
+	         * @return {WordArray} The random word array.
401
+	         *
402
+	         * @static
403
+	         *
404
+	         * @example
405
+	         *
406
+	         *     var wordArray = CryptoJS.lib.WordArray.random(16);
407
+	         */
408
+	        random: function (nBytes) {
409
+	            var words = [];
410
+
411
+	            for (var i = 0; i < nBytes; i += 4) {
412
+	                words.push(cryptoSecureRandomInt());
413
+	            }
414
+
415
+	            return new WordArray.init(words, nBytes);
416
+	        }
417
+	    });
418
+
419
+	    /**
420
+	     * Encoder namespace.
421
+	     */
422
+	    var C_enc = C.enc = {};
423
+
424
+	    /**
425
+	     * Hex encoding strategy.
426
+	     */
427
+	    var Hex = C_enc.Hex = {
428
+	        /**
429
+	         * Converts a word array to a hex string.
430
+	         *
431
+	         * @param {WordArray} wordArray The word array.
432
+	         *
433
+	         * @return {string} The hex string.
434
+	         *
435
+	         * @static
436
+	         *
437
+	         * @example
438
+	         *
439
+	         *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
440
+	         */
441
+	        stringify: function (wordArray) {
442
+	            // Shortcuts
443
+	            var words = wordArray.words;
444
+	            var sigBytes = wordArray.sigBytes;
445
+
446
+	            // Convert
447
+	            var hexChars = [];
448
+	            for (var i = 0; i < sigBytes; i++) {
449
+	                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
450
+	                hexChars.push((bite >>> 4).toString(16));
451
+	                hexChars.push((bite & 0x0f).toString(16));
452
+	            }
453
+
454
+	            return hexChars.join('');
455
+	        },
456
+
457
+	        /**
458
+	         * Converts a hex string to a word array.
459
+	         *
460
+	         * @param {string} hexStr The hex string.
461
+	         *
462
+	         * @return {WordArray} The word array.
463
+	         *
464
+	         * @static
465
+	         *
466
+	         * @example
467
+	         *
468
+	         *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
469
+	         */
470
+	        parse: function (hexStr) {
471
+	            // Shortcut
472
+	            var hexStrLength = hexStr.length;
473
+
474
+	            // Convert
475
+	            var words = [];
476
+	            for (var i = 0; i < hexStrLength; i += 2) {
477
+	                words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
478
+	            }
479
+
480
+	            return new WordArray.init(words, hexStrLength / 2);
481
+	        }
482
+	    };
483
+
484
+	    /**
485
+	     * Latin1 encoding strategy.
486
+	     */
487
+	    var Latin1 = C_enc.Latin1 = {
488
+	        /**
489
+	         * Converts a word array to a Latin1 string.
490
+	         *
491
+	         * @param {WordArray} wordArray The word array.
492
+	         *
493
+	         * @return {string} The Latin1 string.
494
+	         *
495
+	         * @static
496
+	         *
497
+	         * @example
498
+	         *
499
+	         *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
500
+	         */
501
+	        stringify: function (wordArray) {
502
+	            // Shortcuts
503
+	            var words = wordArray.words;
504
+	            var sigBytes = wordArray.sigBytes;
505
+
506
+	            // Convert
507
+	            var latin1Chars = [];
508
+	            for (var i = 0; i < sigBytes; i++) {
509
+	                var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
510
+	                latin1Chars.push(String.fromCharCode(bite));
511
+	            }
512
+
513
+	            return latin1Chars.join('');
514
+	        },
515
+
516
+	        /**
517
+	         * Converts a Latin1 string to a word array.
518
+	         *
519
+	         * @param {string} latin1Str The Latin1 string.
520
+	         *
521
+	         * @return {WordArray} The word array.
522
+	         *
523
+	         * @static
524
+	         *
525
+	         * @example
526
+	         *
527
+	         *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
528
+	         */
529
+	        parse: function (latin1Str) {
530
+	            // Shortcut
531
+	            var latin1StrLength = latin1Str.length;
532
+
533
+	            // Convert
534
+	            var words = [];
535
+	            for (var i = 0; i < latin1StrLength; i++) {
536
+	                words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
537
+	            }
538
+
539
+	            return new WordArray.init(words, latin1StrLength);
540
+	        }
541
+	    };
542
+
543
+	    /**
544
+	     * UTF-8 encoding strategy.
545
+	     */
546
+	    var Utf8 = C_enc.Utf8 = {
547
+	        /**
548
+	         * Converts a word array to a UTF-8 string.
549
+	         *
550
+	         * @param {WordArray} wordArray The word array.
551
+	         *
552
+	         * @return {string} The UTF-8 string.
553
+	         *
554
+	         * @static
555
+	         *
556
+	         * @example
557
+	         *
558
+	         *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
559
+	         */
560
+	        stringify: function (wordArray) {
561
+	            try {
562
+	                return decodeURIComponent(escape(Latin1.stringify(wordArray)));
563
+	            } catch (e) {
564
+	                throw new Error('Malformed UTF-8 data');
565
+	            }
566
+	        },
567
+
568
+	        /**
569
+	         * Converts a UTF-8 string to a word array.
570
+	         *
571
+	         * @param {string} utf8Str The UTF-8 string.
572
+	         *
573
+	         * @return {WordArray} The word array.
574
+	         *
575
+	         * @static
576
+	         *
577
+	         * @example
578
+	         *
579
+	         *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
580
+	         */
581
+	        parse: function (utf8Str) {
582
+	            return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
583
+	        }
584
+	    };
585
+
586
+	    /**
587
+	     * Abstract buffered block algorithm template.
588
+	     *
589
+	     * The property blockSize must be implemented in a concrete subtype.
590
+	     *
591
+	     * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
592
+	     */
593
+	    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
594
+	        /**
595
+	         * Resets this block algorithm's data buffer to its initial state.
596
+	         *
597
+	         * @example
598
+	         *
599
+	         *     bufferedBlockAlgorithm.reset();
600
+	         */
601
+	        reset: function () {
602
+	            // Initial values
603
+	            this._data = new WordArray.init();
604
+	            this._nDataBytes = 0;
605
+	        },
606
+
607
+	        /**
608
+	         * Adds new data to this block algorithm's buffer.
609
+	         *
610
+	         * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
611
+	         *
612
+	         * @example
613
+	         *
614
+	         *     bufferedBlockAlgorithm._append('data');
615
+	         *     bufferedBlockAlgorithm._append(wordArray);
616
+	         */
617
+	        _append: function (data) {
618
+	            // Convert string to WordArray, else assume WordArray already
619
+	            if (typeof data == 'string') {
620
+	                data = Utf8.parse(data);
621
+	            }
622
+
623
+	            // Append
624
+	            this._data.concat(data);
625
+	            this._nDataBytes += data.sigBytes;
626
+	        },
627
+
628
+	        /**
629
+	         * Processes available data blocks.
630
+	         *
631
+	         * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
632
+	         *
633
+	         * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
634
+	         *
635
+	         * @return {WordArray} The processed data.
636
+	         *
637
+	         * @example
638
+	         *
639
+	         *     var processedData = bufferedBlockAlgorithm._process();
640
+	         *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
641
+	         */
642
+	        _process: function (doFlush) {
643
+	            var processedWords;
644
+
645
+	            // Shortcuts
646
+	            var data = this._data;
647
+	            var dataWords = data.words;
648
+	            var dataSigBytes = data.sigBytes;
649
+	            var blockSize = this.blockSize;
650
+	            var blockSizeBytes = blockSize * 4;
651
+
652
+	            // Count blocks ready
653
+	            var nBlocksReady = dataSigBytes / blockSizeBytes;
654
+	            if (doFlush) {
655
+	                // Round up to include partial blocks
656
+	                nBlocksReady = Math.ceil(nBlocksReady);
657
+	            } else {
658
+	                // Round down to include only full blocks,
659
+	                // less the number of blocks that must remain in the buffer
660
+	                nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
661
+	            }
662
+
663
+	            // Count words ready
664
+	            var nWordsReady = nBlocksReady * blockSize;
665
+
666
+	            // Count bytes ready
667
+	            var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
668
+
669
+	            // Process blocks
670
+	            if (nWordsReady) {
671
+	                for (var offset = 0; offset < nWordsReady; offset += blockSize) {
672
+	                    // Perform concrete-algorithm logic
673
+	                    this._doProcessBlock(dataWords, offset);
674
+	                }
675
+
676
+	                // Remove processed words
677
+	                processedWords = dataWords.splice(0, nWordsReady);
678
+	                data.sigBytes -= nBytesReady;
679
+	            }
680
+
681
+	            // Return processed words
682
+	            return new WordArray.init(processedWords, nBytesReady);
683
+	        },
684
+
685
+	        /**
686
+	         * Creates a copy of this object.
687
+	         *
688
+	         * @return {Object} The clone.
689
+	         *
690
+	         * @example
691
+	         *
692
+	         *     var clone = bufferedBlockAlgorithm.clone();
693
+	         */
694
+	        clone: function () {
695
+	            var clone = Base.clone.call(this);
696
+	            clone._data = this._data.clone();
697
+
698
+	            return clone;
699
+	        },
700
+
701
+	        _minBufferSize: 0
702
+	    });
703
+
704
+	    /**
705
+	     * Abstract hasher template.
706
+	     *
707
+	     * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
708
+	     */
709
+	    var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
710
+	        /**
711
+	         * Configuration options.
712
+	         */
713
+	        cfg: Base.extend(),
714
+
715
+	        /**
716
+	         * Initializes a newly created hasher.
717
+	         *
718
+	         * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
719
+	         *
720
+	         * @example
721
+	         *
722
+	         *     var hasher = CryptoJS.algo.SHA256.create();
723
+	         */
724
+	        init: function (cfg) {
725
+	            // Apply config defaults
726
+	            this.cfg = this.cfg.extend(cfg);
727
+
728
+	            // Set initial values
729
+	            this.reset();
730
+	        },
731
+
732
+	        /**
733
+	         * Resets this hasher to its initial state.
734
+	         *
735
+	         * @example
736
+	         *
737
+	         *     hasher.reset();
738
+	         */
739
+	        reset: function () {
740
+	            // Reset data buffer
741
+	            BufferedBlockAlgorithm.reset.call(this);
742
+
743
+	            // Perform concrete-hasher logic
744
+	            this._doReset();
745
+	        },
746
+
747
+	        /**
748
+	         * Updates this hasher with a message.
749
+	         *
750
+	         * @param {WordArray|string} messageUpdate The message to append.
751
+	         *
752
+	         * @return {Hasher} This hasher.
753
+	         *
754
+	         * @example
755
+	         *
756
+	         *     hasher.update('message');
757
+	         *     hasher.update(wordArray);
758
+	         */
759
+	        update: function (messageUpdate) {
760
+	            // Append
761
+	            this._append(messageUpdate);
762
+
763
+	            // Update the hash
764
+	            this._process();
765
+
766
+	            // Chainable
767
+	            return this;
768
+	        },
769
+
770
+	        /**
771
+	         * Finalizes the hash computation.
772
+	         * Note that the finalize operation is effectively a destructive, read-once operation.
773
+	         *
774
+	         * @param {WordArray|string} messageUpdate (Optional) A final message update.
775
+	         *
776
+	         * @return {WordArray} The hash.
777
+	         *
778
+	         * @example
779
+	         *
780
+	         *     var hash = hasher.finalize();
781
+	         *     var hash = hasher.finalize('message');
782
+	         *     var hash = hasher.finalize(wordArray);
783
+	         */
784
+	        finalize: function (messageUpdate) {
785
+	            // Final message update
786
+	            if (messageUpdate) {
787
+	                this._append(messageUpdate);
788
+	            }
789
+
790
+	            // Perform concrete-hasher logic
791
+	            var hash = this._doFinalize();
792
+
793
+	            return hash;
794
+	        },
795
+
796
+	        blockSize: 512/32,
797
+
798
+	        /**
799
+	         * Creates a shortcut function to a hasher's object interface.
800
+	         *
801
+	         * @param {Hasher} hasher The hasher to create a helper for.
802
+	         *
803
+	         * @return {Function} The shortcut function.
804
+	         *
805
+	         * @static
806
+	         *
807
+	         * @example
808
+	         *
809
+	         *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
810
+	         */
811
+	        _createHelper: function (hasher) {
812
+	            return function (message, cfg) {
813
+	                return new hasher.init(cfg).finalize(message);
814
+	            };
815
+	        },
816
+
817
+	        /**
818
+	         * Creates a shortcut function to the HMAC's object interface.
819
+	         *
820
+	         * @param {Hasher} hasher The hasher to use in this HMAC helper.
821
+	         *
822
+	         * @return {Function} The shortcut function.
823
+	         *
824
+	         * @static
825
+	         *
826
+	         * @example
827
+	         *
828
+	         *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
829
+	         */
830
+	        _createHmacHelper: function (hasher) {
831
+	            return function (message, key) {
832
+	                return new C_algo.HMAC.init(hasher, key).finalize(message);
833
+	            };
834
+	        }
835
+	    });
836
+
837
+	    /**
838
+	     * Algorithm namespace.
839
+	     */
840
+	    var C_algo = C.algo = {};
841
+
842
+	    return C;
843
+	}(Math));
844
+
845
+
846
+	(function (undefined) {
847
+	    // Shortcuts
848
+	    var C = CryptoJS;
849
+	    var C_lib = C.lib;
850
+	    var Base = C_lib.Base;
851
+	    var X32WordArray = C_lib.WordArray;
852
+
853
+	    /**
854
+	     * x64 namespace.
855
+	     */
856
+	    var C_x64 = C.x64 = {};
857
+
858
+	    /**
859
+	     * A 64-bit word.
860
+	     */
861
+	    var X64Word = C_x64.Word = Base.extend({
862
+	        /**
863
+	         * Initializes a newly created 64-bit word.
864
+	         *
865
+	         * @param {number} high The high 32 bits.
866
+	         * @param {number} low The low 32 bits.
867
+	         *
868
+	         * @example
869
+	         *
870
+	         *     var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
871
+	         */
872
+	        init: function (high, low) {
873
+	            this.high = high;
874
+	            this.low = low;
875
+	        }
876
+
877
+	        /**
878
+	         * Bitwise NOTs this word.
879
+	         *
880
+	         * @return {X64Word} A new x64-Word object after negating.
881
+	         *
882
+	         * @example
883
+	         *
884
+	         *     var negated = x64Word.not();
885
+	         */
886
+	        // not: function () {
887
+	            // var high = ~this.high;
888
+	            // var low = ~this.low;
889
+
890
+	            // return X64Word.create(high, low);
891
+	        // },
892
+
893
+	        /**
894
+	         * Bitwise ANDs this word with the passed word.
895
+	         *
896
+	         * @param {X64Word} word The x64-Word to AND with this word.
897
+	         *
898
+	         * @return {X64Word} A new x64-Word object after ANDing.
899
+	         *
900
+	         * @example
901
+	         *
902
+	         *     var anded = x64Word.and(anotherX64Word);
903
+	         */
904
+	        // and: function (word) {
905
+	            // var high = this.high & word.high;
906
+	            // var low = this.low & word.low;
907
+
908
+	            // return X64Word.create(high, low);
909
+	        // },
910
+
911
+	        /**
912
+	         * Bitwise ORs this word with the passed word.
913
+	         *
914
+	         * @param {X64Word} word The x64-Word to OR with this word.
915
+	         *
916
+	         * @return {X64Word} A new x64-Word object after ORing.
917
+	         *
918
+	         * @example
919
+	         *
920
+	         *     var ored = x64Word.or(anotherX64Word);
921
+	         */
922
+	        // or: function (word) {
923
+	            // var high = this.high | word.high;
924
+	            // var low = this.low | word.low;
925
+
926
+	            // return X64Word.create(high, low);
927
+	        // },
928
+
929
+	        /**
930
+	         * Bitwise XORs this word with the passed word.
931
+	         *
932
+	         * @param {X64Word} word The x64-Word to XOR with this word.
933
+	         *
934
+	         * @return {X64Word} A new x64-Word object after XORing.
935
+	         *
936
+	         * @example
937
+	         *
938
+	         *     var xored = x64Word.xor(anotherX64Word);
939
+	         */
940
+	        // xor: function (word) {
941
+	            // var high = this.high ^ word.high;
942
+	            // var low = this.low ^ word.low;
943
+
944
+	            // return X64Word.create(high, low);
945
+	        // },
946
+
947
+	        /**
948
+	         * Shifts this word n bits to the left.
949
+	         *
950
+	         * @param {number} n The number of bits to shift.
951
+	         *
952
+	         * @return {X64Word} A new x64-Word object after shifting.
953
+	         *
954
+	         * @example
955
+	         *
956
+	         *     var shifted = x64Word.shiftL(25);
957
+	         */
958
+	        // shiftL: function (n) {
959
+	            // if (n < 32) {
960
+	                // var high = (this.high << n) | (this.low >>> (32 - n));
961
+	                // var low = this.low << n;
962
+	            // } else {
963
+	                // var high = this.low << (n - 32);
964
+	                // var low = 0;
965
+	            // }
966
+
967
+	            // return X64Word.create(high, low);
968
+	        // },
969
+
970
+	        /**
971
+	         * Shifts this word n bits to the right.
972
+	         *
973
+	         * @param {number} n The number of bits to shift.
974
+	         *
975
+	         * @return {X64Word} A new x64-Word object after shifting.
976
+	         *
977
+	         * @example
978
+	         *
979
+	         *     var shifted = x64Word.shiftR(7);
980
+	         */
981
+	        // shiftR: function (n) {
982
+	            // if (n < 32) {
983
+	                // var low = (this.low >>> n) | (this.high << (32 - n));
984
+	                // var high = this.high >>> n;
985
+	            // } else {
986
+	                // var low = this.high >>> (n - 32);
987
+	                // var high = 0;
988
+	            // }
989
+
990
+	            // return X64Word.create(high, low);
991
+	        // },
992
+
993
+	        /**
994
+	         * Rotates this word n bits to the left.
995
+	         *
996
+	         * @param {number} n The number of bits to rotate.
997
+	         *
998
+	         * @return {X64Word} A new x64-Word object after rotating.
999
+	         *
1000
+	         * @example
1001
+	         *
1002
+	         *     var rotated = x64Word.rotL(25);
1003
+	         */
1004
+	        // rotL: function (n) {
1005
+	            // return this.shiftL(n).or(this.shiftR(64 - n));
1006
+	        // },
1007
+
1008
+	        /**
1009
+	         * Rotates this word n bits to the right.
1010
+	         *
1011
+	         * @param {number} n The number of bits to rotate.
1012
+	         *
1013
+	         * @return {X64Word} A new x64-Word object after rotating.
1014
+	         *
1015
+	         * @example
1016
+	         *
1017
+	         *     var rotated = x64Word.rotR(7);
1018
+	         */
1019
+	        // rotR: function (n) {
1020
+	            // return this.shiftR(n).or(this.shiftL(64 - n));
1021
+	        // },
1022
+
1023
+	        /**
1024
+	         * Adds this word with the passed word.
1025
+	         *
1026
+	         * @param {X64Word} word The x64-Word to add with this word.
1027
+	         *
1028
+	         * @return {X64Word} A new x64-Word object after adding.
1029
+	         *
1030
+	         * @example
1031
+	         *
1032
+	         *     var added = x64Word.add(anotherX64Word);
1033
+	         */
1034
+	        // add: function (word) {
1035
+	            // var low = (this.low + word.low) | 0;
1036
+	            // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
1037
+	            // var high = (this.high + word.high + carry) | 0;
1038
+
1039
+	            // return X64Word.create(high, low);
1040
+	        // }
1041
+	    });
1042
+
1043
+	    /**
1044
+	     * An array of 64-bit words.
1045
+	     *
1046
+	     * @property {Array} words The array of CryptoJS.x64.Word objects.
1047
+	     * @property {number} sigBytes The number of significant bytes in this word array.
1048
+	     */
1049
+	    var X64WordArray = C_x64.WordArray = Base.extend({
1050
+	        /**
1051
+	         * Initializes a newly created word array.
1052
+	         *
1053
+	         * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
1054
+	         * @param {number} sigBytes (Optional) The number of significant bytes in the words.
1055
+	         *
1056
+	         * @example
1057
+	         *
1058
+	         *     var wordArray = CryptoJS.x64.WordArray.create();
1059
+	         *
1060
+	         *     var wordArray = CryptoJS.x64.WordArray.create([
1061
+	         *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
1062
+	         *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
1063
+	         *     ]);
1064
+	         *
1065
+	         *     var wordArray = CryptoJS.x64.WordArray.create([
1066
+	         *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
1067
+	         *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
1068
+	         *     ], 10);
1069
+	         */
1070
+	        init: function (words, sigBytes) {
1071
+	            words = this.words = words || [];
1072
+
1073
+	            if (sigBytes != undefined) {
1074
+	                this.sigBytes = sigBytes;
1075
+	            } else {
1076
+	                this.sigBytes = words.length * 8;
1077
+	            }
1078
+	        },
1079
+
1080
+	        /**
1081
+	         * Converts this 64-bit word array to a 32-bit word array.
1082
+	         *
1083
+	         * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
1084
+	         *
1085
+	         * @example
1086
+	         *
1087
+	         *     var x32WordArray = x64WordArray.toX32();
1088
+	         */
1089
+	        toX32: function () {
1090
+	            // Shortcuts
1091
+	            var x64Words = this.words;
1092
+	            var x64WordsLength = x64Words.length;
1093
+
1094
+	            // Convert
1095
+	            var x32Words = [];
1096
+	            for (var i = 0; i < x64WordsLength; i++) {
1097
+	                var x64Word = x64Words[i];
1098
+	                x32Words.push(x64Word.high);
1099
+	                x32Words.push(x64Word.low);
1100
+	            }
1101
+
1102
+	            return X32WordArray.create(x32Words, this.sigBytes);
1103
+	        },
1104
+
1105
+	        /**
1106
+	         * Creates a copy of this word array.
1107
+	         *
1108
+	         * @return {X64WordArray} The clone.
1109
+	         *
1110
+	         * @example
1111
+	         *
1112
+	         *     var clone = x64WordArray.clone();
1113
+	         */
1114
+	        clone: function () {
1115
+	            var clone = Base.clone.call(this);
1116
+
1117
+	            // Clone "words" array
1118
+	            var words = clone.words = this.words.slice(0);
1119
+
1120
+	            // Clone each X64Word object
1121
+	            var wordsLength = words.length;
1122
+	            for (var i = 0; i < wordsLength; i++) {
1123
+	                words[i] = words[i].clone();
1124
+	            }
1125
+
1126
+	            return clone;
1127
+	        }
1128
+	    });
1129
+	}());
1130
+
1131
+
1132
+	(function () {
1133
+	    // Check if typed arrays are supported
1134
+	    if (typeof ArrayBuffer != 'function') {
1135
+	        return;
1136
+	    }
1137
+
1138
+	    // Shortcuts
1139
+	    var C = CryptoJS;
1140
+	    var C_lib = C.lib;
1141
+	    var WordArray = C_lib.WordArray;
1142
+
1143
+	    // Reference original init
1144
+	    var superInit = WordArray.init;
1145
+
1146
+	    // Augment WordArray.init to handle typed arrays
1147
+	    var subInit = WordArray.init = function (typedArray) {
1148
+	        // Convert buffers to uint8
1149
+	        if (typedArray instanceof ArrayBuffer) {
1150
+	            typedArray = new Uint8Array(typedArray);
1151
+	        }
1152
+
1153
+	        // Convert other array views to uint8
1154
+	        if (
1155
+	            typedArray instanceof Int8Array ||
1156
+	            (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
1157
+	            typedArray instanceof Int16Array ||
1158
+	            typedArray instanceof Uint16Array ||
1159
+	            typedArray instanceof Int32Array ||
1160
+	            typedArray instanceof Uint32Array ||
1161
+	            typedArray instanceof Float32Array ||
1162
+	            typedArray instanceof Float64Array
1163
+	        ) {
1164
+	            typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
1165
+	        }
1166
+
1167
+	        // Handle Uint8Array
1168
+	        if (typedArray instanceof Uint8Array) {
1169
+	            // Shortcut
1170
+	            var typedArrayByteLength = typedArray.byteLength;
1171
+
1172
+	            // Extract bytes
1173
+	            var words = [];
1174
+	            for (var i = 0; i < typedArrayByteLength; i++) {
1175
+	                words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
1176
+	            }
1177
+
1178
+	            // Initialize this word array
1179
+	            superInit.call(this, words, typedArrayByteLength);
1180
+	        } else {
1181
+	            // Else call normal init
1182
+	            superInit.apply(this, arguments);
1183
+	        }
1184
+	    };
1185
+
1186
+	    subInit.prototype = WordArray;
1187
+	}());
1188
+
1189
+
1190
+	(function () {
1191
+	    // Shortcuts
1192
+	    var C = CryptoJS;
1193
+	    var C_lib = C.lib;
1194
+	    var WordArray = C_lib.WordArray;
1195
+	    var C_enc = C.enc;
1196
+
1197
+	    /**
1198
+	     * UTF-16 BE encoding strategy.
1199
+	     */
1200
+	    var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
1201
+	        /**
1202
+	         * Converts a word array to a UTF-16 BE string.
1203
+	         *
1204
+	         * @param {WordArray} wordArray The word array.
1205
+	         *
1206
+	         * @return {string} The UTF-16 BE string.
1207
+	         *
1208
+	         * @static
1209
+	         *
1210
+	         * @example
1211
+	         *
1212
+	         *     var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
1213
+	         */
1214
+	        stringify: function (wordArray) {
1215
+	            // Shortcuts
1216
+	            var words = wordArray.words;
1217
+	            var sigBytes = wordArray.sigBytes;
1218
+
1219
+	            // Convert
1220
+	            var utf16Chars = [];
1221
+	            for (var i = 0; i < sigBytes; i += 2) {
1222
+	                var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
1223
+	                utf16Chars.push(String.fromCharCode(codePoint));
1224
+	            }
1225
+
1226
+	            return utf16Chars.join('');
1227
+	        },
1228
+
1229
+	        /**
1230
+	         * Converts a UTF-16 BE string to a word array.
1231
+	         *
1232
+	         * @param {string} utf16Str The UTF-16 BE string.
1233
+	         *
1234
+	         * @return {WordArray} The word array.
1235
+	         *
1236
+	         * @static
1237
+	         *
1238
+	         * @example
1239
+	         *
1240
+	         *     var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
1241
+	         */
1242
+	        parse: function (utf16Str) {
1243
+	            // Shortcut
1244
+	            var utf16StrLength = utf16Str.length;
1245
+
1246
+	            // Convert
1247
+	            var words = [];
1248
+	            for (var i = 0; i < utf16StrLength; i++) {
1249
+	                words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
1250
+	            }
1251
+
1252
+	            return WordArray.create(words, utf16StrLength * 2);
1253
+	        }
1254
+	    };
1255
+
1256
+	    /**
1257
+	     * UTF-16 LE encoding strategy.
1258
+	     */
1259
+	    C_enc.Utf16LE = {
1260
+	        /**
1261
+	         * Converts a word array to a UTF-16 LE string.
1262
+	         *
1263
+	         * @param {WordArray} wordArray The word array.
1264
+	         *
1265
+	         * @return {string} The UTF-16 LE string.
1266
+	         *
1267
+	         * @static
1268
+	         *
1269
+	         * @example
1270
+	         *
1271
+	         *     var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
1272
+	         */
1273
+	        stringify: function (wordArray) {
1274
+	            // Shortcuts
1275
+	            var words = wordArray.words;
1276
+	            var sigBytes = wordArray.sigBytes;
1277
+
1278
+	            // Convert
1279
+	            var utf16Chars = [];
1280
+	            for (var i = 0; i < sigBytes; i += 2) {
1281
+	                var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
1282
+	                utf16Chars.push(String.fromCharCode(codePoint));
1283
+	            }
1284
+
1285
+	            return utf16Chars.join('');
1286
+	        },
1287
+
1288
+	        /**
1289
+	         * Converts a UTF-16 LE string to a word array.
1290
+	         *
1291
+	         * @param {string} utf16Str The UTF-16 LE string.
1292
+	         *
1293
+	         * @return {WordArray} The word array.
1294
+	         *
1295
+	         * @static
1296
+	         *
1297
+	         * @example
1298
+	         *
1299
+	         *     var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
1300
+	         */
1301
+	        parse: function (utf16Str) {
1302
+	            // Shortcut
1303
+	            var utf16StrLength = utf16Str.length;
1304
+
1305
+	            // Convert
1306
+	            var words = [];
1307
+	            for (var i = 0; i < utf16StrLength; i++) {
1308
+	                words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
1309
+	            }
1310
+
1311
+	            return WordArray.create(words, utf16StrLength * 2);
1312
+	        }
1313
+	    };
1314
+
1315
+	    function swapEndian(word) {
1316
+	        return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
1317
+	    }
1318
+	}());
1319
+
1320
+
1321
+	(function () {
1322
+	    // Shortcuts
1323
+	    var C = CryptoJS;
1324
+	    var C_lib = C.lib;
1325
+	    var WordArray = C_lib.WordArray;
1326
+	    var C_enc = C.enc;
1327
+
1328
+	    /**
1329
+	     * Base64 encoding strategy.
1330
+	     */
1331
+	    var Base64 = C_enc.Base64 = {
1332
+	        /**
1333
+	         * Converts a word array to a Base64 string.
1334
+	         *
1335
+	         * @param {WordArray} wordArray The word array.
1336
+	         *
1337
+	         * @return {string} The Base64 string.
1338
+	         *
1339
+	         * @static
1340
+	         *
1341
+	         * @example
1342
+	         *
1343
+	         *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
1344
+	         */
1345
+	        stringify: function (wordArray) {
1346
+	            // Shortcuts
1347
+	            var words = wordArray.words;
1348
+	            var sigBytes = wordArray.sigBytes;
1349
+	            var map = this._map;
1350
+
1351
+	            // Clamp excess bits
1352
+	            wordArray.clamp();
1353
+
1354
+	            // Convert
1355
+	            var base64Chars = [];
1356
+	            for (var i = 0; i < sigBytes; i += 3) {
1357
+	                var byte1 = (words[i >>> 2]       >>> (24 - (i % 4) * 8))       & 0xff;
1358
+	                var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
1359
+	                var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
1360
+
1361
+	                var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
1362
+
1363
+	                for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
1364
+	                    base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
1365
+	                }
1366
+	            }
1367
+
1368
+	            // Add padding
1369
+	            var paddingChar = map.charAt(64);
1370
+	            if (paddingChar) {
1371
+	                while (base64Chars.length % 4) {
1372
+	                    base64Chars.push(paddingChar);
1373
+	                }
1374
+	            }
1375
+
1376
+	            return base64Chars.join('');
1377
+	        },
1378
+
1379
+	        /**
1380
+	         * Converts a Base64 string to a word array.
1381
+	         *
1382
+	         * @param {string} base64Str The Base64 string.
1383
+	         *
1384
+	         * @return {WordArray} The word array.
1385
+	         *
1386
+	         * @static
1387
+	         *
1388
+	         * @example
1389
+	         *
1390
+	         *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
1391
+	         */
1392
+	        parse: function (base64Str) {
1393
+	            // Shortcuts
1394
+	            var base64StrLength = base64Str.length;
1395
+	            var map = this._map;
1396
+	            var reverseMap = this._reverseMap;
1397
+
1398
+	            if (!reverseMap) {
1399
+	                    reverseMap = this._reverseMap = [];
1400
+	                    for (var j = 0; j < map.length; j++) {
1401
+	                        reverseMap[map.charCodeAt(j)] = j;
1402
+	                    }
1403
+	            }
1404
+
1405
+	            // Ignore padding
1406
+	            var paddingChar = map.charAt(64);
1407
+	            if (paddingChar) {
1408
+	                var paddingIndex = base64Str.indexOf(paddingChar);
1409
+	                if (paddingIndex !== -1) {
1410
+	                    base64StrLength = paddingIndex;
1411
+	                }
1412
+	            }
1413
+
1414
+	            // Convert
1415
+	            return parseLoop(base64Str, base64StrLength, reverseMap);
1416
+
1417
+	        },
1418
+
1419
+	        _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
1420
+	    };
1421
+
1422
+	    function parseLoop(base64Str, base64StrLength, reverseMap) {
1423
+	      var words = [];
1424
+	      var nBytes = 0;
1425
+	      for (var i = 0; i < base64StrLength; i++) {
1426
+	          if (i % 4) {
1427
+	              var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
1428
+	              var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
1429
+	              var bitsCombined = bits1 | bits2;
1430
+	              words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);
1431
+	              nBytes++;
1432
+	          }
1433
+	      }
1434
+	      return WordArray.create(words, nBytes);
1435
+	    }
1436
+	}());
1437
+
1438
+
1439
+	(function () {
1440
+	    // Shortcuts
1441
+	    var C = CryptoJS;
1442
+	    var C_lib = C.lib;
1443
+	    var WordArray = C_lib.WordArray;
1444
+	    var C_enc = C.enc;
1445
+
1446
+	    /**
1447
+	     * Base64url encoding strategy.
1448
+	     */
1449
+	    var Base64url = C_enc.Base64url = {
1450
+	        /**
1451
+	         * Converts a word array to a Base64url string.
1452
+	         *
1453
+	         * @param {WordArray} wordArray The word array.
1454
+	         *
1455
+	         * @param {boolean} urlSafe Whether to use url safe
1456
+	         *
1457
+	         * @return {string} The Base64url string.
1458
+	         *
1459
+	         * @static
1460
+	         *
1461
+	         * @example
1462
+	         *
1463
+	         *     var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
1464
+	         */
1465
+	        stringify: function (wordArray, urlSafe=true) {
1466
+	            // Shortcuts
1467
+	            var words = wordArray.words;
1468
+	            var sigBytes = wordArray.sigBytes;
1469
+	            var map = urlSafe ? this._safe_map : this._map;
1470
+
1471
+	            // Clamp excess bits
1472
+	            wordArray.clamp();
1473
+
1474
+	            // Convert
1475
+	            var base64Chars = [];
1476
+	            for (var i = 0; i < sigBytes; i += 3) {
1477
+	                var byte1 = (words[i >>> 2]       >>> (24 - (i % 4) * 8))       & 0xff;
1478
+	                var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
1479
+	                var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
1480
+
1481
+	                var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
1482
+
1483
+	                for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
1484
+	                    base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
1485
+	                }
1486
+	            }
1487
+
1488
+	            // Add padding
1489
+	            var paddingChar = map.charAt(64);
1490
+	            if (paddingChar) {
1491
+	                while (base64Chars.length % 4) {
1492
+	                    base64Chars.push(paddingChar);
1493
+	                }
1494
+	            }
1495
+
1496
+	            return base64Chars.join('');
1497
+	        },
1498
+
1499
+	        /**
1500
+	         * Converts a Base64url string to a word array.
1501
+	         *
1502
+	         * @param {string} base64Str The Base64url string.
1503
+	         *
1504
+	         * @param {boolean} urlSafe Whether to use url safe
1505
+	         *
1506
+	         * @return {WordArray} The word array.
1507
+	         *
1508
+	         * @static
1509
+	         *
1510
+	         * @example
1511
+	         *
1512
+	         *     var wordArray = CryptoJS.enc.Base64url.parse(base64String);
1513
+	         */
1514
+	        parse: function (base64Str, urlSafe=true) {
1515
+	            // Shortcuts
1516
+	            var base64StrLength = base64Str.length;
1517
+	            var map = urlSafe ? this._safe_map : this._map;
1518
+	            var reverseMap = this._reverseMap;
1519
+
1520
+	            if (!reverseMap) {
1521
+	                reverseMap = this._reverseMap = [];
1522
+	                for (var j = 0; j < map.length; j++) {
1523
+	                    reverseMap[map.charCodeAt(j)] = j;
1524
+	                }
1525
+	            }
1526
+
1527
+	            // Ignore padding
1528
+	            var paddingChar = map.charAt(64);
1529
+	            if (paddingChar) {
1530
+	                var paddingIndex = base64Str.indexOf(paddingChar);
1531
+	                if (paddingIndex !== -1) {
1532
+	                    base64StrLength = paddingIndex;
1533
+	                }
1534
+	            }
1535
+
1536
+	            // Convert
1537
+	            return parseLoop(base64Str, base64StrLength, reverseMap);
1538
+
1539
+	        },
1540
+
1541
+	        _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
1542
+	        _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
1543
+	    };
1544
+
1545
+	    function parseLoop(base64Str, base64StrLength, reverseMap) {
1546
+	        var words = [];
1547
+	        var nBytes = 0;
1548
+	        for (var i = 0; i < base64StrLength; i++) {
1549
+	            if (i % 4) {
1550
+	                var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
1551
+	                var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
1552
+	                var bitsCombined = bits1 | bits2;
1553
+	                words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);
1554
+	                nBytes++;
1555
+	            }
1556
+	        }
1557
+	        return WordArray.create(words, nBytes);
1558
+	    }
1559
+	}());
1560
+
1561
+	(function (Math) {
1562
+	    // Shortcuts
1563
+	    var C = CryptoJS;
1564
+	    var C_lib = C.lib;
1565
+	    var WordArray = C_lib.WordArray;
1566
+	    var Hasher = C_lib.Hasher;
1567
+	    var C_algo = C.algo;
1568
+
1569
+	    // Constants table
1570
+	    var T = [];
1571
+
1572
+	    // Compute constants
1573
+	    (function () {
1574
+	        for (var i = 0; i < 64; i++) {
1575
+	            T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
1576
+	        }
1577
+	    }());
1578
+
1579
+	    /**
1580
+	     * MD5 hash algorithm.
1581
+	     */
1582
+	    var MD5 = C_algo.MD5 = Hasher.extend({
1583
+	        _doReset: function () {
1584
+	            this._hash = new WordArray.init([
1585
+	                0x67452301, 0xefcdab89,
1586
+	                0x98badcfe, 0x10325476
1587
+	            ]);
1588
+	        },
1589
+
1590
+	        _doProcessBlock: function (M, offset) {
1591
+	            // Swap endian
1592
+	            for (var i = 0; i < 16; i++) {
1593
+	                // Shortcuts
1594
+	                var offset_i = offset + i;
1595
+	                var M_offset_i = M[offset_i];
1596
+
1597
+	                M[offset_i] = (
1598
+	                    (((M_offset_i << 8)  | (M_offset_i >>> 24)) & 0x00ff00ff) |
1599
+	                    (((M_offset_i << 24) | (M_offset_i >>> 8))  & 0xff00ff00)
1600
+	                );
1601
+	            }
1602
+
1603
+	            // Shortcuts
1604
+	            var H = this._hash.words;
1605
+
1606
+	            var M_offset_0  = M[offset + 0];
1607
+	            var M_offset_1  = M[offset + 1];
1608
+	            var M_offset_2  = M[offset + 2];
1609
+	            var M_offset_3  = M[offset + 3];
1610
+	            var M_offset_4  = M[offset + 4];
1611
+	            var M_offset_5  = M[offset + 5];
1612
+	            var M_offset_6  = M[offset + 6];
1613
+	            var M_offset_7  = M[offset + 7];
1614
+	            var M_offset_8  = M[offset + 8];
1615
+	            var M_offset_9  = M[offset + 9];
1616
+	            var M_offset_10 = M[offset + 10];
1617
+	            var M_offset_11 = M[offset + 11];
1618
+	            var M_offset_12 = M[offset + 12];
1619
+	            var M_offset_13 = M[offset + 13];
1620
+	            var M_offset_14 = M[offset + 14];
1621
+	            var M_offset_15 = M[offset + 15];
1622
+
1623
+	            // Working varialbes
1624
+	            var a = H[0];
1625
+	            var b = H[1];
1626
+	            var c = H[2];
1627
+	            var d = H[3];
1628
+
1629
+	            // Computation
1630
+	            a = FF(a, b, c, d, M_offset_0,  7,  T[0]);
1631
+	            d = FF(d, a, b, c, M_offset_1,  12, T[1]);
1632
+	            c = FF(c, d, a, b, M_offset_2,  17, T[2]);
1633
+	            b = FF(b, c, d, a, M_offset_3,  22, T[3]);
1634
+	            a = FF(a, b, c, d, M_offset_4,  7,  T[4]);
1635
+	            d = FF(d, a, b, c, M_offset_5,  12, T[5]);
1636
+	            c = FF(c, d, a, b, M_offset_6,  17, T[6]);
1637
+	            b = FF(b, c, d, a, M_offset_7,  22, T[7]);
1638
+	            a = FF(a, b, c, d, M_offset_8,  7,  T[8]);
1639
+	            d = FF(d, a, b, c, M_offset_9,  12, T[9]);
1640
+	            c = FF(c, d, a, b, M_offset_10, 17, T[10]);
1641
+	            b = FF(b, c, d, a, M_offset_11, 22, T[11]);
1642
+	            a = FF(a, b, c, d, M_offset_12, 7,  T[12]);
1643
+	            d = FF(d, a, b, c, M_offset_13, 12, T[13]);
1644
+	            c = FF(c, d, a, b, M_offset_14, 17, T[14]);
1645
+	            b = FF(b, c, d, a, M_offset_15, 22, T[15]);
1646
+
1647
+	            a = GG(a, b, c, d, M_offset_1,  5,  T[16]);
1648
+	            d = GG(d, a, b, c, M_offset_6,  9,  T[17]);
1649
+	            c = GG(c, d, a, b, M_offset_11, 14, T[18]);
1650
+	            b = GG(b, c, d, a, M_offset_0,  20, T[19]);
1651
+	            a = GG(a, b, c, d, M_offset_5,  5,  T[20]);
1652
+	            d = GG(d, a, b, c, M_offset_10, 9,  T[21]);
1653
+	            c = GG(c, d, a, b, M_offset_15, 14, T[22]);
1654
+	            b = GG(b, c, d, a, M_offset_4,  20, T[23]);
1655
+	            a = GG(a, b, c, d, M_offset_9,  5,  T[24]);
1656
+	            d = GG(d, a, b, c, M_offset_14, 9,  T[25]);
1657
+	            c = GG(c, d, a, b, M_offset_3,  14, T[26]);
1658
+	            b = GG(b, c, d, a, M_offset_8,  20, T[27]);
1659
+	            a = GG(a, b, c, d, M_offset_13, 5,  T[28]);
1660
+	            d = GG(d, a, b, c, M_offset_2,  9,  T[29]);
1661
+	            c = GG(c, d, a, b, M_offset_7,  14, T[30]);
1662
+	            b = GG(b, c, d, a, M_offset_12, 20, T[31]);
1663
+
1664
+	            a = HH(a, b, c, d, M_offset_5,  4,  T[32]);
1665
+	            d = HH(d, a, b, c, M_offset_8,  11, T[33]);
1666
+	            c = HH(c, d, a, b, M_offset_11, 16, T[34]);
1667
+	            b = HH(b, c, d, a, M_offset_14, 23, T[35]);
1668
+	            a = HH(a, b, c, d, M_offset_1,  4,  T[36]);
1669
+	            d = HH(d, a, b, c, M_offset_4,  11, T[37]);
1670
+	            c = HH(c, d, a, b, M_offset_7,  16, T[38]);
1671
+	            b = HH(b, c, d, a, M_offset_10, 23, T[39]);
1672
+	            a = HH(a, b, c, d, M_offset_13, 4,  T[40]);
1673
+	            d = HH(d, a, b, c, M_offset_0,  11, T[41]);
1674
+	            c = HH(c, d, a, b, M_offset_3,  16, T[42]);
1675
+	            b = HH(b, c, d, a, M_offset_6,  23, T[43]);
1676
+	            a = HH(a, b, c, d, M_offset_9,  4,  T[44]);
1677
+	            d = HH(d, a, b, c, M_offset_12, 11, T[45]);
1678
+	            c = HH(c, d, a, b, M_offset_15, 16, T[46]);
1679
+	            b = HH(b, c, d, a, M_offset_2,  23, T[47]);
1680
+
1681
+	            a = II(a, b, c, d, M_offset_0,  6,  T[48]);
1682
+	            d = II(d, a, b, c, M_offset_7,  10, T[49]);
1683
+	            c = II(c, d, a, b, M_offset_14, 15, T[50]);
1684
+	            b = II(b, c, d, a, M_offset_5,  21, T[51]);
1685
+	            a = II(a, b, c, d, M_offset_12, 6,  T[52]);
1686
+	            d = II(d, a, b, c, M_offset_3,  10, T[53]);
1687
+	            c = II(c, d, a, b, M_offset_10, 15, T[54]);
1688
+	            b = II(b, c, d, a, M_offset_1,  21, T[55]);
1689
+	            a = II(a, b, c, d, M_offset_8,  6,  T[56]);
1690
+	            d = II(d, a, b, c, M_offset_15, 10, T[57]);
1691
+	            c = II(c, d, a, b, M_offset_6,  15, T[58]);
1692
+	            b = II(b, c, d, a, M_offset_13, 21, T[59]);
1693
+	            a = II(a, b, c, d, M_offset_4,  6,  T[60]);
1694
+	            d = II(d, a, b, c, M_offset_11, 10, T[61]);
1695
+	            c = II(c, d, a, b, M_offset_2,  15, T[62]);
1696
+	            b = II(b, c, d, a, M_offset_9,  21, T[63]);
1697
+
1698
+	            // Intermediate hash value
1699
+	            H[0] = (H[0] + a) | 0;
1700
+	            H[1] = (H[1] + b) | 0;
1701
+	            H[2] = (H[2] + c) | 0;
1702
+	            H[3] = (H[3] + d) | 0;
1703
+	        },
1704
+
1705
+	        _doFinalize: function () {
1706
+	            // Shortcuts
1707
+	            var data = this._data;
1708
+	            var dataWords = data.words;
1709
+
1710
+	            var nBitsTotal = this._nDataBytes * 8;
1711
+	            var nBitsLeft = data.sigBytes * 8;
1712
+
1713
+	            // Add padding
1714
+	            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
1715
+
1716
+	            var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
1717
+	            var nBitsTotalL = nBitsTotal;
1718
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
1719
+	                (((nBitsTotalH << 8)  | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
1720
+	                (((nBitsTotalH << 24) | (nBitsTotalH >>> 8))  & 0xff00ff00)
1721
+	            );
1722
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
1723
+	                (((nBitsTotalL << 8)  | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
1724
+	                (((nBitsTotalL << 24) | (nBitsTotalL >>> 8))  & 0xff00ff00)
1725
+	            );
1726
+
1727
+	            data.sigBytes = (dataWords.length + 1) * 4;
1728
+
1729
+	            // Hash final blocks
1730
+	            this._process();
1731
+
1732
+	            // Shortcuts
1733
+	            var hash = this._hash;
1734
+	            var H = hash.words;
1735
+
1736
+	            // Swap endian
1737
+	            for (var i = 0; i < 4; i++) {
1738
+	                // Shortcut
1739
+	                var H_i = H[i];
1740
+
1741
+	                H[i] = (((H_i << 8)  | (H_i >>> 24)) & 0x00ff00ff) |
1742
+	                       (((H_i << 24) | (H_i >>> 8))  & 0xff00ff00);
1743
+	            }
1744
+
1745
+	            // Return final computed hash
1746
+	            return hash;
1747
+	        },
1748
+
1749
+	        clone: function () {
1750
+	            var clone = Hasher.clone.call(this);
1751
+	            clone._hash = this._hash.clone();
1752
+
1753
+	            return clone;
1754
+	        }
1755
+	    });
1756
+
1757
+	    function FF(a, b, c, d, x, s, t) {
1758
+	        var n = a + ((b & c) | (~b & d)) + x + t;
1759
+	        return ((n << s) | (n >>> (32 - s))) + b;
1760
+	    }
1761
+
1762
+	    function GG(a, b, c, d, x, s, t) {
1763
+	        var n = a + ((b & d) | (c & ~d)) + x + t;
1764
+	        return ((n << s) | (n >>> (32 - s))) + b;
1765
+	    }
1766
+
1767
+	    function HH(a, b, c, d, x, s, t) {
1768
+	        var n = a + (b ^ c ^ d) + x + t;
1769
+	        return ((n << s) | (n >>> (32 - s))) + b;
1770
+	    }
1771
+
1772
+	    function II(a, b, c, d, x, s, t) {
1773
+	        var n = a + (c ^ (b | ~d)) + x + t;
1774
+	        return ((n << s) | (n >>> (32 - s))) + b;
1775
+	    }
1776
+
1777
+	    /**
1778
+	     * Shortcut function to the hasher's object interface.
1779
+	     *
1780
+	     * @param {WordArray|string} message The message to hash.
1781
+	     *
1782
+	     * @return {WordArray} The hash.
1783
+	     *
1784
+	     * @static
1785
+	     *
1786
+	     * @example
1787
+	     *
1788
+	     *     var hash = CryptoJS.MD5('message');
1789
+	     *     var hash = CryptoJS.MD5(wordArray);
1790
+	     */
1791
+	    C.MD5 = Hasher._createHelper(MD5);
1792
+
1793
+	    /**
1794
+	     * Shortcut function to the HMAC's object interface.
1795
+	     *
1796
+	     * @param {WordArray|string} message The message to hash.
1797
+	     * @param {WordArray|string} key The secret key.
1798
+	     *
1799
+	     * @return {WordArray} The HMAC.
1800
+	     *
1801
+	     * @static
1802
+	     *
1803
+	     * @example
1804
+	     *
1805
+	     *     var hmac = CryptoJS.HmacMD5(message, key);
1806
+	     */
1807
+	    C.HmacMD5 = Hasher._createHmacHelper(MD5);
1808
+	}(Math));
1809
+
1810
+
1811
+	(function () {
1812
+	    // Shortcuts
1813
+	    var C = CryptoJS;
1814
+	    var C_lib = C.lib;
1815
+	    var WordArray = C_lib.WordArray;
1816
+	    var Hasher = C_lib.Hasher;
1817
+	    var C_algo = C.algo;
1818
+
1819
+	    // Reusable object
1820
+	    var W = [];
1821
+
1822
+	    /**
1823
+	     * SHA-1 hash algorithm.
1824
+	     */
1825
+	    var SHA1 = C_algo.SHA1 = Hasher.extend({
1826
+	        _doReset: function () {
1827
+	            this._hash = new WordArray.init([
1828
+	                0x67452301, 0xefcdab89,
1829
+	                0x98badcfe, 0x10325476,
1830
+	                0xc3d2e1f0
1831
+	            ]);
1832
+	        },
1833
+
1834
+	        _doProcessBlock: function (M, offset) {
1835
+	            // Shortcut
1836
+	            var H = this._hash.words;
1837
+
1838
+	            // Working variables
1839
+	            var a = H[0];
1840
+	            var b = H[1];
1841
+	            var c = H[2];
1842
+	            var d = H[3];
1843
+	            var e = H[4];
1844
+
1845
+	            // Computation
1846
+	            for (var i = 0; i < 80; i++) {
1847
+	                if (i < 16) {
1848
+	                    W[i] = M[offset + i] | 0;
1849
+	                } else {
1850
+	                    var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
1851
+	                    W[i] = (n << 1) | (n >>> 31);
1852
+	                }
1853
+
1854
+	                var t = ((a << 5) | (a >>> 27)) + e + W[i];
1855
+	                if (i < 20) {
1856
+	                    t += ((b & c) | (~b & d)) + 0x5a827999;
1857
+	                } else if (i < 40) {
1858
+	                    t += (b ^ c ^ d) + 0x6ed9eba1;
1859
+	                } else if (i < 60) {
1860
+	                    t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
1861
+	                } else /* if (i < 80) */ {
1862
+	                    t += (b ^ c ^ d) - 0x359d3e2a;
1863
+	                }
1864
+
1865
+	                e = d;
1866
+	                d = c;
1867
+	                c = (b << 30) | (b >>> 2);
1868
+	                b = a;
1869
+	                a = t;
1870
+	            }
1871
+
1872
+	            // Intermediate hash value
1873
+	            H[0] = (H[0] + a) | 0;
1874
+	            H[1] = (H[1] + b) | 0;
1875
+	            H[2] = (H[2] + c) | 0;
1876
+	            H[3] = (H[3] + d) | 0;
1877
+	            H[4] = (H[4] + e) | 0;
1878
+	        },
1879
+
1880
+	        _doFinalize: function () {
1881
+	            // Shortcuts
1882
+	            var data = this._data;
1883
+	            var dataWords = data.words;
1884
+
1885
+	            var nBitsTotal = this._nDataBytes * 8;
1886
+	            var nBitsLeft = data.sigBytes * 8;
1887
+
1888
+	            // Add padding
1889
+	            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
1890
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
1891
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
1892
+	            data.sigBytes = dataWords.length * 4;
1893
+
1894
+	            // Hash final blocks
1895
+	            this._process();
1896
+
1897
+	            // Return final computed hash
1898
+	            return this._hash;
1899
+	        },
1900
+
1901
+	        clone: function () {
1902
+	            var clone = Hasher.clone.call(this);
1903
+	            clone._hash = this._hash.clone();
1904
+
1905
+	            return clone;
1906
+	        }
1907
+	    });
1908
+
1909
+	    /**
1910
+	     * Shortcut function to the hasher's object interface.
1911
+	     *
1912
+	     * @param {WordArray|string} message The message to hash.
1913
+	     *
1914
+	     * @return {WordArray} The hash.
1915
+	     *
1916
+	     * @static
1917
+	     *
1918
+	     * @example
1919
+	     *
1920
+	     *     var hash = CryptoJS.SHA1('message');
1921
+	     *     var hash = CryptoJS.SHA1(wordArray);
1922
+	     */
1923
+	    C.SHA1 = Hasher._createHelper(SHA1);
1924
+
1925
+	    /**
1926
+	     * Shortcut function to the HMAC's object interface.
1927
+	     *
1928
+	     * @param {WordArray|string} message The message to hash.
1929
+	     * @param {WordArray|string} key The secret key.
1930
+	     *
1931
+	     * @return {WordArray} The HMAC.
1932
+	     *
1933
+	     * @static
1934
+	     *
1935
+	     * @example
1936
+	     *
1937
+	     *     var hmac = CryptoJS.HmacSHA1(message, key);
1938
+	     */
1939
+	    C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
1940
+	}());
1941
+
1942
+
1943
+	(function (Math) {
1944
+	    // Shortcuts
1945
+	    var C = CryptoJS;
1946
+	    var C_lib = C.lib;
1947
+	    var WordArray = C_lib.WordArray;
1948
+	    var Hasher = C_lib.Hasher;
1949
+	    var C_algo = C.algo;
1950
+
1951
+	    // Initialization and round constants tables
1952
+	    var H = [];
1953
+	    var K = [];
1954
+
1955
+	    // Compute constants
1956
+	    (function () {
1957
+	        function isPrime(n) {
1958
+	            var sqrtN = Math.sqrt(n);
1959
+	            for (var factor = 2; factor <= sqrtN; factor++) {
1960
+	                if (!(n % factor)) {
1961
+	                    return false;
1962
+	                }
1963
+	            }
1964
+
1965
+	            return true;
1966
+	        }
1967
+
1968
+	        function getFractionalBits(n) {
1969
+	            return ((n - (n | 0)) * 0x100000000) | 0;
1970
+	        }
1971
+
1972
+	        var n = 2;
1973
+	        var nPrime = 0;
1974
+	        while (nPrime < 64) {
1975
+	            if (isPrime(n)) {
1976
+	                if (nPrime < 8) {
1977
+	                    H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
1978
+	                }
1979
+	                K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
1980
+
1981
+	                nPrime++;
1982
+	            }
1983
+
1984
+	            n++;
1985
+	        }
1986
+	    }());
1987
+
1988
+	    // Reusable object
1989
+	    var W = [];
1990
+
1991
+	    /**
1992
+	     * SHA-256 hash algorithm.
1993
+	     */
1994
+	    var SHA256 = C_algo.SHA256 = Hasher.extend({
1995
+	        _doReset: function () {
1996
+	            this._hash = new WordArray.init(H.slice(0));
1997
+	        },
1998
+
1999
+	        _doProcessBlock: function (M, offset) {
2000
+	            // Shortcut
2001
+	            var H = this._hash.words;
2002
+
2003
+	            // Working variables
2004
+	            var a = H[0];
2005
+	            var b = H[1];
2006
+	            var c = H[2];
2007
+	            var d = H[3];
2008
+	            var e = H[4];
2009
+	            var f = H[5];
2010
+	            var g = H[6];
2011
+	            var h = H[7];
2012
+
2013
+	            // Computation
2014
+	            for (var i = 0; i < 64; i++) {
2015
+	                if (i < 16) {
2016
+	                    W[i] = M[offset + i] | 0;
2017
+	                } else {
2018
+	                    var gamma0x = W[i - 15];
2019
+	                    var gamma0  = ((gamma0x << 25) | (gamma0x >>> 7))  ^
2020
+	                                  ((gamma0x << 14) | (gamma0x >>> 18)) ^
2021
+	                                   (gamma0x >>> 3);
2022
+
2023
+	                    var gamma1x = W[i - 2];
2024
+	                    var gamma1  = ((gamma1x << 15) | (gamma1x >>> 17)) ^
2025
+	                                  ((gamma1x << 13) | (gamma1x >>> 19)) ^
2026
+	                                   (gamma1x >>> 10);
2027
+
2028
+	                    W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
2029
+	                }
2030
+
2031
+	                var ch  = (e & f) ^ (~e & g);
2032
+	                var maj = (a & b) ^ (a & c) ^ (b & c);
2033
+
2034
+	                var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
2035
+	                var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7)  | (e >>> 25));
2036
+
2037
+	                var t1 = h + sigma1 + ch + K[i] + W[i];
2038
+	                var t2 = sigma0 + maj;
2039
+
2040
+	                h = g;
2041
+	                g = f;
2042
+	                f = e;
2043
+	                e = (d + t1) | 0;
2044
+	                d = c;
2045
+	                c = b;
2046
+	                b = a;
2047
+	                a = (t1 + t2) | 0;
2048
+	            }
2049
+
2050
+	            // Intermediate hash value
2051
+	            H[0] = (H[0] + a) | 0;
2052
+	            H[1] = (H[1] + b) | 0;
2053
+	            H[2] = (H[2] + c) | 0;
2054
+	            H[3] = (H[3] + d) | 0;
2055
+	            H[4] = (H[4] + e) | 0;
2056
+	            H[5] = (H[5] + f) | 0;
2057
+	            H[6] = (H[6] + g) | 0;
2058
+	            H[7] = (H[7] + h) | 0;
2059
+	        },
2060
+
2061
+	        _doFinalize: function () {
2062
+	            // Shortcuts
2063
+	            var data = this._data;
2064
+	            var dataWords = data.words;
2065
+
2066
+	            var nBitsTotal = this._nDataBytes * 8;
2067
+	            var nBitsLeft = data.sigBytes * 8;
2068
+
2069
+	            // Add padding
2070
+	            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
2071
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
2072
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
2073
+	            data.sigBytes = dataWords.length * 4;
2074
+
2075
+	            // Hash final blocks
2076
+	            this._process();
2077
+
2078
+	            // Return final computed hash
2079
+	            return this._hash;
2080
+	        },
2081
+
2082
+	        clone: function () {
2083
+	            var clone = Hasher.clone.call(this);
2084
+	            clone._hash = this._hash.clone();
2085
+
2086
+	            return clone;
2087
+	        }
2088
+	    });
2089
+
2090
+	    /**
2091
+	     * Shortcut function to the hasher's object interface.
2092
+	     *
2093
+	     * @param {WordArray|string} message The message to hash.
2094
+	     *
2095
+	     * @return {WordArray} The hash.
2096
+	     *
2097
+	     * @static
2098
+	     *
2099
+	     * @example
2100
+	     *
2101
+	     *     var hash = CryptoJS.SHA256('message');
2102
+	     *     var hash = CryptoJS.SHA256(wordArray);
2103
+	     */
2104
+	    C.SHA256 = Hasher._createHelper(SHA256);
2105
+
2106
+	    /**
2107
+	     * Shortcut function to the HMAC's object interface.
2108
+	     *
2109
+	     * @param {WordArray|string} message The message to hash.
2110
+	     * @param {WordArray|string} key The secret key.
2111
+	     *
2112
+	     * @return {WordArray} The HMAC.
2113
+	     *
2114
+	     * @static
2115
+	     *
2116
+	     * @example
2117
+	     *
2118
+	     *     var hmac = CryptoJS.HmacSHA256(message, key);
2119
+	     */
2120
+	    C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
2121
+	}(Math));
2122
+
2123
+
2124
+	(function () {
2125
+	    // Shortcuts
2126
+	    var C = CryptoJS;
2127
+	    var C_lib = C.lib;
2128
+	    var WordArray = C_lib.WordArray;
2129
+	    var C_algo = C.algo;
2130
+	    var SHA256 = C_algo.SHA256;
2131
+
2132
+	    /**
2133
+	     * SHA-224 hash algorithm.
2134
+	     */
2135
+	    var SHA224 = C_algo.SHA224 = SHA256.extend({
2136
+	        _doReset: function () {
2137
+	            this._hash = new WordArray.init([
2138
+	                0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
2139
+	                0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
2140
+	            ]);
2141
+	        },
2142
+
2143
+	        _doFinalize: function () {
2144
+	            var hash = SHA256._doFinalize.call(this);
2145
+
2146
+	            hash.sigBytes -= 4;
2147
+
2148
+	            return hash;
2149
+	        }
2150
+	    });
2151
+
2152
+	    /**
2153
+	     * Shortcut function to the hasher's object interface.
2154
+	     *
2155
+	     * @param {WordArray|string} message The message to hash.
2156
+	     *
2157
+	     * @return {WordArray} The hash.
2158
+	     *
2159
+	     * @static
2160
+	     *
2161
+	     * @example
2162
+	     *
2163
+	     *     var hash = CryptoJS.SHA224('message');
2164
+	     *     var hash = CryptoJS.SHA224(wordArray);
2165
+	     */
2166
+	    C.SHA224 = SHA256._createHelper(SHA224);
2167
+
2168
+	    /**
2169
+	     * Shortcut function to the HMAC's object interface.
2170
+	     *
2171
+	     * @param {WordArray|string} message The message to hash.
2172
+	     * @param {WordArray|string} key The secret key.
2173
+	     *
2174
+	     * @return {WordArray} The HMAC.
2175
+	     *
2176
+	     * @static
2177
+	     *
2178
+	     * @example
2179
+	     *
2180
+	     *     var hmac = CryptoJS.HmacSHA224(message, key);
2181
+	     */
2182
+	    C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
2183
+	}());
2184
+
2185
+
2186
+	(function () {
2187
+	    // Shortcuts
2188
+	    var C = CryptoJS;
2189
+	    var C_lib = C.lib;
2190
+	    var Hasher = C_lib.Hasher;
2191
+	    var C_x64 = C.x64;
2192
+	    var X64Word = C_x64.Word;
2193
+	    var X64WordArray = C_x64.WordArray;
2194
+	    var C_algo = C.algo;
2195
+
2196
+	    function X64Word_create() {
2197
+	        return X64Word.create.apply(X64Word, arguments);
2198
+	    }
2199
+
2200
+	    // Constants
2201
+	    var K = [
2202
+	        X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
2203
+	        X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
2204
+	        X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
2205
+	        X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
2206
+	        X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
2207
+	        X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
2208
+	        X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
2209
+	        X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
2210
+	        X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
2211
+	        X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
2212
+	        X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
2213
+	        X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
2214
+	        X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
2215
+	        X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
2216
+	        X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
2217
+	        X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
2218
+	        X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
2219
+	        X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
2220
+	        X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
2221
+	        X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
2222
+	        X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
2223
+	        X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
2224
+	        X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
2225
+	        X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
2226
+	        X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
2227
+	        X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
2228
+	        X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
2229
+	        X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
2230
+	        X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
2231
+	        X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
2232
+	        X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
2233
+	        X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
2234
+	        X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
2235
+	        X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
2236
+	        X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
2237
+	        X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
2238
+	        X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
2239
+	        X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
2240
+	        X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
2241
+	        X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
2242
+	    ];
2243
+
2244
+	    // Reusable objects
2245
+	    var W = [];
2246
+	    (function () {
2247
+	        for (var i = 0; i < 80; i++) {
2248
+	            W[i] = X64Word_create();
2249
+	        }
2250
+	    }());
2251
+
2252
+	    /**
2253
+	     * SHA-512 hash algorithm.
2254
+	     */
2255
+	    var SHA512 = C_algo.SHA512 = Hasher.extend({
2256
+	        _doReset: function () {
2257
+	            this._hash = new X64WordArray.init([
2258
+	                new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
2259
+	                new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
2260
+	                new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
2261
+	                new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
2262
+	            ]);
2263
+	        },
2264
+
2265
+	        _doProcessBlock: function (M, offset) {
2266
+	            // Shortcuts
2267
+	            var H = this._hash.words;
2268
+
2269
+	            var H0 = H[0];
2270
+	            var H1 = H[1];
2271
+	            var H2 = H[2];
2272
+	            var H3 = H[3];
2273
+	            var H4 = H[4];
2274
+	            var H5 = H[5];
2275
+	            var H6 = H[6];
2276
+	            var H7 = H[7];
2277
+
2278
+	            var H0h = H0.high;
2279
+	            var H0l = H0.low;
2280
+	            var H1h = H1.high;
2281
+	            var H1l = H1.low;
2282
+	            var H2h = H2.high;
2283
+	            var H2l = H2.low;
2284
+	            var H3h = H3.high;
2285
+	            var H3l = H3.low;
2286
+	            var H4h = H4.high;
2287
+	            var H4l = H4.low;
2288
+	            var H5h = H5.high;
2289
+	            var H5l = H5.low;
2290
+	            var H6h = H6.high;
2291
+	            var H6l = H6.low;
2292
+	            var H7h = H7.high;
2293
+	            var H7l = H7.low;
2294
+
2295
+	            // Working variables
2296
+	            var ah = H0h;
2297
+	            var al = H0l;
2298
+	            var bh = H1h;
2299
+	            var bl = H1l;
2300
+	            var ch = H2h;
2301
+	            var cl = H2l;
2302
+	            var dh = H3h;
2303
+	            var dl = H3l;
2304
+	            var eh = H4h;
2305
+	            var el = H4l;
2306
+	            var fh = H5h;
2307
+	            var fl = H5l;
2308
+	            var gh = H6h;
2309
+	            var gl = H6l;
2310
+	            var hh = H7h;
2311
+	            var hl = H7l;
2312
+
2313
+	            // Rounds
2314
+	            for (var i = 0; i < 80; i++) {
2315
+	                var Wil;
2316
+	                var Wih;
2317
+
2318
+	                // Shortcut
2319
+	                var Wi = W[i];
2320
+
2321
+	                // Extend message
2322
+	                if (i < 16) {
2323
+	                    Wih = Wi.high = M[offset + i * 2]     | 0;
2324
+	                    Wil = Wi.low  = M[offset + i * 2 + 1] | 0;
2325
+	                } else {
2326
+	                    // Gamma0
2327
+	                    var gamma0x  = W[i - 15];
2328
+	                    var gamma0xh = gamma0x.high;
2329
+	                    var gamma0xl = gamma0x.low;
2330
+	                    var gamma0h  = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
2331
+	                    var gamma0l  = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
2332
+
2333
+	                    // Gamma1
2334
+	                    var gamma1x  = W[i - 2];
2335
+	                    var gamma1xh = gamma1x.high;
2336
+	                    var gamma1xl = gamma1x.low;
2337
+	                    var gamma1h  = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
2338
+	                    var gamma1l  = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
2339
+
2340
+	                    // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
2341
+	                    var Wi7  = W[i - 7];
2342
+	                    var Wi7h = Wi7.high;
2343
+	                    var Wi7l = Wi7.low;
2344
+
2345
+	                    var Wi16  = W[i - 16];
2346
+	                    var Wi16h = Wi16.high;
2347
+	                    var Wi16l = Wi16.low;
2348
+
2349
+	                    Wil = gamma0l + Wi7l;
2350
+	                    Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
2351
+	                    Wil = Wil + gamma1l;
2352
+	                    Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
2353
+	                    Wil = Wil + Wi16l;
2354
+	                    Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
2355
+
2356
+	                    Wi.high = Wih;
2357
+	                    Wi.low  = Wil;
2358
+	                }
2359
+
2360
+	                var chh  = (eh & fh) ^ (~eh & gh);
2361
+	                var chl  = (el & fl) ^ (~el & gl);
2362
+	                var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
2363
+	                var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
2364
+
2365
+	                var sigma0h = ((ah >>> 28) | (al << 4))  ^ ((ah << 30)  | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
2366
+	                var sigma0l = ((al >>> 28) | (ah << 4))  ^ ((al << 30)  | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
2367
+	                var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
2368
+	                var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
2369
+
2370
+	                // t1 = h + sigma1 + ch + K[i] + W[i]
2371
+	                var Ki  = K[i];
2372
+	                var Kih = Ki.high;
2373
+	                var Kil = Ki.low;
2374
+
2375
+	                var t1l = hl + sigma1l;
2376
+	                var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
2377
+	                var t1l = t1l + chl;
2378
+	                var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
2379
+	                var t1l = t1l + Kil;
2380
+	                var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
2381
+	                var t1l = t1l + Wil;
2382
+	                var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
2383
+
2384
+	                // t2 = sigma0 + maj
2385
+	                var t2l = sigma0l + majl;
2386
+	                var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
2387
+
2388
+	                // Update working variables
2389
+	                hh = gh;
2390
+	                hl = gl;
2391
+	                gh = fh;
2392
+	                gl = fl;
2393
+	                fh = eh;
2394
+	                fl = el;
2395
+	                el = (dl + t1l) | 0;
2396
+	                eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
2397
+	                dh = ch;
2398
+	                dl = cl;
2399
+	                ch = bh;
2400
+	                cl = bl;
2401
+	                bh = ah;
2402
+	                bl = al;
2403
+	                al = (t1l + t2l) | 0;
2404
+	                ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
2405
+	            }
2406
+
2407
+	            // Intermediate hash value
2408
+	            H0l = H0.low  = (H0l + al);
2409
+	            H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
2410
+	            H1l = H1.low  = (H1l + bl);
2411
+	            H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
2412
+	            H2l = H2.low  = (H2l + cl);
2413
+	            H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
2414
+	            H3l = H3.low  = (H3l + dl);
2415
+	            H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
2416
+	            H4l = H4.low  = (H4l + el);
2417
+	            H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
2418
+	            H5l = H5.low  = (H5l + fl);
2419
+	            H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
2420
+	            H6l = H6.low  = (H6l + gl);
2421
+	            H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
2422
+	            H7l = H7.low  = (H7l + hl);
2423
+	            H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
2424
+	        },
2425
+
2426
+	        _doFinalize: function () {
2427
+	            // Shortcuts
2428
+	            var data = this._data;
2429
+	            var dataWords = data.words;
2430
+
2431
+	            var nBitsTotal = this._nDataBytes * 8;
2432
+	            var nBitsLeft = data.sigBytes * 8;
2433
+
2434
+	            // Add padding
2435
+	            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
2436
+	            dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
2437
+	            dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
2438
+	            data.sigBytes = dataWords.length * 4;
2439
+
2440
+	            // Hash final blocks
2441
+	            this._process();
2442
+
2443
+	            // Convert hash to 32-bit word array before returning
2444
+	            var hash = this._hash.toX32();
2445
+
2446
+	            // Return final computed hash
2447
+	            return hash;
2448
+	        },
2449
+
2450
+	        clone: function () {
2451
+	            var clone = Hasher.clone.call(this);
2452
+	            clone._hash = this._hash.clone();
2453
+
2454
+	            return clone;
2455
+	        },
2456
+
2457
+	        blockSize: 1024/32
2458
+	    });
2459
+
2460
+	    /**
2461
+	     * Shortcut function to the hasher's object interface.
2462
+	     *
2463
+	     * @param {WordArray|string} message The message to hash.
2464
+	     *
2465
+	     * @return {WordArray} The hash.
2466
+	     *
2467
+	     * @static
2468
+	     *
2469
+	     * @example
2470
+	     *
2471
+	     *     var hash = CryptoJS.SHA512('message');
2472
+	     *     var hash = CryptoJS.SHA512(wordArray);
2473
+	     */
2474
+	    C.SHA512 = Hasher._createHelper(SHA512);
2475
+
2476
+	    /**
2477
+	     * Shortcut function to the HMAC's object interface.
2478
+	     *
2479
+	     * @param {WordArray|string} message The message to hash.
2480
+	     * @param {WordArray|string} key The secret key.
2481
+	     *
2482
+	     * @return {WordArray} The HMAC.
2483
+	     *
2484
+	     * @static
2485
+	     *
2486
+	     * @example
2487
+	     *
2488
+	     *     var hmac = CryptoJS.HmacSHA512(message, key);
2489
+	     */
2490
+	    C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
2491
+	}());
2492
+
2493
+
2494
+	(function () {
2495
+	    // Shortcuts
2496
+	    var C = CryptoJS;
2497
+	    var C_x64 = C.x64;
2498
+	    var X64Word = C_x64.Word;
2499
+	    var X64WordArray = C_x64.WordArray;
2500
+	    var C_algo = C.algo;
2501
+	    var SHA512 = C_algo.SHA512;
2502
+
2503
+	    /**
2504
+	     * SHA-384 hash algorithm.
2505
+	     */
2506
+	    var SHA384 = C_algo.SHA384 = SHA512.extend({
2507
+	        _doReset: function () {
2508
+	            this._hash = new X64WordArray.init([
2509
+	                new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
2510
+	                new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
2511
+	                new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
2512
+	                new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
2513
+	            ]);
2514
+	        },
2515
+
2516
+	        _doFinalize: function () {
2517
+	            var hash = SHA512._doFinalize.call(this);
2518
+
2519
+	            hash.sigBytes -= 16;
2520
+
2521
+	            return hash;
2522
+	        }
2523
+	    });
2524
+
2525
+	    /**
2526
+	     * Shortcut function to the hasher's object interface.
2527
+	     *
2528
+	     * @param {WordArray|string} message The message to hash.
2529
+	     *
2530
+	     * @return {WordArray} The hash.
2531
+	     *
2532
+	     * @static
2533
+	     *
2534
+	     * @example
2535
+	     *
2536
+	     *     var hash = CryptoJS.SHA384('message');
2537
+	     *     var hash = CryptoJS.SHA384(wordArray);
2538
+	     */
2539
+	    C.SHA384 = SHA512._createHelper(SHA384);
2540
+
2541
+	    /**
2542
+	     * Shortcut function to the HMAC's object interface.
2543
+	     *
2544
+	     * @param {WordArray|string} message The message to hash.
2545
+	     * @param {WordArray|string} key The secret key.
2546
+	     *
2547
+	     * @return {WordArray} The HMAC.
2548
+	     *
2549
+	     * @static
2550
+	     *
2551
+	     * @example
2552
+	     *
2553
+	     *     var hmac = CryptoJS.HmacSHA384(message, key);
2554
+	     */
2555
+	    C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
2556
+	}());
2557
+
2558
+
2559
+	(function (Math) {
2560
+	    // Shortcuts
2561
+	    var C = CryptoJS;
2562
+	    var C_lib = C.lib;
2563
+	    var WordArray = C_lib.WordArray;
2564
+	    var Hasher = C_lib.Hasher;
2565
+	    var C_x64 = C.x64;
2566
+	    var X64Word = C_x64.Word;
2567
+	    var C_algo = C.algo;
2568
+
2569
+	    // Constants tables
2570
+	    var RHO_OFFSETS = [];
2571
+	    var PI_INDEXES  = [];
2572
+	    var ROUND_CONSTANTS = [];
2573
+
2574
+	    // Compute Constants
2575
+	    (function () {
2576
+	        // Compute rho offset constants
2577
+	        var x = 1, y = 0;
2578
+	        for (var t = 0; t < 24; t++) {
2579
+	            RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
2580
+
2581
+	            var newX = y % 5;
2582
+	            var newY = (2 * x + 3 * y) % 5;
2583
+	            x = newX;
2584
+	            y = newY;
2585
+	        }
2586
+
2587
+	        // Compute pi index constants
2588
+	        for (var x = 0; x < 5; x++) {
2589
+	            for (var y = 0; y < 5; y++) {
2590
+	                PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
2591
+	            }
2592
+	        }
2593
+
2594
+	        // Compute round constants
2595
+	        var LFSR = 0x01;
2596
+	        for (var i = 0; i < 24; i++) {
2597
+	            var roundConstantMsw = 0;
2598
+	            var roundConstantLsw = 0;
2599
+
2600
+	            for (var j = 0; j < 7; j++) {
2601
+	                if (LFSR & 0x01) {
2602
+	                    var bitPosition = (1 << j) - 1;
2603
+	                    if (bitPosition < 32) {
2604
+	                        roundConstantLsw ^= 1 << bitPosition;
2605
+	                    } else /* if (bitPosition >= 32) */ {
2606
+	                        roundConstantMsw ^= 1 << (bitPosition - 32);
2607
+	                    }
2608
+	                }
2609
+
2610
+	                // Compute next LFSR
2611
+	                if (LFSR & 0x80) {
2612
+	                    // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
2613
+	                    LFSR = (LFSR << 1) ^ 0x71;
2614
+	                } else {
2615
+	                    LFSR <<= 1;
2616
+	                }
2617
+	            }
2618
+
2619
+	            ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
2620
+	        }
2621
+	    }());
2622
+
2623
+	    // Reusable objects for temporary values
2624
+	    var T = [];
2625
+	    (function () {
2626
+	        for (var i = 0; i < 25; i++) {
2627
+	            T[i] = X64Word.create();
2628
+	        }
2629
+	    }());
2630
+
2631
+	    /**
2632
+	     * SHA-3 hash algorithm.
2633
+	     */
2634
+	    var SHA3 = C_algo.SHA3 = Hasher.extend({
2635
+	        /**
2636
+	         * Configuration options.
2637
+	         *
2638
+	         * @property {number} outputLength
2639
+	         *   The desired number of bits in the output hash.
2640
+	         *   Only values permitted are: 224, 256, 384, 512.
2641
+	         *   Default: 512
2642
+	         */
2643
+	        cfg: Hasher.cfg.extend({
2644
+	            outputLength: 512
2645
+	        }),
2646
+
2647
+	        _doReset: function () {
2648
+	            var state = this._state = []
2649
+	            for (var i = 0; i < 25; i++) {
2650
+	                state[i] = new X64Word.init();
2651
+	            }
2652
+
2653
+	            this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
2654
+	        },
2655
+
2656
+	        _doProcessBlock: function (M, offset) {
2657
+	            // Shortcuts
2658
+	            var state = this._state;
2659
+	            var nBlockSizeLanes = this.blockSize / 2;
2660
+
2661
+	            // Absorb
2662
+	            for (var i = 0; i < nBlockSizeLanes; i++) {
2663
+	                // Shortcuts
2664
+	                var M2i  = M[offset + 2 * i];
2665
+	                var M2i1 = M[offset + 2 * i + 1];
2666
+
2667
+	                // Swap endian
2668
+	                M2i = (
2669
+	                    (((M2i << 8)  | (M2i >>> 24)) & 0x00ff00ff) |
2670
+	                    (((M2i << 24) | (M2i >>> 8))  & 0xff00ff00)
2671
+	                );
2672
+	                M2i1 = (
2673
+	                    (((M2i1 << 8)  | (M2i1 >>> 24)) & 0x00ff00ff) |
2674
+	                    (((M2i1 << 24) | (M2i1 >>> 8))  & 0xff00ff00)
2675
+	                );
2676
+
2677
+	                // Absorb message into state
2678
+	                var lane = state[i];
2679
+	                lane.high ^= M2i1;
2680
+	                lane.low  ^= M2i;
2681
+	            }
2682
+
2683
+	            // Rounds
2684
+	            for (var round = 0; round < 24; round++) {
2685
+	                // Theta
2686
+	                for (var x = 0; x < 5; x++) {
2687
+	                    // Mix column lanes
2688
+	                    var tMsw = 0, tLsw = 0;
2689
+	                    for (var y = 0; y < 5; y++) {
2690
+	                        var lane = state[x + 5 * y];
2691
+	                        tMsw ^= lane.high;
2692
+	                        tLsw ^= lane.low;
2693
+	                    }
2694
+
2695
+	                    // Temporary values
2696
+	                    var Tx = T[x];
2697
+	                    Tx.high = tMsw;
2698
+	                    Tx.low  = tLsw;
2699
+	                }
2700
+	                for (var x = 0; x < 5; x++) {
2701
+	                    // Shortcuts
2702
+	                    var Tx4 = T[(x + 4) % 5];
2703
+	                    var Tx1 = T[(x + 1) % 5];
2704
+	                    var Tx1Msw = Tx1.high;
2705
+	                    var Tx1Lsw = Tx1.low;
2706
+
2707
+	                    // Mix surrounding columns
2708
+	                    var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
2709
+	                    var tLsw = Tx4.low  ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
2710
+	                    for (var y = 0; y < 5; y++) {
2711
+	                        var lane = state[x + 5 * y];
2712
+	                        lane.high ^= tMsw;
2713
+	                        lane.low  ^= tLsw;
2714
+	                    }
2715
+	                }
2716
+
2717
+	                // Rho Pi
2718
+	                for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
2719
+	                    var tMsw;
2720
+	                    var tLsw;
2721
+
2722
+	                    // Shortcuts
2723
+	                    var lane = state[laneIndex];
2724
+	                    var laneMsw = lane.high;
2725
+	                    var laneLsw = lane.low;
2726
+	                    var rhoOffset = RHO_OFFSETS[laneIndex];
2727
+
2728
+	                    // Rotate lanes
2729
+	                    if (rhoOffset < 32) {
2730
+	                        tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
2731
+	                        tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
2732
+	                    } else /* if (rhoOffset >= 32) */ {
2733
+	                        tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
2734
+	                        tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
2735
+	                    }
2736
+
2737
+	                    // Transpose lanes
2738
+	                    var TPiLane = T[PI_INDEXES[laneIndex]];
2739
+	                    TPiLane.high = tMsw;
2740
+	                    TPiLane.low  = tLsw;
2741
+	                }
2742
+
2743
+	                // Rho pi at x = y = 0
2744
+	                var T0 = T[0];
2745
+	                var state0 = state[0];
2746
+	                T0.high = state0.high;
2747
+	                T0.low  = state0.low;
2748
+
2749
+	                // Chi
2750
+	                for (var x = 0; x < 5; x++) {
2751
+	                    for (var y = 0; y < 5; y++) {
2752
+	                        // Shortcuts
2753
+	                        var laneIndex = x + 5 * y;
2754
+	                        var lane = state[laneIndex];
2755
+	                        var TLane = T[laneIndex];
2756
+	                        var Tx1Lane = T[((x + 1) % 5) + 5 * y];
2757
+	                        var Tx2Lane = T[((x + 2) % 5) + 5 * y];
2758
+
2759
+	                        // Mix rows
2760
+	                        lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
2761
+	                        lane.low  = TLane.low  ^ (~Tx1Lane.low  & Tx2Lane.low);
2762
+	                    }
2763
+	                }
2764
+
2765
+	                // Iota
2766
+	                var lane = state[0];
2767
+	                var roundConstant = ROUND_CONSTANTS[round];
2768
+	                lane.high ^= roundConstant.high;
2769
+	                lane.low  ^= roundConstant.low;
2770
+	            }
2771
+	        },
2772
+
2773
+	        _doFinalize: function () {
2774
+	            // Shortcuts
2775
+	            var data = this._data;
2776
+	            var dataWords = data.words;
2777
+	            var nBitsTotal = this._nDataBytes * 8;
2778
+	            var nBitsLeft = data.sigBytes * 8;
2779
+	            var blockSizeBits = this.blockSize * 32;
2780
+
2781
+	            // Add padding
2782
+	            dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
2783
+	            dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
2784
+	            data.sigBytes = dataWords.length * 4;
2785
+
2786
+	            // Hash final blocks
2787
+	            this._process();
2788
+
2789
+	            // Shortcuts
2790
+	            var state = this._state;
2791
+	            var outputLengthBytes = this.cfg.outputLength / 8;
2792
+	            var outputLengthLanes = outputLengthBytes / 8;
2793
+
2794
+	            // Squeeze
2795
+	            var hashWords = [];
2796
+	            for (var i = 0; i < outputLengthLanes; i++) {
2797
+	                // Shortcuts
2798
+	                var lane = state[i];
2799
+	                var laneMsw = lane.high;
2800
+	                var laneLsw = lane.low;
2801
+
2802
+	                // Swap endian
2803
+	                laneMsw = (
2804
+	                    (((laneMsw << 8)  | (laneMsw >>> 24)) & 0x00ff00ff) |
2805
+	                    (((laneMsw << 24) | (laneMsw >>> 8))  & 0xff00ff00)
2806
+	                );
2807
+	                laneLsw = (
2808
+	                    (((laneLsw << 8)  | (laneLsw >>> 24)) & 0x00ff00ff) |
2809
+	                    (((laneLsw << 24) | (laneLsw >>> 8))  & 0xff00ff00)
2810
+	                );
2811
+
2812
+	                // Squeeze state to retrieve hash
2813
+	                hashWords.push(laneLsw);
2814
+	                hashWords.push(laneMsw);
2815
+	            }
2816
+
2817
+	            // Return final computed hash
2818
+	            return new WordArray.init(hashWords, outputLengthBytes);
2819
+	        },
2820
+
2821
+	        clone: function () {
2822
+	            var clone = Hasher.clone.call(this);
2823
+
2824
+	            var state = clone._state = this._state.slice(0);
2825
+	            for (var i = 0; i < 25; i++) {
2826
+	                state[i] = state[i].clone();
2827
+	            }
2828
+
2829
+	            return clone;
2830
+	        }
2831
+	    });
2832
+
2833
+	    /**
2834
+	     * Shortcut function to the hasher's object interface.
2835
+	     *
2836
+	     * @param {WordArray|string} message The message to hash.
2837
+	     *
2838
+	     * @return {WordArray} The hash.
2839
+	     *
2840
+	     * @static
2841
+	     *
2842
+	     * @example
2843
+	     *
2844
+	     *     var hash = CryptoJS.SHA3('message');
2845
+	     *     var hash = CryptoJS.SHA3(wordArray);
2846
+	     */
2847
+	    C.SHA3 = Hasher._createHelper(SHA3);
2848
+
2849
+	    /**
2850
+	     * Shortcut function to the HMAC's object interface.
2851
+	     *
2852
+	     * @param {WordArray|string} message The message to hash.
2853
+	     * @param {WordArray|string} key The secret key.
2854
+	     *
2855
+	     * @return {WordArray} The HMAC.
2856
+	     *
2857
+	     * @static
2858
+	     *
2859
+	     * @example
2860
+	     *
2861
+	     *     var hmac = CryptoJS.HmacSHA3(message, key);
2862
+	     */
2863
+	    C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
2864
+	}(Math));
2865
+
2866
+
2867
+	/** @preserve
2868
+	(c) 2012 by Cédric Mesnil. All rights reserved.
2869
+
2870
+	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
2871
+
2872
+	    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2873
+	    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
2874
+
2875
+	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2876
+	*/
2877
+
2878
+	(function (Math) {
2879
+	    // Shortcuts
2880
+	    var C = CryptoJS;
2881
+	    var C_lib = C.lib;
2882
+	    var WordArray = C_lib.WordArray;
2883
+	    var Hasher = C_lib.Hasher;
2884
+	    var C_algo = C.algo;
2885
+
2886
+	    // Constants table
2887
+	    var _zl = WordArray.create([
2888
+	        0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
2889
+	        7,  4, 13,  1, 10,  6, 15,  3, 12,  0,  9,  5,  2, 14, 11,  8,
2890
+	        3, 10, 14,  4,  9, 15,  8,  1,  2,  7,  0,  6, 13, 11,  5, 12,
2891
+	        1,  9, 11, 10,  0,  8, 12,  4, 13,  3,  7, 15, 14,  5,  6,  2,
2892
+	        4,  0,  5,  9,  7, 12,  2, 10, 14,  1,  3,  8, 11,  6, 15, 13]);
2893
+	    var _zr = WordArray.create([
2894
+	        5, 14,  7,  0,  9,  2, 11,  4, 13,  6, 15,  8,  1, 10,  3, 12,
2895
+	        6, 11,  3,  7,  0, 13,  5, 10, 14, 15,  8, 12,  4,  9,  1,  2,
2896
+	        15,  5,  1,  3,  7, 14,  6,  9, 11,  8, 12,  2, 10,  0,  4, 13,
2897
+	        8,  6,  4,  1,  3, 11, 15,  0,  5, 12,  2, 13,  9,  7, 10, 14,
2898
+	        12, 15, 10,  4,  1,  5,  8,  7,  6,  2, 13, 14,  0,  3,  9, 11]);
2899
+	    var _sl = WordArray.create([
2900
+	         11, 14, 15, 12,  5,  8,  7,  9, 11, 13, 14, 15,  6,  7,  9,  8,
2901
+	        7, 6,   8, 13, 11,  9,  7, 15,  7, 12, 15,  9, 11,  7, 13, 12,
2902
+	        11, 13,  6,  7, 14,  9, 13, 15, 14,  8, 13,  6,  5, 12,  7,  5,
2903
+	          11, 12, 14, 15, 14, 15,  9,  8,  9, 14,  5,  6,  8,  6,  5, 12,
2904
+	        9, 15,  5, 11,  6,  8, 13, 12,  5, 12, 13, 14, 11,  8,  5,  6 ]);
2905
+	    var _sr = WordArray.create([
2906
+	        8,  9,  9, 11, 13, 15, 15,  5,  7,  7,  8, 11, 14, 14, 12,  6,
2907
+	        9, 13, 15,  7, 12,  8,  9, 11,  7,  7, 12,  7,  6, 15, 13, 11,
2908
+	        9,  7, 15, 11,  8,  6,  6, 14, 12, 13,  5, 14, 13, 13,  7,  5,
2909
+	        15,  5,  8, 11, 14, 14,  6, 14,  6,  9, 12,  9, 12,  5, 15,  8,
2910
+	        8,  5, 12,  9, 12,  5, 14,  6,  8, 13,  6,  5, 15, 13, 11, 11 ]);
2911
+
2912
+	    var _hl =  WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
2913
+	    var _hr =  WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
2914
+
2915
+	    /**
2916
+	     * RIPEMD160 hash algorithm.
2917
+	     */
2918
+	    var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
2919
+	        _doReset: function () {
2920
+	            this._hash  = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
2921
+	        },
2922
+
2923
+	        _doProcessBlock: function (M, offset) {
2924
+
2925
+	            // Swap endian
2926
+	            for (var i = 0; i < 16; i++) {
2927
+	                // Shortcuts
2928
+	                var offset_i = offset + i;
2929
+	                var M_offset_i = M[offset_i];
2930
+
2931
+	                // Swap
2932
+	                M[offset_i] = (
2933
+	                    (((M_offset_i << 8)  | (M_offset_i >>> 24)) & 0x00ff00ff) |
2934
+	                    (((M_offset_i << 24) | (M_offset_i >>> 8))  & 0xff00ff00)
2935
+	                );
2936
+	            }
2937
+	            // Shortcut
2938
+	            var H  = this._hash.words;
2939
+	            var hl = _hl.words;
2940
+	            var hr = _hr.words;
2941
+	            var zl = _zl.words;
2942
+	            var zr = _zr.words;
2943
+	            var sl = _sl.words;
2944
+	            var sr = _sr.words;
2945
+
2946
+	            // Working variables
2947
+	            var al, bl, cl, dl, el;
2948
+	            var ar, br, cr, dr, er;
2949
+
2950
+	            ar = al = H[0];
2951
+	            br = bl = H[1];
2952
+	            cr = cl = H[2];
2953
+	            dr = dl = H[3];
2954
+	            er = el = H[4];
2955
+	            // Computation
2956
+	            var t;
2957
+	            for (var i = 0; i < 80; i += 1) {
2958
+	                t = (al +  M[offset+zl[i]])|0;
2959
+	                if (i<16){
2960
+		            t +=  f1(bl,cl,dl) + hl[0];
2961
+	                } else if (i<32) {
2962
+		            t +=  f2(bl,cl,dl) + hl[1];
2963
+	                } else if (i<48) {
2964
+		            t +=  f3(bl,cl,dl) + hl[2];
2965
+	                } else if (i<64) {
2966
+		            t +=  f4(bl,cl,dl) + hl[3];
2967
+	                } else {// if (i<80) {
2968
+		            t +=  f5(bl,cl,dl) + hl[4];
2969
+	                }
2970
+	                t = t|0;
2971
+	                t =  rotl(t,sl[i]);
2972
+	                t = (t+el)|0;
2973
+	                al = el;
2974
+	                el = dl;
2975
+	                dl = rotl(cl, 10);
2976
+	                cl = bl;
2977
+	                bl = t;
2978
+
2979
+	                t = (ar + M[offset+zr[i]])|0;
2980
+	                if (i<16){
2981
+		            t +=  f5(br,cr,dr) + hr[0];
2982
+	                } else if (i<32) {
2983
+		            t +=  f4(br,cr,dr) + hr[1];
2984
+	                } else if (i<48) {
2985
+		            t +=  f3(br,cr,dr) + hr[2];
2986
+	                } else if (i<64) {
2987
+		            t +=  f2(br,cr,dr) + hr[3];
2988
+	                } else {// if (i<80) {
2989
+		            t +=  f1(br,cr,dr) + hr[4];
2990
+	                }
2991
+	                t = t|0;
2992
+	                t =  rotl(t,sr[i]) ;
2993
+	                t = (t+er)|0;
2994
+	                ar = er;
2995
+	                er = dr;
2996
+	                dr = rotl(cr, 10);
2997
+	                cr = br;
2998
+	                br = t;
2999
+	            }
3000
+	            // Intermediate hash value
3001
+	            t    = (H[1] + cl + dr)|0;
3002
+	            H[1] = (H[2] + dl + er)|0;
3003
+	            H[2] = (H[3] + el + ar)|0;
3004
+	            H[3] = (H[4] + al + br)|0;
3005
+	            H[4] = (H[0] + bl + cr)|0;
3006
+	            H[0] =  t;
3007
+	        },
3008
+
3009
+	        _doFinalize: function () {
3010
+	            // Shortcuts
3011
+	            var data = this._data;
3012
+	            var dataWords = data.words;
3013
+
3014
+	            var nBitsTotal = this._nDataBytes * 8;
3015
+	            var nBitsLeft = data.sigBytes * 8;
3016
+
3017
+	            // Add padding
3018
+	            dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
3019
+	            dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
3020
+	                (((nBitsTotal << 8)  | (nBitsTotal >>> 24)) & 0x00ff00ff) |
3021
+	                (((nBitsTotal << 24) | (nBitsTotal >>> 8))  & 0xff00ff00)
3022
+	            );
3023
+	            data.sigBytes = (dataWords.length + 1) * 4;
3024
+
3025
+	            // Hash final blocks
3026
+	            this._process();
3027
+
3028
+	            // Shortcuts
3029
+	            var hash = this._hash;
3030
+	            var H = hash.words;
3031
+
3032
+	            // Swap endian
3033
+	            for (var i = 0; i < 5; i++) {
3034
+	                // Shortcut
3035
+	                var H_i = H[i];
3036
+
3037
+	                // Swap
3038
+	                H[i] = (((H_i << 8)  | (H_i >>> 24)) & 0x00ff00ff) |
3039
+	                       (((H_i << 24) | (H_i >>> 8))  & 0xff00ff00);
3040
+	            }
3041
+
3042
+	            // Return final computed hash
3043
+	            return hash;
3044
+	        },
3045
+
3046
+	        clone: function () {
3047
+	            var clone = Hasher.clone.call(this);
3048
+	            clone._hash = this._hash.clone();
3049
+
3050
+	            return clone;
3051
+	        }
3052
+	    });
3053
+
3054
+
3055
+	    function f1(x, y, z) {
3056
+	        return ((x) ^ (y) ^ (z));
3057
+
3058
+	    }
3059
+
3060
+	    function f2(x, y, z) {
3061
+	        return (((x)&(y)) | ((~x)&(z)));
3062
+	    }
3063
+
3064
+	    function f3(x, y, z) {
3065
+	        return (((x) | (~(y))) ^ (z));
3066
+	    }
3067
+
3068
+	    function f4(x, y, z) {
3069
+	        return (((x) & (z)) | ((y)&(~(z))));
3070
+	    }
3071
+
3072
+	    function f5(x, y, z) {
3073
+	        return ((x) ^ ((y) |(~(z))));
3074
+
3075
+	    }
3076
+
3077
+	    function rotl(x,n) {
3078
+	        return (x<<n) | (x>>>(32-n));
3079
+	    }
3080
+
3081
+
3082
+	    /**
3083
+	     * Shortcut function to the hasher's object interface.
3084
+	     *
3085
+	     * @param {WordArray|string} message The message to hash.
3086
+	     *
3087
+	     * @return {WordArray} The hash.
3088
+	     *
3089
+	     * @static
3090
+	     *
3091
+	     * @example
3092
+	     *
3093
+	     *     var hash = CryptoJS.RIPEMD160('message');
3094
+	     *     var hash = CryptoJS.RIPEMD160(wordArray);
3095
+	     */
3096
+	    C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
3097
+
3098
+	    /**
3099
+	     * Shortcut function to the HMAC's object interface.
3100
+	     *
3101
+	     * @param {WordArray|string} message The message to hash.
3102
+	     * @param {WordArray|string} key The secret key.
3103
+	     *
3104
+	     * @return {WordArray} The HMAC.
3105
+	     *
3106
+	     * @static
3107
+	     *
3108
+	     * @example
3109
+	     *
3110
+	     *     var hmac = CryptoJS.HmacRIPEMD160(message, key);
3111
+	     */
3112
+	    C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
3113
+	}(Math));
3114
+
3115
+
3116
+	(function () {
3117
+	    // Shortcuts
3118
+	    var C = CryptoJS;
3119
+	    var C_lib = C.lib;
3120
+	    var Base = C_lib.Base;
3121
+	    var C_enc = C.enc;
3122
+	    var Utf8 = C_enc.Utf8;
3123
+	    var C_algo = C.algo;
3124
+
3125
+	    /**
3126
+	     * HMAC algorithm.
3127
+	     */
3128
+	    var HMAC = C_algo.HMAC = Base.extend({
3129
+	        /**
3130
+	         * Initializes a newly created HMAC.
3131
+	         *
3132
+	         * @param {Hasher} hasher The hash algorithm to use.
3133
+	         * @param {WordArray|string} key The secret key.
3134
+	         *
3135
+	         * @example
3136
+	         *
3137
+	         *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
3138
+	         */
3139
+	        init: function (hasher, key) {
3140
+	            // Init hasher
3141
+	            hasher = this._hasher = new hasher.init();
3142
+
3143
+	            // Convert string to WordArray, else assume WordArray already
3144
+	            if (typeof key == 'string') {
3145
+	                key = Utf8.parse(key);
3146
+	            }
3147
+
3148
+	            // Shortcuts
3149
+	            var hasherBlockSize = hasher.blockSize;
3150
+	            var hasherBlockSizeBytes = hasherBlockSize * 4;
3151
+
3152
+	            // Allow arbitrary length keys
3153
+	            if (key.sigBytes > hasherBlockSizeBytes) {
3154
+	                key = hasher.finalize(key);
3155
+	            }
3156
+
3157
+	            // Clamp excess bits
3158
+	            key.clamp();
3159
+
3160
+	            // Clone key for inner and outer pads
3161
+	            var oKey = this._oKey = key.clone();
3162
+	            var iKey = this._iKey = key.clone();
3163
+
3164
+	            // Shortcuts
3165
+	            var oKeyWords = oKey.words;
3166
+	            var iKeyWords = iKey.words;
3167
+
3168
+	            // XOR keys with pad constants
3169
+	            for (var i = 0; i < hasherBlockSize; i++) {
3170
+	                oKeyWords[i] ^= 0x5c5c5c5c;
3171
+	                iKeyWords[i] ^= 0x36363636;
3172
+	            }
3173
+	            oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
3174
+
3175
+	            // Set initial values
3176
+	            this.reset();
3177
+	        },
3178
+
3179
+	        /**
3180
+	         * Resets this HMAC to its initial state.
3181
+	         *
3182
+	         * @example
3183
+	         *
3184
+	         *     hmacHasher.reset();
3185
+	         */
3186
+	        reset: function () {
3187
+	            // Shortcut
3188
+	            var hasher = this._hasher;
3189
+
3190
+	            // Reset
3191
+	            hasher.reset();
3192
+	            hasher.update(this._iKey);
3193
+	        },
3194
+
3195
+	        /**
3196
+	         * Updates this HMAC with a message.
3197
+	         *
3198
+	         * @param {WordArray|string} messageUpdate The message to append.
3199
+	         *
3200
+	         * @return {HMAC} This HMAC instance.
3201
+	         *
3202
+	         * @example
3203
+	         *
3204
+	         *     hmacHasher.update('message');
3205
+	         *     hmacHasher.update(wordArray);
3206
+	         */
3207
+	        update: function (messageUpdate) {
3208
+	            this._hasher.update(messageUpdate);
3209
+
3210
+	            // Chainable
3211
+	            return this;
3212
+	        },
3213
+
3214
+	        /**
3215
+	         * Finalizes the HMAC computation.
3216
+	         * Note that the finalize operation is effectively a destructive, read-once operation.
3217
+	         *
3218
+	         * @param {WordArray|string} messageUpdate (Optional) A final message update.
3219
+	         *
3220
+	         * @return {WordArray} The HMAC.
3221
+	         *
3222
+	         * @example
3223
+	         *
3224
+	         *     var hmac = hmacHasher.finalize();
3225
+	         *     var hmac = hmacHasher.finalize('message');
3226
+	         *     var hmac = hmacHasher.finalize(wordArray);
3227
+	         */
3228
+	        finalize: function (messageUpdate) {
3229
+	            // Shortcut
3230
+	            var hasher = this._hasher;
3231
+
3232
+	            // Compute HMAC
3233
+	            var innerHash = hasher.finalize(messageUpdate);
3234
+	            hasher.reset();
3235
+	            var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
3236
+
3237
+	            return hmac;
3238
+	        }
3239
+	    });
3240
+	}());
3241
+
3242
+
3243
+	(function () {
3244
+	    // Shortcuts
3245
+	    var C = CryptoJS;
3246
+	    var C_lib = C.lib;
3247
+	    var Base = C_lib.Base;
3248
+	    var WordArray = C_lib.WordArray;
3249
+	    var C_algo = C.algo;
3250
+	    var SHA1 = C_algo.SHA1;
3251
+	    var HMAC = C_algo.HMAC;
3252
+
3253
+	    /**
3254
+	     * Password-Based Key Derivation Function 2 algorithm.
3255
+	     */
3256
+	    var PBKDF2 = C_algo.PBKDF2 = Base.extend({
3257
+	        /**
3258
+	         * Configuration options.
3259
+	         *
3260
+	         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
3261
+	         * @property {Hasher} hasher The hasher to use. Default: SHA1
3262
+	         * @property {number} iterations The number of iterations to perform. Default: 1
3263
+	         */
3264
+	        cfg: Base.extend({
3265
+	            keySize: 128/32,
3266
+	            hasher: SHA1,
3267
+	            iterations: 1
3268
+	        }),
3269
+
3270
+	        /**
3271
+	         * Initializes a newly created key derivation function.
3272
+	         *
3273
+	         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
3274
+	         *
3275
+	         * @example
3276
+	         *
3277
+	         *     var kdf = CryptoJS.algo.PBKDF2.create();
3278
+	         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
3279
+	         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
3280
+	         */
3281
+	        init: function (cfg) {
3282
+	            this.cfg = this.cfg.extend(cfg);
3283
+	        },
3284
+
3285
+	        /**
3286
+	         * Computes the Password-Based Key Derivation Function 2.
3287
+	         *
3288
+	         * @param {WordArray|string} password The password.
3289
+	         * @param {WordArray|string} salt A salt.
3290
+	         *
3291
+	         * @return {WordArray} The derived key.
3292
+	         *
3293
+	         * @example
3294
+	         *
3295
+	         *     var key = kdf.compute(password, salt);
3296
+	         */
3297
+	        compute: function (password, salt) {
3298
+	            // Shortcut
3299
+	            var cfg = this.cfg;
3300
+
3301
+	            // Init HMAC
3302
+	            var hmac = HMAC.create(cfg.hasher, password);
3303
+
3304
+	            // Initial values
3305
+	            var derivedKey = WordArray.create();
3306
+	            var blockIndex = WordArray.create([0x00000001]);
3307
+
3308
+	            // Shortcuts
3309
+	            var derivedKeyWords = derivedKey.words;
3310
+	            var blockIndexWords = blockIndex.words;
3311
+	            var keySize = cfg.keySize;
3312
+	            var iterations = cfg.iterations;
3313
+
3314
+	            // Generate key
3315
+	            while (derivedKeyWords.length < keySize) {
3316
+	                var block = hmac.update(salt).finalize(blockIndex);
3317
+	                hmac.reset();
3318
+
3319
+	                // Shortcuts
3320
+	                var blockWords = block.words;
3321
+	                var blockWordsLength = blockWords.length;
3322
+
3323
+	                // Iterations
3324
+	                var intermediate = block;
3325
+	                for (var i = 1; i < iterations; i++) {
3326
+	                    intermediate = hmac.finalize(intermediate);
3327
+	                    hmac.reset();
3328
+
3329
+	                    // Shortcut
3330
+	                    var intermediateWords = intermediate.words;
3331
+
3332
+	                    // XOR intermediate with block
3333
+	                    for (var j = 0; j < blockWordsLength; j++) {
3334
+	                        blockWords[j] ^= intermediateWords[j];
3335
+	                    }
3336
+	                }
3337
+
3338
+	                derivedKey.concat(block);
3339
+	                blockIndexWords[0]++;
3340
+	            }
3341
+	            derivedKey.sigBytes = keySize * 4;
3342
+
3343
+	            return derivedKey;
3344
+	        }
3345
+	    });
3346
+
3347
+	    /**
3348
+	     * Computes the Password-Based Key Derivation Function 2.
3349
+	     *
3350
+	     * @param {WordArray|string} password The password.
3351
+	     * @param {WordArray|string} salt A salt.
3352
+	     * @param {Object} cfg (Optional) The configuration options to use for this computation.
3353
+	     *
3354
+	     * @return {WordArray} The derived key.
3355
+	     *
3356
+	     * @static
3357
+	     *
3358
+	     * @example
3359
+	     *
3360
+	     *     var key = CryptoJS.PBKDF2(password, salt);
3361
+	     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
3362
+	     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
3363
+	     */
3364
+	    C.PBKDF2 = function (password, salt, cfg) {
3365
+	        return PBKDF2.create(cfg).compute(password, salt);
3366
+	    };
3367
+	}());
3368
+
3369
+
3370
+	(function () {
3371
+	    // Shortcuts
3372
+	    var C = CryptoJS;
3373
+	    var C_lib = C.lib;
3374
+	    var Base = C_lib.Base;
3375
+	    var WordArray = C_lib.WordArray;
3376
+	    var C_algo = C.algo;
3377
+	    var MD5 = C_algo.MD5;
3378
+
3379
+	    /**
3380
+	     * This key derivation function is meant to conform with EVP_BytesToKey.
3381
+	     * www.openssl.org/docs/crypto/EVP_BytesToKey.html
3382
+	     */
3383
+	    var EvpKDF = C_algo.EvpKDF = Base.extend({
3384
+	        /**
3385
+	         * Configuration options.
3386
+	         *
3387
+	         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
3388
+	         * @property {Hasher} hasher The hash algorithm to use. Default: MD5
3389
+	         * @property {number} iterations The number of iterations to perform. Default: 1
3390
+	         */
3391
+	        cfg: Base.extend({
3392
+	            keySize: 128/32,
3393
+	            hasher: MD5,
3394
+	            iterations: 1
3395
+	        }),
3396
+
3397
+	        /**
3398
+	         * Initializes a newly created key derivation function.
3399
+	         *
3400
+	         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
3401
+	         *
3402
+	         * @example
3403
+	         *
3404
+	         *     var kdf = CryptoJS.algo.EvpKDF.create();
3405
+	         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
3406
+	         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
3407
+	         */
3408
+	        init: function (cfg) {
3409
+	            this.cfg = this.cfg.extend(cfg);
3410
+	        },
3411
+
3412
+	        /**
3413
+	         * Derives a key from a password.
3414
+	         *
3415
+	         * @param {WordArray|string} password The password.
3416
+	         * @param {WordArray|string} salt A salt.
3417
+	         *
3418
+	         * @return {WordArray} The derived key.
3419
+	         *
3420
+	         * @example
3421
+	         *
3422
+	         *     var key = kdf.compute(password, salt);
3423
+	         */
3424
+	        compute: function (password, salt) {
3425
+	            var block;
3426
+
3427
+	            // Shortcut
3428
+	            var cfg = this.cfg;
3429
+
3430
+	            // Init hasher
3431
+	            var hasher = cfg.hasher.create();
3432
+
3433
+	            // Initial values
3434
+	            var derivedKey = WordArray.create();
3435
+
3436
+	            // Shortcuts
3437
+	            var derivedKeyWords = derivedKey.words;
3438
+	            var keySize = cfg.keySize;
3439
+	            var iterations = cfg.iterations;
3440
+
3441
+	            // Generate key
3442
+	            while (derivedKeyWords.length < keySize) {
3443
+	                if (block) {
3444
+	                    hasher.update(block);
3445
+	                }
3446
+	                block = hasher.update(password).finalize(salt);
3447
+	                hasher.reset();
3448
+
3449
+	                // Iterations
3450
+	                for (var i = 1; i < iterations; i++) {
3451
+	                    block = hasher.finalize(block);
3452
+	                    hasher.reset();
3453
+	                }
3454
+
3455
+	                derivedKey.concat(block);
3456
+	            }
3457
+	            derivedKey.sigBytes = keySize * 4;
3458
+
3459
+	            return derivedKey;
3460
+	        }
3461
+	    });
3462
+
3463
+	    /**
3464
+	     * Derives a key from a password.
3465
+	     *
3466
+	     * @param {WordArray|string} password The password.
3467
+	     * @param {WordArray|string} salt A salt.
3468
+	     * @param {Object} cfg (Optional) The configuration options to use for this computation.
3469
+	     *
3470
+	     * @return {WordArray} The derived key.
3471
+	     *
3472
+	     * @static
3473
+	     *
3474
+	     * @example
3475
+	     *
3476
+	     *     var key = CryptoJS.EvpKDF(password, salt);
3477
+	     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
3478
+	     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
3479
+	     */
3480
+	    C.EvpKDF = function (password, salt, cfg) {
3481
+	        return EvpKDF.create(cfg).compute(password, salt);
3482
+	    };
3483
+	}());
3484
+
3485
+
3486
+	/**
3487
+	 * Cipher core components.
3488
+	 */
3489
+	CryptoJS.lib.Cipher || (function (undefined) {
3490
+	    // Shortcuts
3491
+	    var C = CryptoJS;
3492
+	    var C_lib = C.lib;
3493
+	    var Base = C_lib.Base;
3494
+	    var WordArray = C_lib.WordArray;
3495
+	    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
3496
+	    var C_enc = C.enc;
3497
+	    var Utf8 = C_enc.Utf8;
3498
+	    var Base64 = C_enc.Base64;
3499
+	    var C_algo = C.algo;
3500
+	    var EvpKDF = C_algo.EvpKDF;
3501
+
3502
+	    /**
3503
+	     * Abstract base cipher template.
3504
+	     *
3505
+	     * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
3506
+	     * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
3507
+	     * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
3508
+	     * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
3509
+	     */
3510
+	    var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
3511
+	        /**
3512
+	         * Configuration options.
3513
+	         *
3514
+	         * @property {WordArray} iv The IV to use for this operation.
3515
+	         */
3516
+	        cfg: Base.extend(),
3517
+
3518
+	        /**
3519
+	         * Creates this cipher in encryption mode.
3520
+	         *
3521
+	         * @param {WordArray} key The key.
3522
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
3523
+	         *
3524
+	         * @return {Cipher} A cipher instance.
3525
+	         *
3526
+	         * @static
3527
+	         *
3528
+	         * @example
3529
+	         *
3530
+	         *     var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
3531
+	         */
3532
+	        createEncryptor: function (key, cfg) {
3533
+	            return this.create(this._ENC_XFORM_MODE, key, cfg);
3534
+	        },
3535
+
3536
+	        /**
3537
+	         * Creates this cipher in decryption mode.
3538
+	         *
3539
+	         * @param {WordArray} key The key.
3540
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
3541
+	         *
3542
+	         * @return {Cipher} A cipher instance.
3543
+	         *
3544
+	         * @static
3545
+	         *
3546
+	         * @example
3547
+	         *
3548
+	         *     var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
3549
+	         */
3550
+	        createDecryptor: function (key, cfg) {
3551
+	            return this.create(this._DEC_XFORM_MODE, key, cfg);
3552
+	        },
3553
+
3554
+	        /**
3555
+	         * Initializes a newly created cipher.
3556
+	         *
3557
+	         * @param {number} xformMode Either the encryption or decryption transormation mode constant.
3558
+	         * @param {WordArray} key The key.
3559
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
3560
+	         *
3561
+	         * @example
3562
+	         *
3563
+	         *     var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
3564
+	         */
3565
+	        init: function (xformMode, key, cfg) {
3566
+	            // Apply config defaults
3567
+	            this.cfg = this.cfg.extend(cfg);
3568
+
3569
+	            // Store transform mode and key
3570
+	            this._xformMode = xformMode;
3571
+	            this._key = key;
3572
+
3573
+	            // Set initial values
3574
+	            this.reset();
3575
+	        },
3576
+
3577
+	        /**
3578
+	         * Resets this cipher to its initial state.
3579
+	         *
3580
+	         * @example
3581
+	         *
3582
+	         *     cipher.reset();
3583
+	         */
3584
+	        reset: function () {
3585
+	            // Reset data buffer
3586
+	            BufferedBlockAlgorithm.reset.call(this);
3587
+
3588
+	            // Perform concrete-cipher logic
3589
+	            this._doReset();
3590
+	        },
3591
+
3592
+	        /**
3593
+	         * Adds data to be encrypted or decrypted.
3594
+	         *
3595
+	         * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
3596
+	         *
3597
+	         * @return {WordArray} The data after processing.
3598
+	         *
3599
+	         * @example
3600
+	         *
3601
+	         *     var encrypted = cipher.process('data');
3602
+	         *     var encrypted = cipher.process(wordArray);
3603
+	         */
3604
+	        process: function (dataUpdate) {
3605
+	            // Append
3606
+	            this._append(dataUpdate);
3607
+
3608
+	            // Process available blocks
3609
+	            return this._process();
3610
+	        },
3611
+
3612
+	        /**
3613
+	         * Finalizes the encryption or decryption process.
3614
+	         * Note that the finalize operation is effectively a destructive, read-once operation.
3615
+	         *
3616
+	         * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
3617
+	         *
3618
+	         * @return {WordArray} The data after final processing.
3619
+	         *
3620
+	         * @example
3621
+	         *
3622
+	         *     var encrypted = cipher.finalize();
3623
+	         *     var encrypted = cipher.finalize('data');
3624
+	         *     var encrypted = cipher.finalize(wordArray);
3625
+	         */
3626
+	        finalize: function (dataUpdate) {
3627
+	            // Final data update
3628
+	            if (dataUpdate) {
3629
+	                this._append(dataUpdate);
3630
+	            }
3631
+
3632
+	            // Perform concrete-cipher logic
3633
+	            var finalProcessedData = this._doFinalize();
3634
+
3635
+	            return finalProcessedData;
3636
+	        },
3637
+
3638
+	        keySize: 128/32,
3639
+
3640
+	        ivSize: 128/32,
3641
+
3642
+	        _ENC_XFORM_MODE: 1,
3643
+
3644
+	        _DEC_XFORM_MODE: 2,
3645
+
3646
+	        /**
3647
+	         * Creates shortcut functions to a cipher's object interface.
3648
+	         *
3649
+	         * @param {Cipher} cipher The cipher to create a helper for.
3650
+	         *
3651
+	         * @return {Object} An object with encrypt and decrypt shortcut functions.
3652
+	         *
3653
+	         * @static
3654
+	         *
3655
+	         * @example
3656
+	         *
3657
+	         *     var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
3658
+	         */
3659
+	        _createHelper: (function () {
3660
+	            function selectCipherStrategy(key) {
3661
+	                if (typeof key == 'string') {
3662
+	                    return PasswordBasedCipher;
3663
+	                } else {
3664
+	                    return SerializableCipher;
3665
+	                }
3666
+	            }
3667
+
3668
+	            return function (cipher) {
3669
+	                return {
3670
+	                    encrypt: function (message, key, cfg) {
3671
+	                        return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
3672
+	                    },
3673
+
3674
+	                    decrypt: function (ciphertext, key, cfg) {
3675
+	                        return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
3676
+	                    }
3677
+	                };
3678
+	            };
3679
+	        }())
3680
+	    });
3681
+
3682
+	    /**
3683
+	     * Abstract base stream cipher template.
3684
+	     *
3685
+	     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
3686
+	     */
3687
+	    var StreamCipher = C_lib.StreamCipher = Cipher.extend({
3688
+	        _doFinalize: function () {
3689
+	            // Process partial blocks
3690
+	            var finalProcessedBlocks = this._process(!!'flush');
3691
+
3692
+	            return finalProcessedBlocks;
3693
+	        },
3694
+
3695
+	        blockSize: 1
3696
+	    });
3697
+
3698
+	    /**
3699
+	     * Mode namespace.
3700
+	     */
3701
+	    var C_mode = C.mode = {};
3702
+
3703
+	    /**
3704
+	     * Abstract base block cipher mode template.
3705
+	     */
3706
+	    var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
3707
+	        /**
3708
+	         * Creates this mode for encryption.
3709
+	         *
3710
+	         * @param {Cipher} cipher A block cipher instance.
3711
+	         * @param {Array} iv The IV words.
3712
+	         *
3713
+	         * @static
3714
+	         *
3715
+	         * @example
3716
+	         *
3717
+	         *     var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
3718
+	         */
3719
+	        createEncryptor: function (cipher, iv) {
3720
+	            return this.Encryptor.create(cipher, iv);
3721
+	        },
3722
+
3723
+	        /**
3724
+	         * Creates this mode for decryption.
3725
+	         *
3726
+	         * @param {Cipher} cipher A block cipher instance.
3727
+	         * @param {Array} iv The IV words.
3728
+	         *
3729
+	         * @static
3730
+	         *
3731
+	         * @example
3732
+	         *
3733
+	         *     var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
3734
+	         */
3735
+	        createDecryptor: function (cipher, iv) {
3736
+	            return this.Decryptor.create(cipher, iv);
3737
+	        },
3738
+
3739
+	        /**
3740
+	         * Initializes a newly created mode.
3741
+	         *
3742
+	         * @param {Cipher} cipher A block cipher instance.
3743
+	         * @param {Array} iv The IV words.
3744
+	         *
3745
+	         * @example
3746
+	         *
3747
+	         *     var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
3748
+	         */
3749
+	        init: function (cipher, iv) {
3750
+	            this._cipher = cipher;
3751
+	            this._iv = iv;
3752
+	        }
3753
+	    });
3754
+
3755
+	    /**
3756
+	     * Cipher Block Chaining mode.
3757
+	     */
3758
+	    var CBC = C_mode.CBC = (function () {
3759
+	        /**
3760
+	         * Abstract base CBC mode.
3761
+	         */
3762
+	        var CBC = BlockCipherMode.extend();
3763
+
3764
+	        /**
3765
+	         * CBC encryptor.
3766
+	         */
3767
+	        CBC.Encryptor = CBC.extend({
3768
+	            /**
3769
+	             * Processes the data block at offset.
3770
+	             *
3771
+	             * @param {Array} words The data words to operate on.
3772
+	             * @param {number} offset The offset where the block starts.
3773
+	             *
3774
+	             * @example
3775
+	             *
3776
+	             *     mode.processBlock(data.words, offset);
3777
+	             */
3778
+	            processBlock: function (words, offset) {
3779
+	                // Shortcuts
3780
+	                var cipher = this._cipher;
3781
+	                var blockSize = cipher.blockSize;
3782
+
3783
+	                // XOR and encrypt
3784
+	                xorBlock.call(this, words, offset, blockSize);
3785
+	                cipher.encryptBlock(words, offset);
3786
+
3787
+	                // Remember this block to use with next block
3788
+	                this._prevBlock = words.slice(offset, offset + blockSize);
3789
+	            }
3790
+	        });
3791
+
3792
+	        /**
3793
+	         * CBC decryptor.
3794
+	         */
3795
+	        CBC.Decryptor = CBC.extend({
3796
+	            /**
3797
+	             * Processes the data block at offset.
3798
+	             *
3799
+	             * @param {Array} words The data words to operate on.
3800
+	             * @param {number} offset The offset where the block starts.
3801
+	             *
3802
+	             * @example
3803
+	             *
3804
+	             *     mode.processBlock(data.words, offset);
3805
+	             */
3806
+	            processBlock: function (words, offset) {
3807
+	                // Shortcuts
3808
+	                var cipher = this._cipher;
3809
+	                var blockSize = cipher.blockSize;
3810
+
3811
+	                // Remember this block to use with next block
3812
+	                var thisBlock = words.slice(offset, offset + blockSize);
3813
+
3814
+	                // Decrypt and XOR
3815
+	                cipher.decryptBlock(words, offset);
3816
+	                xorBlock.call(this, words, offset, blockSize);
3817
+
3818
+	                // This block becomes the previous block
3819
+	                this._prevBlock = thisBlock;
3820
+	            }
3821
+	        });
3822
+
3823
+	        function xorBlock(words, offset, blockSize) {
3824
+	            var block;
3825
+
3826
+	            // Shortcut
3827
+	            var iv = this._iv;
3828
+
3829
+	            // Choose mixing block
3830
+	            if (iv) {
3831
+	                block = iv;
3832
+
3833
+	                // Remove IV for subsequent blocks
3834
+	                this._iv = undefined;
3835
+	            } else {
3836
+	                block = this._prevBlock;
3837
+	            }
3838
+
3839
+	            // XOR blocks
3840
+	            for (var i = 0; i < blockSize; i++) {
3841
+	                words[offset + i] ^= block[i];
3842
+	            }
3843
+	        }
3844
+
3845
+	        return CBC;
3846
+	    }());
3847
+
3848
+	    /**
3849
+	     * Padding namespace.
3850
+	     */
3851
+	    var C_pad = C.pad = {};
3852
+
3853
+	    /**
3854
+	     * PKCS #5/7 padding strategy.
3855
+	     */
3856
+	    var Pkcs7 = C_pad.Pkcs7 = {
3857
+	        /**
3858
+	         * Pads data using the algorithm defined in PKCS #5/7.
3859
+	         *
3860
+	         * @param {WordArray} data The data to pad.
3861
+	         * @param {number} blockSize The multiple that the data should be padded to.
3862
+	         *
3863
+	         * @static
3864
+	         *
3865
+	         * @example
3866
+	         *
3867
+	         *     CryptoJS.pad.Pkcs7.pad(wordArray, 4);
3868
+	         */
3869
+	        pad: function (data, blockSize) {
3870
+	            // Shortcut
3871
+	            var blockSizeBytes = blockSize * 4;
3872
+
3873
+	            // Count padding bytes
3874
+	            var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
3875
+
3876
+	            // Create padding word
3877
+	            var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
3878
+
3879
+	            // Create padding
3880
+	            var paddingWords = [];
3881
+	            for (var i = 0; i < nPaddingBytes; i += 4) {
3882
+	                paddingWords.push(paddingWord);
3883
+	            }
3884
+	            var padding = WordArray.create(paddingWords, nPaddingBytes);
3885
+
3886
+	            // Add padding
3887
+	            data.concat(padding);
3888
+	        },
3889
+
3890
+	        /**
3891
+	         * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
3892
+	         *
3893
+	         * @param {WordArray} data The data to unpad.
3894
+	         *
3895
+	         * @static
3896
+	         *
3897
+	         * @example
3898
+	         *
3899
+	         *     CryptoJS.pad.Pkcs7.unpad(wordArray);
3900
+	         */
3901
+	        unpad: function (data) {
3902
+	            // Get number of padding bytes from last byte
3903
+	            var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
3904
+
3905
+	            // Remove padding
3906
+	            data.sigBytes -= nPaddingBytes;
3907
+	        }
3908
+	    };
3909
+
3910
+	    /**
3911
+	     * Abstract base block cipher template.
3912
+	     *
3913
+	     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
3914
+	     */
3915
+	    var BlockCipher = C_lib.BlockCipher = Cipher.extend({
3916
+	        /**
3917
+	         * Configuration options.
3918
+	         *
3919
+	         * @property {Mode} mode The block mode to use. Default: CBC
3920
+	         * @property {Padding} padding The padding strategy to use. Default: Pkcs7
3921
+	         */
3922
+	        cfg: Cipher.cfg.extend({
3923
+	            mode: CBC,
3924
+	            padding: Pkcs7
3925
+	        }),
3926
+
3927
+	        reset: function () {
3928
+	            var modeCreator;
3929
+
3930
+	            // Reset cipher
3931
+	            Cipher.reset.call(this);
3932
+
3933
+	            // Shortcuts
3934
+	            var cfg = this.cfg;
3935
+	            var iv = cfg.iv;
3936
+	            var mode = cfg.mode;
3937
+
3938
+	            // Reset block mode
3939
+	            if (this._xformMode == this._ENC_XFORM_MODE) {
3940
+	                modeCreator = mode.createEncryptor;
3941
+	            } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
3942
+	                modeCreator = mode.createDecryptor;
3943
+	                // Keep at least one block in the buffer for unpadding
3944
+	                this._minBufferSize = 1;
3945
+	            }
3946
+
3947
+	            if (this._mode && this._mode.__creator == modeCreator) {
3948
+	                this._mode.init(this, iv && iv.words);
3949
+	            } else {
3950
+	                this._mode = modeCreator.call(mode, this, iv && iv.words);
3951
+	                this._mode.__creator = modeCreator;
3952
+	            }
3953
+	        },
3954
+
3955
+	        _doProcessBlock: function (words, offset) {
3956
+	            this._mode.processBlock(words, offset);
3957
+	        },
3958
+
3959
+	        _doFinalize: function () {
3960
+	            var finalProcessedBlocks;
3961
+
3962
+	            // Shortcut
3963
+	            var padding = this.cfg.padding;
3964
+
3965
+	            // Finalize
3966
+	            if (this._xformMode == this._ENC_XFORM_MODE) {
3967
+	                // Pad data
3968
+	                padding.pad(this._data, this.blockSize);
3969
+
3970
+	                // Process final blocks
3971
+	                finalProcessedBlocks = this._process(!!'flush');
3972
+	            } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
3973
+	                // Process final blocks
3974
+	                finalProcessedBlocks = this._process(!!'flush');
3975
+
3976
+	                // Unpad data
3977
+	                padding.unpad(finalProcessedBlocks);
3978
+	            }
3979
+
3980
+	            return finalProcessedBlocks;
3981
+	        },
3982
+
3983
+	        blockSize: 128/32
3984
+	    });
3985
+
3986
+	    /**
3987
+	     * A collection of cipher parameters.
3988
+	     *
3989
+	     * @property {WordArray} ciphertext The raw ciphertext.
3990
+	     * @property {WordArray} key The key to this ciphertext.
3991
+	     * @property {WordArray} iv The IV used in the ciphering operation.
3992
+	     * @property {WordArray} salt The salt used with a key derivation function.
3993
+	     * @property {Cipher} algorithm The cipher algorithm.
3994
+	     * @property {Mode} mode The block mode used in the ciphering operation.
3995
+	     * @property {Padding} padding The padding scheme used in the ciphering operation.
3996
+	     * @property {number} blockSize The block size of the cipher.
3997
+	     * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
3998
+	     */
3999
+	    var CipherParams = C_lib.CipherParams = Base.extend({
4000
+	        /**
4001
+	         * Initializes a newly created cipher params object.
4002
+	         *
4003
+	         * @param {Object} cipherParams An object with any of the possible cipher parameters.
4004
+	         *
4005
+	         * @example
4006
+	         *
4007
+	         *     var cipherParams = CryptoJS.lib.CipherParams.create({
4008
+	         *         ciphertext: ciphertextWordArray,
4009
+	         *         key: keyWordArray,
4010
+	         *         iv: ivWordArray,
4011
+	         *         salt: saltWordArray,
4012
+	         *         algorithm: CryptoJS.algo.AES,
4013
+	         *         mode: CryptoJS.mode.CBC,
4014
+	         *         padding: CryptoJS.pad.PKCS7,
4015
+	         *         blockSize: 4,
4016
+	         *         formatter: CryptoJS.format.OpenSSL
4017
+	         *     });
4018
+	         */
4019
+	        init: function (cipherParams) {
4020
+	            this.mixIn(cipherParams);
4021
+	        },
4022
+
4023
+	        /**
4024
+	         * Converts this cipher params object to a string.
4025
+	         *
4026
+	         * @param {Format} formatter (Optional) The formatting strategy to use.
4027
+	         *
4028
+	         * @return {string} The stringified cipher params.
4029
+	         *
4030
+	         * @throws Error If neither the formatter nor the default formatter is set.
4031
+	         *
4032
+	         * @example
4033
+	         *
4034
+	         *     var string = cipherParams + '';
4035
+	         *     var string = cipherParams.toString();
4036
+	         *     var string = cipherParams.toString(CryptoJS.format.OpenSSL);
4037
+	         */
4038
+	        toString: function (formatter) {
4039
+	            return (formatter || this.formatter).stringify(this);
4040
+	        }
4041
+	    });
4042
+
4043
+	    /**
4044
+	     * Format namespace.
4045
+	     */
4046
+	    var C_format = C.format = {};
4047
+
4048
+	    /**
4049
+	     * OpenSSL formatting strategy.
4050
+	     */
4051
+	    var OpenSSLFormatter = C_format.OpenSSL = {
4052
+	        /**
4053
+	         * Converts a cipher params object to an OpenSSL-compatible string.
4054
+	         *
4055
+	         * @param {CipherParams} cipherParams The cipher params object.
4056
+	         *
4057
+	         * @return {string} The OpenSSL-compatible string.
4058
+	         *
4059
+	         * @static
4060
+	         *
4061
+	         * @example
4062
+	         *
4063
+	         *     var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
4064
+	         */
4065
+	        stringify: function (cipherParams) {
4066
+	            var wordArray;
4067
+
4068
+	            // Shortcuts
4069
+	            var ciphertext = cipherParams.ciphertext;
4070
+	            var salt = cipherParams.salt;
4071
+
4072
+	            // Format
4073
+	            if (salt) {
4074
+	                wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
4075
+	            } else {
4076
+	                wordArray = ciphertext;
4077
+	            }
4078
+
4079
+	            return wordArray.toString(Base64);
4080
+	        },
4081
+
4082
+	        /**
4083
+	         * Converts an OpenSSL-compatible string to a cipher params object.
4084
+	         *
4085
+	         * @param {string} openSSLStr The OpenSSL-compatible string.
4086
+	         *
4087
+	         * @return {CipherParams} The cipher params object.
4088
+	         *
4089
+	         * @static
4090
+	         *
4091
+	         * @example
4092
+	         *
4093
+	         *     var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
4094
+	         */
4095
+	        parse: function (openSSLStr) {
4096
+	            var salt;
4097
+
4098
+	            // Parse base64
4099
+	            var ciphertext = Base64.parse(openSSLStr);
4100
+
4101
+	            // Shortcut
4102
+	            var ciphertextWords = ciphertext.words;
4103
+
4104
+	            // Test for salt
4105
+	            if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
4106
+	                // Extract salt
4107
+	                salt = WordArray.create(ciphertextWords.slice(2, 4));
4108
+
4109
+	                // Remove salt from ciphertext
4110
+	                ciphertextWords.splice(0, 4);
4111
+	                ciphertext.sigBytes -= 16;
4112
+	            }
4113
+
4114
+	            return CipherParams.create({ ciphertext: ciphertext, salt: salt });
4115
+	        }
4116
+	    };
4117
+
4118
+	    /**
4119
+	     * A cipher wrapper that returns ciphertext as a serializable cipher params object.
4120
+	     */
4121
+	    var SerializableCipher = C_lib.SerializableCipher = Base.extend({
4122
+	        /**
4123
+	         * Configuration options.
4124
+	         *
4125
+	         * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
4126
+	         */
4127
+	        cfg: Base.extend({
4128
+	            format: OpenSSLFormatter
4129
+	        }),
4130
+
4131
+	        /**
4132
+	         * Encrypts a message.
4133
+	         *
4134
+	         * @param {Cipher} cipher The cipher algorithm to use.
4135
+	         * @param {WordArray|string} message The message to encrypt.
4136
+	         * @param {WordArray} key The key.
4137
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
4138
+	         *
4139
+	         * @return {CipherParams} A cipher params object.
4140
+	         *
4141
+	         * @static
4142
+	         *
4143
+	         * @example
4144
+	         *
4145
+	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
4146
+	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
4147
+	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
4148
+	         */
4149
+	        encrypt: function (cipher, message, key, cfg) {
4150
+	            // Apply config defaults
4151
+	            cfg = this.cfg.extend(cfg);
4152
+
4153
+	            // Encrypt
4154
+	            var encryptor = cipher.createEncryptor(key, cfg);
4155
+	            var ciphertext = encryptor.finalize(message);
4156
+
4157
+	            // Shortcut
4158
+	            var cipherCfg = encryptor.cfg;
4159
+
4160
+	            // Create and return serializable cipher params
4161
+	            return CipherParams.create({
4162
+	                ciphertext: ciphertext,
4163
+	                key: key,
4164
+	                iv: cipherCfg.iv,
4165
+	                algorithm: cipher,
4166
+	                mode: cipherCfg.mode,
4167
+	                padding: cipherCfg.padding,
4168
+	                blockSize: cipher.blockSize,
4169
+	                formatter: cfg.format
4170
+	            });
4171
+	        },
4172
+
4173
+	        /**
4174
+	         * Decrypts serialized ciphertext.
4175
+	         *
4176
+	         * @param {Cipher} cipher The cipher algorithm to use.
4177
+	         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
4178
+	         * @param {WordArray} key The key.
4179
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
4180
+	         *
4181
+	         * @return {WordArray} The plaintext.
4182
+	         *
4183
+	         * @static
4184
+	         *
4185
+	         * @example
4186
+	         *
4187
+	         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
4188
+	         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
4189
+	         */
4190
+	        decrypt: function (cipher, ciphertext, key, cfg) {
4191
+	            // Apply config defaults
4192
+	            cfg = this.cfg.extend(cfg);
4193
+
4194
+	            // Convert string to CipherParams
4195
+	            ciphertext = this._parse(ciphertext, cfg.format);
4196
+
4197
+	            // Decrypt
4198
+	            var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
4199
+
4200
+	            return plaintext;
4201
+	        },
4202
+
4203
+	        /**
4204
+	         * Converts serialized ciphertext to CipherParams,
4205
+	         * else assumed CipherParams already and returns ciphertext unchanged.
4206
+	         *
4207
+	         * @param {CipherParams|string} ciphertext The ciphertext.
4208
+	         * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
4209
+	         *
4210
+	         * @return {CipherParams} The unserialized ciphertext.
4211
+	         *
4212
+	         * @static
4213
+	         *
4214
+	         * @example
4215
+	         *
4216
+	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
4217
+	         */
4218
+	        _parse: function (ciphertext, format) {
4219
+	            if (typeof ciphertext == 'string') {
4220
+	                return format.parse(ciphertext, this);
4221
+	            } else {
4222
+	                return ciphertext;
4223
+	            }
4224
+	        }
4225
+	    });
4226
+
4227
+	    /**
4228
+	     * Key derivation function namespace.
4229
+	     */
4230
+	    var C_kdf = C.kdf = {};
4231
+
4232
+	    /**
4233
+	     * OpenSSL key derivation function.
4234
+	     */
4235
+	    var OpenSSLKdf = C_kdf.OpenSSL = {
4236
+	        /**
4237
+	         * Derives a key and IV from a password.
4238
+	         *
4239
+	         * @param {string} password The password to derive from.
4240
+	         * @param {number} keySize The size in words of the key to generate.
4241
+	         * @param {number} ivSize The size in words of the IV to generate.
4242
+	         * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
4243
+	         *
4244
+	         * @return {CipherParams} A cipher params object with the key, IV, and salt.
4245
+	         *
4246
+	         * @static
4247
+	         *
4248
+	         * @example
4249
+	         *
4250
+	         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
4251
+	         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
4252
+	         */
4253
+	        execute: function (password, keySize, ivSize, salt) {
4254
+	            // Generate random salt
4255
+	            if (!salt) {
4256
+	                salt = WordArray.random(64/8);
4257
+	            }
4258
+
4259
+	            // Derive key and IV
4260
+	            var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
4261
+
4262
+	            // Separate key and IV
4263
+	            var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
4264
+	            key.sigBytes = keySize * 4;
4265
+
4266
+	            // Return params
4267
+	            return CipherParams.create({ key: key, iv: iv, salt: salt });
4268
+	        }
4269
+	    };
4270
+
4271
+	    /**
4272
+	     * A serializable cipher wrapper that derives the key from a password,
4273
+	     * and returns ciphertext as a serializable cipher params object.
4274
+	     */
4275
+	    var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
4276
+	        /**
4277
+	         * Configuration options.
4278
+	         *
4279
+	         * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
4280
+	         */
4281
+	        cfg: SerializableCipher.cfg.extend({
4282
+	            kdf: OpenSSLKdf
4283
+	        }),
4284
+
4285
+	        /**
4286
+	         * Encrypts a message using a password.
4287
+	         *
4288
+	         * @param {Cipher} cipher The cipher algorithm to use.
4289
+	         * @param {WordArray|string} message The message to encrypt.
4290
+	         * @param {string} password The password.
4291
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
4292
+	         *
4293
+	         * @return {CipherParams} A cipher params object.
4294
+	         *
4295
+	         * @static
4296
+	         *
4297
+	         * @example
4298
+	         *
4299
+	         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
4300
+	         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
4301
+	         */
4302
+	        encrypt: function (cipher, message, password, cfg) {
4303
+	            // Apply config defaults
4304
+	            cfg = this.cfg.extend(cfg);
4305
+
4306
+	            // Derive key and other params
4307
+	            var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
4308
+
4309
+	            // Add IV to config
4310
+	            cfg.iv = derivedParams.iv;
4311
+
4312
+	            // Encrypt
4313
+	            var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
4314
+
4315
+	            // Mix in derived params
4316
+	            ciphertext.mixIn(derivedParams);
4317
+
4318
+	            return ciphertext;
4319
+	        },
4320
+
4321
+	        /**
4322
+	         * Decrypts serialized ciphertext using a password.
4323
+	         *
4324
+	         * @param {Cipher} cipher The cipher algorithm to use.
4325
+	         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
4326
+	         * @param {string} password The password.
4327
+	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
4328
+	         *
4329
+	         * @return {WordArray} The plaintext.
4330
+	         *
4331
+	         * @static
4332
+	         *
4333
+	         * @example
4334
+	         *
4335
+	         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
4336
+	         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
4337
+	         */
4338
+	        decrypt: function (cipher, ciphertext, password, cfg) {
4339
+	            // Apply config defaults
4340
+	            cfg = this.cfg.extend(cfg);
4341
+
4342
+	            // Convert string to CipherParams
4343
+	            ciphertext = this._parse(ciphertext, cfg.format);
4344
+
4345
+	            // Derive key and other params
4346
+	            var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
4347
+
4348
+	            // Add IV to config
4349
+	            cfg.iv = derivedParams.iv;
4350
+
4351
+	            // Decrypt
4352
+	            var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
4353
+
4354
+	            return plaintext;
4355
+	        }
4356
+	    });
4357
+	}());
4358
+
4359
+
4360
+	/**
4361
+	 * Cipher Feedback block mode.
4362
+	 */
4363
+	CryptoJS.mode.CFB = (function () {
4364
+	    var CFB = CryptoJS.lib.BlockCipherMode.extend();
4365
+
4366
+	    CFB.Encryptor = CFB.extend({
4367
+	        processBlock: function (words, offset) {
4368
+	            // Shortcuts
4369
+	            var cipher = this._cipher;
4370
+	            var blockSize = cipher.blockSize;
4371
+
4372
+	            generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
4373
+
4374
+	            // Remember this block to use with next block
4375
+	            this._prevBlock = words.slice(offset, offset + blockSize);
4376
+	        }
4377
+	    });
4378
+
4379
+	    CFB.Decryptor = CFB.extend({
4380
+	        processBlock: function (words, offset) {
4381
+	            // Shortcuts
4382
+	            var cipher = this._cipher;
4383
+	            var blockSize = cipher.blockSize;
4384
+
4385
+	            // Remember this block to use with next block
4386
+	            var thisBlock = words.slice(offset, offset + blockSize);
4387
+
4388
+	            generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
4389
+
4390
+	            // This block becomes the previous block
4391
+	            this._prevBlock = thisBlock;
4392
+	        }
4393
+	    });
4394
+
4395
+	    function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
4396
+	        var keystream;
4397
+
4398
+	        // Shortcut
4399
+	        var iv = this._iv;
4400
+
4401
+	        // Generate keystream
4402
+	        if (iv) {
4403
+	            keystream = iv.slice(0);
4404
+
4405
+	            // Remove IV for subsequent blocks
4406
+	            this._iv = undefined;
4407
+	        } else {
4408
+	            keystream = this._prevBlock;
4409
+	        }
4410
+	        cipher.encryptBlock(keystream, 0);
4411
+
4412
+	        // Encrypt
4413
+	        for (var i = 0; i < blockSize; i++) {
4414
+	            words[offset + i] ^= keystream[i];
4415
+	        }
4416
+	    }
4417
+
4418
+	    return CFB;
4419
+	}());
4420
+
4421
+
4422
+	/**
4423
+	 * Counter block mode.
4424
+	 */
4425
+	CryptoJS.mode.CTR = (function () {
4426
+	    var CTR = CryptoJS.lib.BlockCipherMode.extend();
4427
+
4428
+	    var Encryptor = CTR.Encryptor = CTR.extend({
4429
+	        processBlock: function (words, offset) {
4430
+	            // Shortcuts
4431
+	            var cipher = this._cipher
4432
+	            var blockSize = cipher.blockSize;
4433
+	            var iv = this._iv;
4434
+	            var counter = this._counter;
4435
+
4436
+	            // Generate keystream
4437
+	            if (iv) {
4438
+	                counter = this._counter = iv.slice(0);
4439
+
4440
+	                // Remove IV for subsequent blocks
4441
+	                this._iv = undefined;
4442
+	            }
4443
+	            var keystream = counter.slice(0);
4444
+	            cipher.encryptBlock(keystream, 0);
4445
+
4446
+	            // Increment counter
4447
+	            counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
4448
+
4449
+	            // Encrypt
4450
+	            for (var i = 0; i < blockSize; i++) {
4451
+	                words[offset + i] ^= keystream[i];
4452
+	            }
4453
+	        }
4454
+	    });
4455
+
4456
+	    CTR.Decryptor = Encryptor;
4457
+
4458
+	    return CTR;
4459
+	}());
4460
+
4461
+
4462
+	/** @preserve
4463
+	 * Counter block mode compatible with  Dr Brian Gladman fileenc.c
4464
+	 * derived from CryptoJS.mode.CTR
4465
+	 * Jan Hruby jhruby.web@gmail.com
4466
+	 */
4467
+	CryptoJS.mode.CTRGladman = (function () {
4468
+	    var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
4469
+
4470
+		function incWord(word)
4471
+		{
4472
+			if (((word >> 24) & 0xff) === 0xff) { //overflow
4473
+			var b1 = (word >> 16)&0xff;
4474
+			var b2 = (word >> 8)&0xff;
4475
+			var b3 = word & 0xff;
4476
+
4477
+			if (b1 === 0xff) // overflow b1
4478
+			{
4479
+			b1 = 0;
4480
+			if (b2 === 0xff)
4481
+			{
4482
+				b2 = 0;
4483
+				if (b3 === 0xff)
4484
+				{
4485
+					b3 = 0;
4486
+				}
4487
+				else
4488
+				{
4489
+					++b3;
4490
+				}
4491
+			}
4492
+			else
4493
+			{
4494
+				++b2;
4495
+			}
4496
+			}
4497
+			else
4498
+			{
4499
+			++b1;
4500
+			}
4501
+
4502
+			word = 0;
4503
+			word += (b1 << 16);
4504
+			word += (b2 << 8);
4505
+			word += b3;
4506
+			}
4507
+			else
4508
+			{
4509
+			word += (0x01 << 24);
4510
+			}
4511
+			return word;
4512
+		}
4513
+
4514
+		function incCounter(counter)
4515
+		{
4516
+			if ((counter[0] = incWord(counter[0])) === 0)
4517
+			{
4518
+				// encr_data in fileenc.c from  Dr Brian Gladman's counts only with DWORD j < 8
4519
+				counter[1] = incWord(counter[1]);
4520
+			}
4521
+			return counter;
4522
+		}
4523
+
4524
+	    var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
4525
+	        processBlock: function (words, offset) {
4526
+	            // Shortcuts
4527
+	            var cipher = this._cipher
4528
+	            var blockSize = cipher.blockSize;
4529
+	            var iv = this._iv;
4530
+	            var counter = this._counter;
4531
+
4532
+	            // Generate keystream
4533
+	            if (iv) {
4534
+	                counter = this._counter = iv.slice(0);
4535
+
4536
+	                // Remove IV for subsequent blocks
4537
+	                this._iv = undefined;
4538
+	            }
4539
+
4540
+				incCounter(counter);
4541
+
4542
+				var keystream = counter.slice(0);
4543
+	            cipher.encryptBlock(keystream, 0);
4544
+
4545
+	            // Encrypt
4546
+	            for (var i = 0; i < blockSize; i++) {
4547
+	                words[offset + i] ^= keystream[i];
4548
+	            }
4549
+	        }
4550
+	    });
4551
+
4552
+	    CTRGladman.Decryptor = Encryptor;
4553
+
4554
+	    return CTRGladman;
4555
+	}());
4556
+
4557
+
4558
+
4559
+
4560
+	/**
4561
+	 * Output Feedback block mode.
4562
+	 */
4563
+	CryptoJS.mode.OFB = (function () {
4564
+	    var OFB = CryptoJS.lib.BlockCipherMode.extend();
4565
+
4566
+	    var Encryptor = OFB.Encryptor = OFB.extend({
4567
+	        processBlock: function (words, offset) {
4568
+	            // Shortcuts
4569
+	            var cipher = this._cipher
4570
+	            var blockSize = cipher.blockSize;
4571
+	            var iv = this._iv;
4572
+	            var keystream = this._keystream;
4573
+
4574
+	            // Generate keystream
4575
+	            if (iv) {
4576
+	                keystream = this._keystream = iv.slice(0);
4577
+
4578
+	                // Remove IV for subsequent blocks
4579
+	                this._iv = undefined;
4580
+	            }
4581
+	            cipher.encryptBlock(keystream, 0);
4582
+
4583
+	            // Encrypt
4584
+	            for (var i = 0; i < blockSize; i++) {
4585
+	                words[offset + i] ^= keystream[i];
4586
+	            }
4587
+	        }
4588
+	    });
4589
+
4590
+	    OFB.Decryptor = Encryptor;
4591
+
4592
+	    return OFB;
4593
+	}());
4594
+
4595
+
4596
+	/**
4597
+	 * Electronic Codebook block mode.
4598
+	 */
4599
+	CryptoJS.mode.ECB = (function () {
4600
+	    var ECB = CryptoJS.lib.BlockCipherMode.extend();
4601
+
4602
+	    ECB.Encryptor = ECB.extend({
4603
+	        processBlock: function (words, offset) {
4604
+	            this._cipher.encryptBlock(words, offset);
4605
+	        }
4606
+	    });
4607
+
4608
+	    ECB.Decryptor = ECB.extend({
4609
+	        processBlock: function (words, offset) {
4610
+	            this._cipher.decryptBlock(words, offset);
4611
+	        }
4612
+	    });
4613
+
4614
+	    return ECB;
4615
+	}());
4616
+
4617
+
4618
+	/**
4619
+	 * ANSI X.923 padding strategy.
4620
+	 */
4621
+	CryptoJS.pad.AnsiX923 = {
4622
+	    pad: function (data, blockSize) {
4623
+	        // Shortcuts
4624
+	        var dataSigBytes = data.sigBytes;
4625
+	        var blockSizeBytes = blockSize * 4;
4626
+
4627
+	        // Count padding bytes
4628
+	        var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
4629
+
4630
+	        // Compute last byte position
4631
+	        var lastBytePos = dataSigBytes + nPaddingBytes - 1;
4632
+
4633
+	        // Pad
4634
+	        data.clamp();
4635
+	        data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
4636
+	        data.sigBytes += nPaddingBytes;
4637
+	    },
4638
+
4639
+	    unpad: function (data) {
4640
+	        // Get number of padding bytes from last byte
4641
+	        var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
4642
+
4643
+	        // Remove padding
4644
+	        data.sigBytes -= nPaddingBytes;
4645
+	    }
4646
+	};
4647
+
4648
+
4649
+	/**
4650
+	 * ISO 10126 padding strategy.
4651
+	 */
4652
+	CryptoJS.pad.Iso10126 = {
4653
+	    pad: function (data, blockSize) {
4654
+	        // Shortcut
4655
+	        var blockSizeBytes = blockSize * 4;
4656
+
4657
+	        // Count padding bytes
4658
+	        var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
4659
+
4660
+	        // Pad
4661
+	        data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
4662
+	             concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
4663
+	    },
4664
+
4665
+	    unpad: function (data) {
4666
+	        // Get number of padding bytes from last byte
4667
+	        var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
4668
+
4669
+	        // Remove padding
4670
+	        data.sigBytes -= nPaddingBytes;
4671
+	    }
4672
+	};
4673
+
4674
+
4675
+	/**
4676
+	 * ISO/IEC 9797-1 Padding Method 2.
4677
+	 */
4678
+	CryptoJS.pad.Iso97971 = {
4679
+	    pad: function (data, blockSize) {
4680
+	        // Add 0x80 byte
4681
+	        data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
4682
+
4683
+	        // Zero pad the rest
4684
+	        CryptoJS.pad.ZeroPadding.pad(data, blockSize);
4685
+	    },
4686
+
4687
+	    unpad: function (data) {
4688
+	        // Remove zero padding
4689
+	        CryptoJS.pad.ZeroPadding.unpad(data);
4690
+
4691
+	        // Remove one more byte -- the 0x80 byte
4692
+	        data.sigBytes--;
4693
+	    }
4694
+	};
4695
+
4696
+
4697
+	/**
4698
+	 * Zero padding strategy.
4699
+	 */
4700
+	CryptoJS.pad.ZeroPadding = {
4701
+	    pad: function (data, blockSize) {
4702
+	        // Shortcut
4703
+	        var blockSizeBytes = blockSize * 4;
4704
+
4705
+	        // Pad
4706
+	        data.clamp();
4707
+	        data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
4708
+	    },
4709
+
4710
+	    unpad: function (data) {
4711
+	        // Shortcut
4712
+	        var dataWords = data.words;
4713
+
4714
+	        // Unpad
4715
+	        var i = data.sigBytes - 1;
4716
+	        for (var i = data.sigBytes - 1; i >= 0; i--) {
4717
+	            if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
4718
+	                data.sigBytes = i + 1;
4719
+	                break;
4720
+	            }
4721
+	        }
4722
+	    }
4723
+	};
4724
+
4725
+
4726
+	/**
4727
+	 * A noop padding strategy.
4728
+	 */
4729
+	CryptoJS.pad.NoPadding = {
4730
+	    pad: function () {
4731
+	    },
4732
+
4733
+	    unpad: function () {
4734
+	    }
4735
+	};
4736
+
4737
+
4738
+	(function (undefined) {
4739
+	    // Shortcuts
4740
+	    var C = CryptoJS;
4741
+	    var C_lib = C.lib;
4742
+	    var CipherParams = C_lib.CipherParams;
4743
+	    var C_enc = C.enc;
4744
+	    var Hex = C_enc.Hex;
4745
+	    var C_format = C.format;
4746
+
4747
+	    var HexFormatter = C_format.Hex = {
4748
+	        /**
4749
+	         * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
4750
+	         *
4751
+	         * @param {CipherParams} cipherParams The cipher params object.
4752
+	         *
4753
+	         * @return {string} The hexadecimally encoded string.
4754
+	         *
4755
+	         * @static
4756
+	         *
4757
+	         * @example
4758
+	         *
4759
+	         *     var hexString = CryptoJS.format.Hex.stringify(cipherParams);
4760
+	         */
4761
+	        stringify: function (cipherParams) {
4762
+	            return cipherParams.ciphertext.toString(Hex);
4763
+	        },
4764
+
4765
+	        /**
4766
+	         * Converts a hexadecimally encoded ciphertext string to a cipher params object.
4767
+	         *
4768
+	         * @param {string} input The hexadecimally encoded string.
4769
+	         *
4770
+	         * @return {CipherParams} The cipher params object.
4771
+	         *
4772
+	         * @static
4773
+	         *
4774
+	         * @example
4775
+	         *
4776
+	         *     var cipherParams = CryptoJS.format.Hex.parse(hexString);
4777
+	         */
4778
+	        parse: function (input) {
4779
+	            var ciphertext = Hex.parse(input);
4780
+	            return CipherParams.create({ ciphertext: ciphertext });
4781
+	        }
4782
+	    };
4783
+	}());
4784
+
4785
+
4786
+	(function () {
4787
+	    // Shortcuts
4788
+	    var C = CryptoJS;
4789
+	    var C_lib = C.lib;
4790
+	    var BlockCipher = C_lib.BlockCipher;
4791
+	    var C_algo = C.algo;
4792
+
4793
+	    // Lookup tables
4794
+	    var SBOX = [];
4795
+	    var INV_SBOX = [];
4796
+	    var SUB_MIX_0 = [];
4797
+	    var SUB_MIX_1 = [];
4798
+	    var SUB_MIX_2 = [];
4799
+	    var SUB_MIX_3 = [];
4800
+	    var INV_SUB_MIX_0 = [];
4801
+	    var INV_SUB_MIX_1 = [];
4802
+	    var INV_SUB_MIX_2 = [];
4803
+	    var INV_SUB_MIX_3 = [];
4804
+
4805
+	    // Compute lookup tables
4806
+	    (function () {
4807
+	        // Compute double table
4808
+	        var d = [];
4809
+	        for (var i = 0; i < 256; i++) {
4810
+	            if (i < 128) {
4811
+	                d[i] = i << 1;
4812
+	            } else {
4813
+	                d[i] = (i << 1) ^ 0x11b;
4814
+	            }
4815
+	        }
4816
+
4817
+	        // Walk GF(2^8)
4818
+	        var x = 0;
4819
+	        var xi = 0;
4820
+	        for (var i = 0; i < 256; i++) {
4821
+	            // Compute sbox
4822
+	            var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
4823
+	            sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
4824
+	            SBOX[x] = sx;
4825
+	            INV_SBOX[sx] = x;
4826
+
4827
+	            // Compute multiplication
4828
+	            var x2 = d[x];
4829
+	            var x4 = d[x2];
4830
+	            var x8 = d[x4];
4831
+
4832
+	            // Compute sub bytes, mix columns tables
4833
+	            var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
4834
+	            SUB_MIX_0[x] = (t << 24) | (t >>> 8);
4835
+	            SUB_MIX_1[x] = (t << 16) | (t >>> 16);
4836
+	            SUB_MIX_2[x] = (t << 8)  | (t >>> 24);
4837
+	            SUB_MIX_3[x] = t;
4838
+
4839
+	            // Compute inv sub bytes, inv mix columns tables
4840
+	            var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
4841
+	            INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
4842
+	            INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
4843
+	            INV_SUB_MIX_2[sx] = (t << 8)  | (t >>> 24);
4844
+	            INV_SUB_MIX_3[sx] = t;
4845
+
4846
+	            // Compute next counter
4847
+	            if (!x) {
4848
+	                x = xi = 1;
4849
+	            } else {
4850
+	                x = x2 ^ d[d[d[x8 ^ x2]]];
4851
+	                xi ^= d[d[xi]];
4852
+	            }
4853
+	        }
4854
+	    }());
4855
+
4856
+	    // Precomputed Rcon lookup
4857
+	    var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
4858
+
4859
+	    /**
4860
+	     * AES block cipher algorithm.
4861
+	     */
4862
+	    var AES = C_algo.AES = BlockCipher.extend({
4863
+	        _doReset: function () {
4864
+	            var t;
4865
+
4866
+	            // Skip reset of nRounds has been set before and key did not change
4867
+	            if (this._nRounds && this._keyPriorReset === this._key) {
4868
+	                return;
4869
+	            }
4870
+
4871
+	            // Shortcuts
4872
+	            var key = this._keyPriorReset = this._key;
4873
+	            var keyWords = key.words;
4874
+	            var keySize = key.sigBytes / 4;
4875
+
4876
+	            // Compute number of rounds
4877
+	            var nRounds = this._nRounds = keySize + 6;
4878
+
4879
+	            // Compute number of key schedule rows
4880
+	            var ksRows = (nRounds + 1) * 4;
4881
+
4882
+	            // Compute key schedule
4883
+	            var keySchedule = this._keySchedule = [];
4884
+	            for (var ksRow = 0; ksRow < ksRows; ksRow++) {
4885
+	                if (ksRow < keySize) {
4886
+	                    keySchedule[ksRow] = keyWords[ksRow];
4887
+	                } else {
4888
+	                    t = keySchedule[ksRow - 1];
4889
+
4890
+	                    if (!(ksRow % keySize)) {
4891
+	                        // Rot word
4892
+	                        t = (t << 8) | (t >>> 24);
4893
+
4894
+	                        // Sub word
4895
+	                        t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
4896
+
4897
+	                        // Mix Rcon
4898
+	                        t ^= RCON[(ksRow / keySize) | 0] << 24;
4899
+	                    } else if (keySize > 6 && ksRow % keySize == 4) {
4900
+	                        // Sub word
4901
+	                        t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
4902
+	                    }
4903
+
4904
+	                    keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
4905
+	                }
4906
+	            }
4907
+
4908
+	            // Compute inv key schedule
4909
+	            var invKeySchedule = this._invKeySchedule = [];
4910
+	            for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
4911
+	                var ksRow = ksRows - invKsRow;
4912
+
4913
+	                if (invKsRow % 4) {
4914
+	                    var t = keySchedule[ksRow];
4915
+	                } else {
4916
+	                    var t = keySchedule[ksRow - 4];
4917
+	                }
4918
+
4919
+	                if (invKsRow < 4 || ksRow <= 4) {
4920
+	                    invKeySchedule[invKsRow] = t;
4921
+	                } else {
4922
+	                    invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
4923
+	                                               INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
4924
+	                }
4925
+	            }
4926
+	        },
4927
+
4928
+	        encryptBlock: function (M, offset) {
4929
+	            this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
4930
+	        },
4931
+
4932
+	        decryptBlock: function (M, offset) {
4933
+	            // Swap 2nd and 4th rows
4934
+	            var t = M[offset + 1];
4935
+	            M[offset + 1] = M[offset + 3];
4936
+	            M[offset + 3] = t;
4937
+
4938
+	            this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
4939
+
4940
+	            // Inv swap 2nd and 4th rows
4941
+	            var t = M[offset + 1];
4942
+	            M[offset + 1] = M[offset + 3];
4943
+	            M[offset + 3] = t;
4944
+	        },
4945
+
4946
+	        _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
4947
+	            // Shortcut
4948
+	            var nRounds = this._nRounds;
4949
+
4950
+	            // Get input, add round key
4951
+	            var s0 = M[offset]     ^ keySchedule[0];
4952
+	            var s1 = M[offset + 1] ^ keySchedule[1];
4953
+	            var s2 = M[offset + 2] ^ keySchedule[2];
4954
+	            var s3 = M[offset + 3] ^ keySchedule[3];
4955
+
4956
+	            // Key schedule row counter
4957
+	            var ksRow = 4;
4958
+
4959
+	            // Rounds
4960
+	            for (var round = 1; round < nRounds; round++) {
4961
+	                // Shift rows, sub bytes, mix columns, add round key
4962
+	                var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
4963
+	                var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
4964
+	                var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
4965
+	                var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
4966
+
4967
+	                // Update state
4968
+	                s0 = t0;
4969
+	                s1 = t1;
4970
+	                s2 = t2;
4971
+	                s3 = t3;
4972
+	            }
4973
+
4974
+	            // Shift rows, sub bytes, add round key
4975
+	            var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
4976
+	            var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
4977
+	            var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
4978
+	            var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
4979
+
4980
+	            // Set output
4981
+	            M[offset]     = t0;
4982
+	            M[offset + 1] = t1;
4983
+	            M[offset + 2] = t2;
4984
+	            M[offset + 3] = t3;
4985
+	        },
4986
+
4987
+	        keySize: 256/32
4988
+	    });
4989
+
4990
+	    /**
4991
+	     * Shortcut functions to the cipher's object interface.
4992
+	     *
4993
+	     * @example
4994
+	     *
4995
+	     *     var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
4996
+	     *     var plaintext  = CryptoJS.AES.decrypt(ciphertext, key, cfg);
4997
+	     */
4998
+	    C.AES = BlockCipher._createHelper(AES);
4999
+	}());
5000
+
5001
+
5002
+	(function () {
5003
+	    // Shortcuts
5004
+	    var C = CryptoJS;
5005
+	    var C_lib = C.lib;
5006
+	    var WordArray = C_lib.WordArray;
5007
+	    var BlockCipher = C_lib.BlockCipher;
5008
+	    var C_algo = C.algo;
5009
+
5010
+	    // Permuted Choice 1 constants
5011
+	    var PC1 = [
5012
+	        57, 49, 41, 33, 25, 17, 9,  1,
5013
+	        58, 50, 42, 34, 26, 18, 10, 2,
5014
+	        59, 51, 43, 35, 27, 19, 11, 3,
5015
+	        60, 52, 44, 36, 63, 55, 47, 39,
5016
+	        31, 23, 15, 7,  62, 54, 46, 38,
5017
+	        30, 22, 14, 6,  61, 53, 45, 37,
5018
+	        29, 21, 13, 5,  28, 20, 12, 4
5019
+	    ];
5020
+
5021
+	    // Permuted Choice 2 constants
5022
+	    var PC2 = [
5023
+	        14, 17, 11, 24, 1,  5,
5024
+	        3,  28, 15, 6,  21, 10,
5025
+	        23, 19, 12, 4,  26, 8,
5026
+	        16, 7,  27, 20, 13, 2,
5027
+	        41, 52, 31, 37, 47, 55,
5028
+	        30, 40, 51, 45, 33, 48,
5029
+	        44, 49, 39, 56, 34, 53,
5030
+	        46, 42, 50, 36, 29, 32
5031
+	    ];
5032
+
5033
+	    // Cumulative bit shift constants
5034
+	    var BIT_SHIFTS = [1,  2,  4,  6,  8,  10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
5035
+
5036
+	    // SBOXes and round permutation constants
5037
+	    var SBOX_P = [
5038
+	        {
5039
+	            0x0: 0x808200,
5040
+	            0x10000000: 0x8000,
5041
+	            0x20000000: 0x808002,
5042
+	            0x30000000: 0x2,
5043
+	            0x40000000: 0x200,
5044
+	            0x50000000: 0x808202,
5045
+	            0x60000000: 0x800202,
5046
+	            0x70000000: 0x800000,
5047
+	            0x80000000: 0x202,
5048
+	            0x90000000: 0x800200,
5049
+	            0xa0000000: 0x8200,
5050
+	            0xb0000000: 0x808000,
5051
+	            0xc0000000: 0x8002,
5052
+	            0xd0000000: 0x800002,
5053
+	            0xe0000000: 0x0,
5054
+	            0xf0000000: 0x8202,
5055
+	            0x8000000: 0x0,
5056
+	            0x18000000: 0x808202,
5057
+	            0x28000000: 0x8202,
5058
+	            0x38000000: 0x8000,
5059
+	            0x48000000: 0x808200,
5060
+	            0x58000000: 0x200,
5061
+	            0x68000000: 0x808002,
5062
+	            0x78000000: 0x2,
5063
+	            0x88000000: 0x800200,
5064
+	            0x98000000: 0x8200,
5065
+	            0xa8000000: 0x808000,
5066
+	            0xb8000000: 0x800202,
5067
+	            0xc8000000: 0x800002,
5068
+	            0xd8000000: 0x8002,
5069
+	            0xe8000000: 0x202,
5070
+	            0xf8000000: 0x800000,
5071
+	            0x1: 0x8000,
5072
+	            0x10000001: 0x2,
5073
+	            0x20000001: 0x808200,
5074
+	            0x30000001: 0x800000,
5075
+	            0x40000001: 0x808002,
5076
+	            0x50000001: 0x8200,
5077
+	            0x60000001: 0x200,
5078
+	            0x70000001: 0x800202,
5079
+	            0x80000001: 0x808202,
5080
+	            0x90000001: 0x808000,
5081
+	            0xa0000001: 0x800002,
5082
+	            0xb0000001: 0x8202,
5083
+	            0xc0000001: 0x202,
5084
+	            0xd0000001: 0x800200,
5085
+	            0xe0000001: 0x8002,
5086
+	            0xf0000001: 0x0,
5087
+	            0x8000001: 0x808202,
5088
+	            0x18000001: 0x808000,
5089
+	            0x28000001: 0x800000,
5090
+	            0x38000001: 0x200,
5091
+	            0x48000001: 0x8000,
5092
+	            0x58000001: 0x800002,
5093
+	            0x68000001: 0x2,
5094
+	            0x78000001: 0x8202,
5095
+	            0x88000001: 0x8002,
5096
+	            0x98000001: 0x800202,
5097
+	            0xa8000001: 0x202,
5098
+	            0xb8000001: 0x808200,
5099
+	            0xc8000001: 0x800200,
5100
+	            0xd8000001: 0x0,
5101
+	            0xe8000001: 0x8200,
5102
+	            0xf8000001: 0x808002
5103
+	        },
5104
+	        {
5105
+	            0x0: 0x40084010,
5106
+	            0x1000000: 0x4000,
5107
+	            0x2000000: 0x80000,
5108
+	            0x3000000: 0x40080010,
5109
+	            0x4000000: 0x40000010,
5110
+	            0x5000000: 0x40084000,
5111
+	            0x6000000: 0x40004000,
5112
+	            0x7000000: 0x10,
5113
+	            0x8000000: 0x84000,
5114
+	            0x9000000: 0x40004010,
5115
+	            0xa000000: 0x40000000,
5116
+	            0xb000000: 0x84010,
5117
+	            0xc000000: 0x80010,
5118
+	            0xd000000: 0x0,
5119
+	            0xe000000: 0x4010,
5120
+	            0xf000000: 0x40080000,
5121
+	            0x800000: 0x40004000,
5122
+	            0x1800000: 0x84010,
5123
+	            0x2800000: 0x10,
5124
+	            0x3800000: 0x40004010,
5125
+	            0x4800000: 0x40084010,
5126
+	            0x5800000: 0x40000000,
5127
+	            0x6800000: 0x80000,
5128
+	            0x7800000: 0x40080010,
5129
+	            0x8800000: 0x80010,
5130
+	            0x9800000: 0x0,
5131
+	            0xa800000: 0x4000,
5132
+	            0xb800000: 0x40080000,
5133
+	            0xc800000: 0x40000010,
5134
+	            0xd800000: 0x84000,
5135
+	            0xe800000: 0x40084000,
5136
+	            0xf800000: 0x4010,
5137
+	            0x10000000: 0x0,
5138
+	            0x11000000: 0x40080010,
5139
+	            0x12000000: 0x40004010,
5140
+	            0x13000000: 0x40084000,
5141
+	            0x14000000: 0x40080000,
5142
+	            0x15000000: 0x10,
5143
+	            0x16000000: 0x84010,
5144
+	            0x17000000: 0x4000,
5145
+	            0x18000000: 0x4010,
5146
+	            0x19000000: 0x80000,
5147
+	            0x1a000000: 0x80010,
5148
+	            0x1b000000: 0x40000010,
5149
+	            0x1c000000: 0x84000,
5150
+	            0x1d000000: 0x40004000,
5151
+	            0x1e000000: 0x40000000,
5152
+	            0x1f000000: 0x40084010,
5153
+	            0x10800000: 0x84010,
5154
+	            0x11800000: 0x80000,
5155
+	            0x12800000: 0x40080000,
5156
+	            0x13800000: 0x4000,
5157
+	            0x14800000: 0x40004000,
5158
+	            0x15800000: 0x40084010,
5159
+	            0x16800000: 0x10,
5160
+	            0x17800000: 0x40000000,
5161
+	            0x18800000: 0x40084000,
5162
+	            0x19800000: 0x40000010,
5163
+	            0x1a800000: 0x40004010,
5164
+	            0x1b800000: 0x80010,
5165
+	            0x1c800000: 0x0,
5166
+	            0x1d800000: 0x4010,
5167
+	            0x1e800000: 0x40080010,
5168
+	            0x1f800000: 0x84000
5169
+	        },
5170
+	        {
5171
+	            0x0: 0x104,
5172
+	            0x100000: 0x0,
5173
+	            0x200000: 0x4000100,
5174
+	            0x300000: 0x10104,
5175
+	            0x400000: 0x10004,
5176
+	            0x500000: 0x4000004,
5177
+	            0x600000: 0x4010104,
5178
+	            0x700000: 0x4010000,
5179
+	            0x800000: 0x4000000,
5180
+	            0x900000: 0x4010100,
5181
+	            0xa00000: 0x10100,
5182
+	            0xb00000: 0x4010004,
5183
+	            0xc00000: 0x4000104,
5184
+	            0xd00000: 0x10000,
5185
+	            0xe00000: 0x4,
5186
+	            0xf00000: 0x100,
5187
+	            0x80000: 0x4010100,
5188
+	            0x180000: 0x4010004,
5189
+	            0x280000: 0x0,
5190
+	            0x380000: 0x4000100,
5191
+	            0x480000: 0x4000004,
5192
+	            0x580000: 0x10000,
5193
+	            0x680000: 0x10004,
5194
+	            0x780000: 0x104,
5195
+	            0x880000: 0x4,
5196
+	            0x980000: 0x100,
5197
+	            0xa80000: 0x4010000,
5198
+	            0xb80000: 0x10104,
5199
+	            0xc80000: 0x10100,
5200
+	            0xd80000: 0x4000104,
5201
+	            0xe80000: 0x4010104,
5202
+	            0xf80000: 0x4000000,
5203
+	            0x1000000: 0x4010100,
5204
+	            0x1100000: 0x10004,
5205
+	            0x1200000: 0x10000,
5206
+	            0x1300000: 0x4000100,
5207
+	            0x1400000: 0x100,
5208
+	            0x1500000: 0x4010104,
5209
+	            0x1600000: 0x4000004,
5210
+	            0x1700000: 0x0,
5211
+	            0x1800000: 0x4000104,
5212
+	            0x1900000: 0x4000000,
5213
+	            0x1a00000: 0x4,
5214
+	            0x1b00000: 0x10100,
5215
+	            0x1c00000: 0x4010000,
5216
+	            0x1d00000: 0x104,
5217
+	            0x1e00000: 0x10104,
5218
+	            0x1f00000: 0x4010004,
5219
+	            0x1080000: 0x4000000,
5220
+	            0x1180000: 0x104,
5221
+	            0x1280000: 0x4010100,
5222
+	            0x1380000: 0x0,
5223
+	            0x1480000: 0x10004,
5224
+	            0x1580000: 0x4000100,
5225
+	            0x1680000: 0x100,
5226
+	            0x1780000: 0x4010004,
5227
+	            0x1880000: 0x10000,
5228
+	            0x1980000: 0x4010104,
5229
+	            0x1a80000: 0x10104,
5230
+	            0x1b80000: 0x4000004,
5231
+	            0x1c80000: 0x4000104,
5232
+	            0x1d80000: 0x4010000,
5233
+	            0x1e80000: 0x4,
5234
+	            0x1f80000: 0x10100
5235
+	        },
5236
+	        {
5237
+	            0x0: 0x80401000,
5238
+	            0x10000: 0x80001040,
5239
+	            0x20000: 0x401040,
5240
+	            0x30000: 0x80400000,
5241
+	            0x40000: 0x0,
5242
+	            0x50000: 0x401000,
5243
+	            0x60000: 0x80000040,
5244
+	            0x70000: 0x400040,
5245
+	            0x80000: 0x80000000,
5246
+	            0x90000: 0x400000,
5247
+	            0xa0000: 0x40,
5248
+	            0xb0000: 0x80001000,
5249
+	            0xc0000: 0x80400040,
5250
+	            0xd0000: 0x1040,
5251
+	            0xe0000: 0x1000,
5252
+	            0xf0000: 0x80401040,
5253
+	            0x8000: 0x80001040,
5254
+	            0x18000: 0x40,
5255
+	            0x28000: 0x80400040,
5256
+	            0x38000: 0x80001000,
5257
+	            0x48000: 0x401000,
5258
+	            0x58000: 0x80401040,
5259
+	            0x68000: 0x0,
5260
+	            0x78000: 0x80400000,
5261
+	            0x88000: 0x1000,
5262
+	            0x98000: 0x80401000,
5263
+	            0xa8000: 0x400000,
5264
+	            0xb8000: 0x1040,
5265
+	            0xc8000: 0x80000000,
5266
+	            0xd8000: 0x400040,
5267
+	            0xe8000: 0x401040,
5268
+	            0xf8000: 0x80000040,
5269
+	            0x100000: 0x400040,
5270
+	            0x110000: 0x401000,
5271
+	            0x120000: 0x80000040,
5272
+	            0x130000: 0x0,
5273
+	            0x140000: 0x1040,
5274
+	            0x150000: 0x80400040,
5275
+	            0x160000: 0x80401000,
5276
+	            0x170000: 0x80001040,
5277
+	            0x180000: 0x80401040,
5278
+	            0x190000: 0x80000000,
5279
+	            0x1a0000: 0x80400000,
5280
+	            0x1b0000: 0x401040,
5281
+	            0x1c0000: 0x80001000,
5282
+	            0x1d0000: 0x400000,
5283
+	            0x1e0000: 0x40,
5284
+	            0x1f0000: 0x1000,
5285
+	            0x108000: 0x80400000,
5286
+	            0x118000: 0x80401040,
5287
+	            0x128000: 0x0,
5288
+	            0x138000: 0x401000,
5289
+	            0x148000: 0x400040,
5290
+	            0x158000: 0x80000000,
5291
+	            0x168000: 0x80001040,
5292
+	            0x178000: 0x40,
5293
+	            0x188000: 0x80000040,
5294
+	            0x198000: 0x1000,
5295
+	            0x1a8000: 0x80001000,
5296
+	            0x1b8000: 0x80400040,
5297
+	            0x1c8000: 0x1040,
5298
+	            0x1d8000: 0x80401000,
5299
+	            0x1e8000: 0x400000,
5300
+	            0x1f8000: 0x401040
5301
+	        },
5302
+	        {
5303
+	            0x0: 0x80,
5304
+	            0x1000: 0x1040000,
5305
+	            0x2000: 0x40000,
5306
+	            0x3000: 0x20000000,
5307
+	            0x4000: 0x20040080,
5308
+	            0x5000: 0x1000080,
5309
+	            0x6000: 0x21000080,
5310
+	            0x7000: 0x40080,
5311
+	            0x8000: 0x1000000,
5312
+	            0x9000: 0x20040000,
5313
+	            0xa000: 0x20000080,
5314
+	            0xb000: 0x21040080,
5315
+	            0xc000: 0x21040000,
5316
+	            0xd000: 0x0,
5317
+	            0xe000: 0x1040080,
5318
+	            0xf000: 0x21000000,
5319
+	            0x800: 0x1040080,
5320
+	            0x1800: 0x21000080,
5321
+	            0x2800: 0x80,
5322
+	            0x3800: 0x1040000,
5323
+	            0x4800: 0x40000,
5324
+	            0x5800: 0x20040080,
5325
+	            0x6800: 0x21040000,
5326
+	            0x7800: 0x20000000,
5327
+	            0x8800: 0x20040000,
5328
+	            0x9800: 0x0,
5329
+	            0xa800: 0x21040080,
5330
+	            0xb800: 0x1000080,
5331
+	            0xc800: 0x20000080,
5332
+	            0xd800: 0x21000000,
5333
+	            0xe800: 0x1000000,
5334
+	            0xf800: 0x40080,
5335
+	            0x10000: 0x40000,
5336
+	            0x11000: 0x80,
5337
+	            0x12000: 0x20000000,
5338
+	            0x13000: 0x21000080,
5339
+	            0x14000: 0x1000080,
5340
+	            0x15000: 0x21040000,
5341
+	            0x16000: 0x20040080,
5342
+	            0x17000: 0x1000000,
5343
+	            0x18000: 0x21040080,
5344
+	            0x19000: 0x21000000,
5345
+	            0x1a000: 0x1040000,
5346
+	            0x1b000: 0x20040000,
5347
+	            0x1c000: 0x40080,
5348
+	            0x1d000: 0x20000080,
5349
+	            0x1e000: 0x0,
5350
+	            0x1f000: 0x1040080,
5351
+	            0x10800: 0x21000080,
5352
+	            0x11800: 0x1000000,
5353
+	            0x12800: 0x1040000,
5354
+	            0x13800: 0x20040080,
5355
+	            0x14800: 0x20000000,
5356
+	            0x15800: 0x1040080,
5357
+	            0x16800: 0x80,
5358
+	            0x17800: 0x21040000,
5359
+	            0x18800: 0x40080,
5360
+	            0x19800: 0x21040080,
5361
+	            0x1a800: 0x0,
5362
+	            0x1b800: 0x21000000,
5363
+	            0x1c800: 0x1000080,
5364
+	            0x1d800: 0x40000,
5365
+	            0x1e800: 0x20040000,
5366
+	            0x1f800: 0x20000080
5367
+	        },
5368
+	        {
5369
+	            0x0: 0x10000008,
5370
+	            0x100: 0x2000,
5371
+	            0x200: 0x10200000,
5372
+	            0x300: 0x10202008,
5373
+	            0x400: 0x10002000,
5374
+	            0x500: 0x200000,
5375
+	            0x600: 0x200008,
5376
+	            0x700: 0x10000000,
5377
+	            0x800: 0x0,
5378
+	            0x900: 0x10002008,
5379
+	            0xa00: 0x202000,
5380
+	            0xb00: 0x8,
5381
+	            0xc00: 0x10200008,
5382
+	            0xd00: 0x202008,
5383
+	            0xe00: 0x2008,
5384
+	            0xf00: 0x10202000,
5385
+	            0x80: 0x10200000,
5386
+	            0x180: 0x10202008,
5387
+	            0x280: 0x8,
5388
+	            0x380: 0x200000,
5389
+	            0x480: 0x202008,
5390
+	            0x580: 0x10000008,
5391
+	            0x680: 0x10002000,
5392
+	            0x780: 0x2008,
5393
+	            0x880: 0x200008,
5394
+	            0x980: 0x2000,
5395
+	            0xa80: 0x10002008,
5396
+	            0xb80: 0x10200008,
5397
+	            0xc80: 0x0,
5398
+	            0xd80: 0x10202000,
5399
+	            0xe80: 0x202000,
5400
+	            0xf80: 0x10000000,
5401
+	            0x1000: 0x10002000,
5402
+	            0x1100: 0x10200008,
5403
+	            0x1200: 0x10202008,
5404
+	            0x1300: 0x2008,
5405
+	            0x1400: 0x200000,
5406
+	            0x1500: 0x10000000,
5407
+	            0x1600: 0x10000008,
5408
+	            0x1700: 0x202000,
5409
+	            0x1800: 0x202008,
5410
+	            0x1900: 0x0,
5411
+	            0x1a00: 0x8,
5412
+	            0x1b00: 0x10200000,
5413
+	            0x1c00: 0x2000,
5414
+	            0x1d00: 0x10002008,
5415
+	            0x1e00: 0x10202000,
5416
+	            0x1f00: 0x200008,
5417
+	            0x1080: 0x8,
5418
+	            0x1180: 0x202000,
5419
+	            0x1280: 0x200000,
5420
+	            0x1380: 0x10000008,
5421
+	            0x1480: 0x10002000,
5422
+	            0x1580: 0x2008,
5423
+	            0x1680: 0x10202008,
5424
+	            0x1780: 0x10200000,
5425
+	            0x1880: 0x10202000,
5426
+	            0x1980: 0x10200008,
5427
+	            0x1a80: 0x2000,
5428
+	            0x1b80: 0x202008,
5429
+	            0x1c80: 0x200008,
5430
+	            0x1d80: 0x0,
5431
+	            0x1e80: 0x10000000,
5432
+	            0x1f80: 0x10002008
5433
+	        },
5434
+	        {
5435
+	            0x0: 0x100000,
5436
+	            0x10: 0x2000401,
5437
+	            0x20: 0x400,
5438
+	            0x30: 0x100401,
5439
+	            0x40: 0x2100401,
5440
+	            0x50: 0x0,
5441
+	            0x60: 0x1,
5442
+	            0x70: 0x2100001,
5443
+	            0x80: 0x2000400,
5444
+	            0x90: 0x100001,
5445
+	            0xa0: 0x2000001,
5446
+	            0xb0: 0x2100400,
5447
+	            0xc0: 0x2100000,
5448
+	            0xd0: 0x401,
5449
+	            0xe0: 0x100400,
5450
+	            0xf0: 0x2000000,
5451
+	            0x8: 0x2100001,
5452
+	            0x18: 0x0,
5453
+	            0x28: 0x2000401,
5454
+	            0x38: 0x2100400,
5455
+	            0x48: 0x100000,
5456
+	            0x58: 0x2000001,
5457
+	            0x68: 0x2000000,
5458
+	            0x78: 0x401,
5459
+	            0x88: 0x100401,
5460
+	            0x98: 0x2000400,
5461
+	            0xa8: 0x2100000,
5462
+	            0xb8: 0x100001,
5463
+	            0xc8: 0x400,
5464
+	            0xd8: 0x2100401,
5465
+	            0xe8: 0x1,
5466
+	            0xf8: 0x100400,
5467
+	            0x100: 0x2000000,
5468
+	            0x110: 0x100000,
5469
+	            0x120: 0x2000401,
5470
+	            0x130: 0x2100001,
5471
+	            0x140: 0x100001,
5472
+	            0x150: 0x2000400,
5473
+	            0x160: 0x2100400,
5474
+	            0x170: 0x100401,
5475
+	            0x180: 0x401,
5476
+	            0x190: 0x2100401,
5477
+	            0x1a0: 0x100400,
5478
+	            0x1b0: 0x1,
5479
+	            0x1c0: 0x0,
5480
+	            0x1d0: 0x2100000,
5481
+	            0x1e0: 0x2000001,
5482
+	            0x1f0: 0x400,
5483
+	            0x108: 0x100400,
5484
+	            0x118: 0x2000401,
5485
+	            0x128: 0x2100001,
5486
+	            0x138: 0x1,
5487
+	            0x148: 0x2000000,
5488
+	            0x158: 0x100000,
5489
+	            0x168: 0x401,
5490
+	            0x178: 0x2100400,
5491
+	            0x188: 0x2000001,
5492
+	            0x198: 0x2100000,
5493
+	            0x1a8: 0x0,
5494
+	            0x1b8: 0x2100401,
5495
+	            0x1c8: 0x100401,
5496
+	            0x1d8: 0x400,
5497
+	            0x1e8: 0x2000400,
5498
+	            0x1f8: 0x100001
5499
+	        },
5500
+	        {
5501
+	            0x0: 0x8000820,
5502
+	            0x1: 0x20000,
5503
+	            0x2: 0x8000000,
5504
+	            0x3: 0x20,
5505
+	            0x4: 0x20020,
5506
+	            0x5: 0x8020820,
5507
+	            0x6: 0x8020800,
5508
+	            0x7: 0x800,
5509
+	            0x8: 0x8020000,
5510
+	            0x9: 0x8000800,
5511
+	            0xa: 0x20800,
5512
+	            0xb: 0x8020020,
5513
+	            0xc: 0x820,
5514
+	            0xd: 0x0,
5515
+	            0xe: 0x8000020,
5516
+	            0xf: 0x20820,
5517
+	            0x80000000: 0x800,
5518
+	            0x80000001: 0x8020820,
5519
+	            0x80000002: 0x8000820,
5520
+	            0x80000003: 0x8000000,
5521
+	            0x80000004: 0x8020000,
5522
+	            0x80000005: 0x20800,
5523
+	            0x80000006: 0x20820,
5524
+	            0x80000007: 0x20,
5525
+	            0x80000008: 0x8000020,
5526
+	            0x80000009: 0x820,
5527
+	            0x8000000a: 0x20020,
5528
+	            0x8000000b: 0x8020800,
5529
+	            0x8000000c: 0x0,
5530
+	            0x8000000d: 0x8020020,
5531
+	            0x8000000e: 0x8000800,
5532
+	            0x8000000f: 0x20000,
5533
+	            0x10: 0x20820,
5534
+	            0x11: 0x8020800,
5535
+	            0x12: 0x20,
5536
+	            0x13: 0x800,
5537
+	            0x14: 0x8000800,
5538
+	            0x15: 0x8000020,
5539
+	            0x16: 0x8020020,
5540
+	            0x17: 0x20000,
5541
+	            0x18: 0x0,
5542
+	            0x19: 0x20020,
5543
+	            0x1a: 0x8020000,
5544
+	            0x1b: 0x8000820,
5545
+	            0x1c: 0x8020820,
5546
+	            0x1d: 0x20800,
5547
+	            0x1e: 0x820,
5548
+	            0x1f: 0x8000000,
5549
+	            0x80000010: 0x20000,
5550
+	            0x80000011: 0x800,
5551
+	            0x80000012: 0x8020020,
5552
+	            0x80000013: 0x20820,
5553
+	            0x80000014: 0x20,
5554
+	            0x80000015: 0x8020000,
5555
+	            0x80000016: 0x8000000,
5556
+	            0x80000017: 0x8000820,
5557
+	            0x80000018: 0x8020820,
5558
+	            0x80000019: 0x8000020,
5559
+	            0x8000001a: 0x8000800,
5560
+	            0x8000001b: 0x0,
5561
+	            0x8000001c: 0x20800,
5562
+	            0x8000001d: 0x820,
5563
+	            0x8000001e: 0x20020,
5564
+	            0x8000001f: 0x8020800
5565
+	        }
5566
+	    ];
5567
+
5568
+	    // Masks that select the SBOX input
5569
+	    var SBOX_MASK = [
5570
+	        0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
5571
+	        0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
5572
+	    ];
5573
+
5574
+	    /**
5575
+	     * DES block cipher algorithm.
5576
+	     */
5577
+	    var DES = C_algo.DES = BlockCipher.extend({
5578
+	        _doReset: function () {
5579
+	            // Shortcuts
5580
+	            var key = this._key;
5581
+	            var keyWords = key.words;
5582
+
5583
+	            // Select 56 bits according to PC1
5584
+	            var keyBits = [];
5585
+	            for (var i = 0; i < 56; i++) {
5586
+	                var keyBitPos = PC1[i] - 1;
5587
+	                keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
5588
+	            }
5589
+
5590
+	            // Assemble 16 subkeys
5591
+	            var subKeys = this._subKeys = [];
5592
+	            for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
5593
+	                // Create subkey
5594
+	                var subKey = subKeys[nSubKey] = [];
5595
+
5596
+	                // Shortcut
5597
+	                var bitShift = BIT_SHIFTS[nSubKey];
5598
+
5599
+	                // Select 48 bits according to PC2
5600
+	                for (var i = 0; i < 24; i++) {
5601
+	                    // Select from the left 28 key bits
5602
+	                    subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
5603
+
5604
+	                    // Select from the right 28 key bits
5605
+	                    subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
5606
+	                }
5607
+
5608
+	                // Since each subkey is applied to an expanded 32-bit input,
5609
+	                // the subkey can be broken into 8 values scaled to 32-bits,
5610
+	                // which allows the key to be used without expansion
5611
+	                subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
5612
+	                for (var i = 1; i < 7; i++) {
5613
+	                    subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
5614
+	                }
5615
+	                subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
5616
+	            }
5617
+
5618
+	            // Compute inverse subkeys
5619
+	            var invSubKeys = this._invSubKeys = [];
5620
+	            for (var i = 0; i < 16; i++) {
5621
+	                invSubKeys[i] = subKeys[15 - i];
5622
+	            }
5623
+	        },
5624
+
5625
+	        encryptBlock: function (M, offset) {
5626
+	            this._doCryptBlock(M, offset, this._subKeys);
5627
+	        },
5628
+
5629
+	        decryptBlock: function (M, offset) {
5630
+	            this._doCryptBlock(M, offset, this._invSubKeys);
5631
+	        },
5632
+
5633
+	        _doCryptBlock: function (M, offset, subKeys) {
5634
+	            // Get input
5635
+	            this._lBlock = M[offset];
5636
+	            this._rBlock = M[offset + 1];
5637
+
5638
+	            // Initial permutation
5639
+	            exchangeLR.call(this, 4,  0x0f0f0f0f);
5640
+	            exchangeLR.call(this, 16, 0x0000ffff);
5641
+	            exchangeRL.call(this, 2,  0x33333333);
5642
+	            exchangeRL.call(this, 8,  0x00ff00ff);
5643
+	            exchangeLR.call(this, 1,  0x55555555);
5644
+
5645
+	            // Rounds
5646
+	            for (var round = 0; round < 16; round++) {
5647
+	                // Shortcuts
5648
+	                var subKey = subKeys[round];
5649
+	                var lBlock = this._lBlock;
5650
+	                var rBlock = this._rBlock;
5651
+
5652
+	                // Feistel function
5653
+	                var f = 0;
5654
+	                for (var i = 0; i < 8; i++) {
5655
+	                    f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
5656
+	                }
5657
+	                this._lBlock = rBlock;
5658
+	                this._rBlock = lBlock ^ f;
5659
+	            }
5660
+
5661
+	            // Undo swap from last round
5662
+	            var t = this._lBlock;
5663
+	            this._lBlock = this._rBlock;
5664
+	            this._rBlock = t;
5665
+
5666
+	            // Final permutation
5667
+	            exchangeLR.call(this, 1,  0x55555555);
5668
+	            exchangeRL.call(this, 8,  0x00ff00ff);
5669
+	            exchangeRL.call(this, 2,  0x33333333);
5670
+	            exchangeLR.call(this, 16, 0x0000ffff);
5671
+	            exchangeLR.call(this, 4,  0x0f0f0f0f);
5672
+
5673
+	            // Set output
5674
+	            M[offset] = this._lBlock;
5675
+	            M[offset + 1] = this._rBlock;
5676
+	        },
5677
+
5678
+	        keySize: 64/32,
5679
+
5680
+	        ivSize: 64/32,
5681
+
5682
+	        blockSize: 64/32
5683
+	    });
5684
+
5685
+	    // Swap bits across the left and right words
5686
+	    function exchangeLR(offset, mask) {
5687
+	        var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
5688
+	        this._rBlock ^= t;
5689
+	        this._lBlock ^= t << offset;
5690
+	    }
5691
+
5692
+	    function exchangeRL(offset, mask) {
5693
+	        var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
5694
+	        this._lBlock ^= t;
5695
+	        this._rBlock ^= t << offset;
5696
+	    }
5697
+
5698
+	    /**
5699
+	     * Shortcut functions to the cipher's object interface.
5700
+	     *
5701
+	     * @example
5702
+	     *
5703
+	     *     var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
5704
+	     *     var plaintext  = CryptoJS.DES.decrypt(ciphertext, key, cfg);
5705
+	     */
5706
+	    C.DES = BlockCipher._createHelper(DES);
5707
+
5708
+	    /**
5709
+	     * Triple-DES block cipher algorithm.
5710
+	     */
5711
+	    var TripleDES = C_algo.TripleDES = BlockCipher.extend({
5712
+	        _doReset: function () {
5713
+	            // Shortcuts
5714
+	            var key = this._key;
5715
+	            var keyWords = key.words;
5716
+	            // Make sure the key length is valid (64, 128 or >= 192 bit)
5717
+	            if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
5718
+	                throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');
5719
+	            }
5720
+
5721
+	            // Extend the key according to the keying options defined in 3DES standard
5722
+	            var key1 = keyWords.slice(0, 2);
5723
+	            var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
5724
+	            var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
5725
+
5726
+	            // Create DES instances
5727
+	            this._des1 = DES.createEncryptor(WordArray.create(key1));
5728
+	            this._des2 = DES.createEncryptor(WordArray.create(key2));
5729
+	            this._des3 = DES.createEncryptor(WordArray.create(key3));
5730
+	        },
5731
+
5732
+	        encryptBlock: function (M, offset) {
5733
+	            this._des1.encryptBlock(M, offset);
5734
+	            this._des2.decryptBlock(M, offset);
5735
+	            this._des3.encryptBlock(M, offset);
5736
+	        },
5737
+
5738
+	        decryptBlock: function (M, offset) {
5739
+	            this._des3.decryptBlock(M, offset);
5740
+	            this._des2.encryptBlock(M, offset);
5741
+	            this._des1.decryptBlock(M, offset);
5742
+	        },
5743
+
5744
+	        keySize: 192/32,
5745
+
5746
+	        ivSize: 64/32,
5747
+
5748
+	        blockSize: 64/32
5749
+	    });
5750
+
5751
+	    /**
5752
+	     * Shortcut functions to the cipher's object interface.
5753
+	     *
5754
+	     * @example
5755
+	     *
5756
+	     *     var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
5757
+	     *     var plaintext  = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
5758
+	     */
5759
+	    C.TripleDES = BlockCipher._createHelper(TripleDES);
5760
+	}());
5761
+
5762
+
5763
+	(function () {
5764
+	    // Shortcuts
5765
+	    var C = CryptoJS;
5766
+	    var C_lib = C.lib;
5767
+	    var StreamCipher = C_lib.StreamCipher;
5768
+	    var C_algo = C.algo;
5769
+
5770
+	    /**
5771
+	     * RC4 stream cipher algorithm.
5772
+	     */
5773
+	    var RC4 = C_algo.RC4 = StreamCipher.extend({
5774
+	        _doReset: function () {
5775
+	            // Shortcuts
5776
+	            var key = this._key;
5777
+	            var keyWords = key.words;
5778
+	            var keySigBytes = key.sigBytes;
5779
+
5780
+	            // Init sbox
5781
+	            var S = this._S = [];
5782
+	            for (var i = 0; i < 256; i++) {
5783
+	                S[i] = i;
5784
+	            }
5785
+
5786
+	            // Key setup
5787
+	            for (var i = 0, j = 0; i < 256; i++) {
5788
+	                var keyByteIndex = i % keySigBytes;
5789
+	                var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
5790
+
5791
+	                j = (j + S[i] + keyByte) % 256;
5792
+
5793
+	                // Swap
5794
+	                var t = S[i];
5795
+	                S[i] = S[j];
5796
+	                S[j] = t;
5797
+	            }
5798
+
5799
+	            // Counters
5800
+	            this._i = this._j = 0;
5801
+	        },
5802
+
5803
+	        _doProcessBlock: function (M, offset) {
5804
+	            M[offset] ^= generateKeystreamWord.call(this);
5805
+	        },
5806
+
5807
+	        keySize: 256/32,
5808
+
5809
+	        ivSize: 0
5810
+	    });
5811
+
5812
+	    function generateKeystreamWord() {
5813
+	        // Shortcuts
5814
+	        var S = this._S;
5815
+	        var i = this._i;
5816
+	        var j = this._j;
5817
+
5818
+	        // Generate keystream word
5819
+	        var keystreamWord = 0;
5820
+	        for (var n = 0; n < 4; n++) {
5821
+	            i = (i + 1) % 256;
5822
+	            j = (j + S[i]) % 256;
5823
+
5824
+	            // Swap
5825
+	            var t = S[i];
5826
+	            S[i] = S[j];
5827
+	            S[j] = t;
5828
+
5829
+	            keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
5830
+	        }
5831
+
5832
+	        // Update counters
5833
+	        this._i = i;
5834
+	        this._j = j;
5835
+
5836
+	        return keystreamWord;
5837
+	    }
5838
+
5839
+	    /**
5840
+	     * Shortcut functions to the cipher's object interface.
5841
+	     *
5842
+	     * @example
5843
+	     *
5844
+	     *     var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
5845
+	     *     var plaintext  = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
5846
+	     */
5847
+	    C.RC4 = StreamCipher._createHelper(RC4);
5848
+
5849
+	    /**
5850
+	     * Modified RC4 stream cipher algorithm.
5851
+	     */
5852
+	    var RC4Drop = C_algo.RC4Drop = RC4.extend({
5853
+	        /**
5854
+	         * Configuration options.
5855
+	         *
5856
+	         * @property {number} drop The number of keystream words to drop. Default 192
5857
+	         */
5858
+	        cfg: RC4.cfg.extend({
5859
+	            drop: 192
5860
+	        }),
5861
+
5862
+	        _doReset: function () {
5863
+	            RC4._doReset.call(this);
5864
+
5865
+	            // Drop
5866
+	            for (var i = this.cfg.drop; i > 0; i--) {
5867
+	                generateKeystreamWord.call(this);
5868
+	            }
5869
+	        }
5870
+	    });
5871
+
5872
+	    /**
5873
+	     * Shortcut functions to the cipher's object interface.
5874
+	     *
5875
+	     * @example
5876
+	     *
5877
+	     *     var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
5878
+	     *     var plaintext  = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
5879
+	     */
5880
+	    C.RC4Drop = StreamCipher._createHelper(RC4Drop);
5881
+	}());
5882
+
5883
+
5884
+	(function () {
5885
+	    // Shortcuts
5886
+	    var C = CryptoJS;
5887
+	    var C_lib = C.lib;
5888
+	    var StreamCipher = C_lib.StreamCipher;
5889
+	    var C_algo = C.algo;
5890
+
5891
+	    // Reusable objects
5892
+	    var S  = [];
5893
+	    var C_ = [];
5894
+	    var G  = [];
5895
+
5896
+	    /**
5897
+	     * Rabbit stream cipher algorithm
5898
+	     */
5899
+	    var Rabbit = C_algo.Rabbit = StreamCipher.extend({
5900
+	        _doReset: function () {
5901
+	            // Shortcuts
5902
+	            var K = this._key.words;
5903
+	            var iv = this.cfg.iv;
5904
+
5905
+	            // Swap endian
5906
+	            for (var i = 0; i < 4; i++) {
5907
+	                K[i] = (((K[i] << 8)  | (K[i] >>> 24)) & 0x00ff00ff) |
5908
+	                       (((K[i] << 24) | (K[i] >>> 8))  & 0xff00ff00);
5909
+	            }
5910
+
5911
+	            // Generate initial state values
5912
+	            var X = this._X = [
5913
+	                K[0], (K[3] << 16) | (K[2] >>> 16),
5914
+	                K[1], (K[0] << 16) | (K[3] >>> 16),
5915
+	                K[2], (K[1] << 16) | (K[0] >>> 16),
5916
+	                K[3], (K[2] << 16) | (K[1] >>> 16)
5917
+	            ];
5918
+
5919
+	            // Generate initial counter values
5920
+	            var C = this._C = [
5921
+	                (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
5922
+	                (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
5923
+	                (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
5924
+	                (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
5925
+	            ];
5926
+
5927
+	            // Carry bit
5928
+	            this._b = 0;
5929
+
5930
+	            // Iterate the system four times
5931
+	            for (var i = 0; i < 4; i++) {
5932
+	                nextState.call(this);
5933
+	            }
5934
+
5935
+	            // Modify the counters
5936
+	            for (var i = 0; i < 8; i++) {
5937
+	                C[i] ^= X[(i + 4) & 7];
5938
+	            }
5939
+
5940
+	            // IV setup
5941
+	            if (iv) {
5942
+	                // Shortcuts
5943
+	                var IV = iv.words;
5944
+	                var IV_0 = IV[0];
5945
+	                var IV_1 = IV[1];
5946
+
5947
+	                // Generate four subvectors
5948
+	                var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
5949
+	                var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
5950
+	                var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
5951
+	                var i3 = (i2 << 16)  | (i0 & 0x0000ffff);
5952
+
5953
+	                // Modify counter values
5954
+	                C[0] ^= i0;
5955
+	                C[1] ^= i1;
5956
+	                C[2] ^= i2;
5957
+	                C[3] ^= i3;
5958
+	                C[4] ^= i0;
5959
+	                C[5] ^= i1;
5960
+	                C[6] ^= i2;
5961
+	                C[7] ^= i3;
5962
+
5963
+	                // Iterate the system four times
5964
+	                for (var i = 0; i < 4; i++) {
5965
+	                    nextState.call(this);
5966
+	                }
5967
+	            }
5968
+	        },
5969
+
5970
+	        _doProcessBlock: function (M, offset) {
5971
+	            // Shortcut
5972
+	            var X = this._X;
5973
+
5974
+	            // Iterate the system
5975
+	            nextState.call(this);
5976
+
5977
+	            // Generate four keystream words
5978
+	            S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
5979
+	            S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
5980
+	            S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
5981
+	            S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
5982
+
5983
+	            for (var i = 0; i < 4; i++) {
5984
+	                // Swap endian
5985
+	                S[i] = (((S[i] << 8)  | (S[i] >>> 24)) & 0x00ff00ff) |
5986
+	                       (((S[i] << 24) | (S[i] >>> 8))  & 0xff00ff00);
5987
+
5988
+	                // Encrypt
5989
+	                M[offset + i] ^= S[i];
5990
+	            }
5991
+	        },
5992
+
5993
+	        blockSize: 128/32,
5994
+
5995
+	        ivSize: 64/32
5996
+	    });
5997
+
5998
+	    function nextState() {
5999
+	        // Shortcuts
6000
+	        var X = this._X;
6001
+	        var C = this._C;
6002
+
6003
+	        // Save old counter values
6004
+	        for (var i = 0; i < 8; i++) {
6005
+	            C_[i] = C[i];
6006
+	        }
6007
+
6008
+	        // Calculate new counter values
6009
+	        C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
6010
+	        C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
6011
+	        C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
6012
+	        C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
6013
+	        C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
6014
+	        C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
6015
+	        C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
6016
+	        C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
6017
+	        this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
6018
+
6019
+	        // Calculate the g-values
6020
+	        for (var i = 0; i < 8; i++) {
6021
+	            var gx = X[i] + C[i];
6022
+
6023
+	            // Construct high and low argument for squaring
6024
+	            var ga = gx & 0xffff;
6025
+	            var gb = gx >>> 16;
6026
+
6027
+	            // Calculate high and low result of squaring
6028
+	            var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
6029
+	            var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
6030
+
6031
+	            // High XOR low
6032
+	            G[i] = gh ^ gl;
6033
+	        }
6034
+
6035
+	        // Calculate new state values
6036
+	        X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
6037
+	        X[1] = (G[1] + ((G[0] << 8)  | (G[0] >>> 24)) + G[7]) | 0;
6038
+	        X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
6039
+	        X[3] = (G[3] + ((G[2] << 8)  | (G[2] >>> 24)) + G[1]) | 0;
6040
+	        X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
6041
+	        X[5] = (G[5] + ((G[4] << 8)  | (G[4] >>> 24)) + G[3]) | 0;
6042
+	        X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
6043
+	        X[7] = (G[7] + ((G[6] << 8)  | (G[6] >>> 24)) + G[5]) | 0;
6044
+	    }
6045
+
6046
+	    /**
6047
+	     * Shortcut functions to the cipher's object interface.
6048
+	     *
6049
+	     * @example
6050
+	     *
6051
+	     *     var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
6052
+	     *     var plaintext  = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
6053
+	     */
6054
+	    C.Rabbit = StreamCipher._createHelper(Rabbit);
6055
+	}());
6056
+
6057
+
6058
+	(function () {
6059
+	    // Shortcuts
6060
+	    var C = CryptoJS;
6061
+	    var C_lib = C.lib;
6062
+	    var StreamCipher = C_lib.StreamCipher;
6063
+	    var C_algo = C.algo;
6064
+
6065
+	    // Reusable objects
6066
+	    var S  = [];
6067
+	    var C_ = [];
6068
+	    var G  = [];
6069
+
6070
+	    /**
6071
+	     * Rabbit stream cipher algorithm.
6072
+	     *
6073
+	     * This is a legacy version that neglected to convert the key to little-endian.
6074
+	     * This error doesn't affect the cipher's security,
6075
+	     * but it does affect its compatibility with other implementations.
6076
+	     */
6077
+	    var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
6078
+	        _doReset: function () {
6079
+	            // Shortcuts
6080
+	            var K = this._key.words;
6081
+	            var iv = this.cfg.iv;
6082
+
6083
+	            // Generate initial state values
6084
+	            var X = this._X = [
6085
+	                K[0], (K[3] << 16) | (K[2] >>> 16),
6086
+	                K[1], (K[0] << 16) | (K[3] >>> 16),
6087
+	                K[2], (K[1] << 16) | (K[0] >>> 16),
6088
+	                K[3], (K[2] << 16) | (K[1] >>> 16)
6089
+	            ];
6090
+
6091
+	            // Generate initial counter values
6092
+	            var C = this._C = [
6093
+	                (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
6094
+	                (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
6095
+	                (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
6096
+	                (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
6097
+	            ];
6098
+
6099
+	            // Carry bit
6100
+	            this._b = 0;
6101
+
6102
+	            // Iterate the system four times
6103
+	            for (var i = 0; i < 4; i++) {
6104
+	                nextState.call(this);
6105
+	            }
6106
+
6107
+	            // Modify the counters
6108
+	            for (var i = 0; i < 8; i++) {
6109
+	                C[i] ^= X[(i + 4) & 7];
6110
+	            }
6111
+
6112
+	            // IV setup
6113
+	            if (iv) {
6114
+	                // Shortcuts
6115
+	                var IV = iv.words;
6116
+	                var IV_0 = IV[0];
6117
+	                var IV_1 = IV[1];
6118
+
6119
+	                // Generate four subvectors
6120
+	                var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
6121
+	                var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
6122
+	                var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
6123
+	                var i3 = (i2 << 16)  | (i0 & 0x0000ffff);
6124
+
6125
+	                // Modify counter values
6126
+	                C[0] ^= i0;
6127
+	                C[1] ^= i1;
6128
+	                C[2] ^= i2;
6129
+	                C[3] ^= i3;
6130
+	                C[4] ^= i0;
6131
+	                C[5] ^= i1;
6132
+	                C[6] ^= i2;
6133
+	                C[7] ^= i3;
6134
+
6135
+	                // Iterate the system four times
6136
+	                for (var i = 0; i < 4; i++) {
6137
+	                    nextState.call(this);
6138
+	                }
6139
+	            }
6140
+	        },
6141
+
6142
+	        _doProcessBlock: function (M, offset) {
6143
+	            // Shortcut
6144
+	            var X = this._X;
6145
+
6146
+	            // Iterate the system
6147
+	            nextState.call(this);
6148
+
6149
+	            // Generate four keystream words
6150
+	            S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
6151
+	            S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
6152
+	            S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
6153
+	            S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
6154
+
6155
+	            for (var i = 0; i < 4; i++) {
6156
+	                // Swap endian
6157
+	                S[i] = (((S[i] << 8)  | (S[i] >>> 24)) & 0x00ff00ff) |
6158
+	                       (((S[i] << 24) | (S[i] >>> 8))  & 0xff00ff00);
6159
+
6160
+	                // Encrypt
6161
+	                M[offset + i] ^= S[i];
6162
+	            }
6163
+	        },
6164
+
6165
+	        blockSize: 128/32,
6166
+
6167
+	        ivSize: 64/32
6168
+	    });
6169
+
6170
+	    function nextState() {
6171
+	        // Shortcuts
6172
+	        var X = this._X;
6173
+	        var C = this._C;
6174
+
6175
+	        // Save old counter values
6176
+	        for (var i = 0; i < 8; i++) {
6177
+	            C_[i] = C[i];
6178
+	        }
6179
+
6180
+	        // Calculate new counter values
6181
+	        C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
6182
+	        C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
6183
+	        C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
6184
+	        C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
6185
+	        C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
6186
+	        C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
6187
+	        C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
6188
+	        C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
6189
+	        this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
6190
+
6191
+	        // Calculate the g-values
6192
+	        for (var i = 0; i < 8; i++) {
6193
+	            var gx = X[i] + C[i];
6194
+
6195
+	            // Construct high and low argument for squaring
6196
+	            var ga = gx & 0xffff;
6197
+	            var gb = gx >>> 16;
6198
+
6199
+	            // Calculate high and low result of squaring
6200
+	            var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
6201
+	            var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
6202
+
6203
+	            // High XOR low
6204
+	            G[i] = gh ^ gl;
6205
+	        }
6206
+
6207
+	        // Calculate new state values
6208
+	        X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
6209
+	        X[1] = (G[1] + ((G[0] << 8)  | (G[0] >>> 24)) + G[7]) | 0;
6210
+	        X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
6211
+	        X[3] = (G[3] + ((G[2] << 8)  | (G[2] >>> 24)) + G[1]) | 0;
6212
+	        X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
6213
+	        X[5] = (G[5] + ((G[4] << 8)  | (G[4] >>> 24)) + G[3]) | 0;
6214
+	        X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
6215
+	        X[7] = (G[7] + ((G[6] << 8)  | (G[6] >>> 24)) + G[5]) | 0;
6216
+	    }
6217
+
6218
+	    /**
6219
+	     * Shortcut functions to the cipher's object interface.
6220
+	     *
6221
+	     * @example
6222
+	     *
6223
+	     *     var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
6224
+	     *     var plaintext  = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
6225
+	     */
6226
+	    C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
6227
+	}());
6228
+
6229
+
6230
+	return CryptoJS;
6231
+
6232
+}));
0 6233
\ No newline at end of file