diff options
Diffstat (limited to 'www/lib/crypto-js/mode-ecb.js')
| -rw-r--r-- | www/lib/crypto-js/mode-ecb.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/www/lib/crypto-js/mode-ecb.js b/www/lib/crypto-js/mode-ecb.js new file mode 100644 index 00000000..ff069217 --- /dev/null +++ b/www/lib/crypto-js/mode-ecb.js @@ -0,0 +1,40 @@ +;(function (root, factory, undef) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(require("./core"), require("./cipher-core")); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + return CryptoJS.mode.ECB; + +}));
\ No newline at end of file |
