1 | ;(function (root, factory, undef) {
|
2 | if (typeof exports === "object") {
|
3 |
|
4 | module.exports = exports = factory(require("./core"), require("./cipher-core"));
|
5 | }
|
6 | else if (typeof define === "function" && define.amd) {
|
7 |
|
8 | define(["./core", "./cipher-core"], factory);
|
9 | }
|
10 | else {
|
11 |
|
12 | factory(root.CryptoJS);
|
13 | }
|
14 | }(this, function (CryptoJS) {
|
15 |
|
16 | |
17 |
|
18 |
|
19 | CryptoJS.pad.Iso10126 = {
|
20 | pad: function (data, blockSize) {
|
21 |
|
22 | var blockSizeBytes = blockSize * 4;
|
23 |
|
24 |
|
25 | var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
|
26 |
|
27 |
|
28 | data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
|
29 | concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
|
30 | },
|
31 |
|
32 | unpad: function (data) {
|
33 |
|
34 | var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
|
35 |
|
36 |
|
37 | data.sigBytes -= nPaddingBytes;
|
38 | }
|
39 | };
|
40 |
|
41 |
|
42 | return CryptoJS.pad.Iso10126;
|
43 |
|
44 | })); |
\ | No newline at end of file |