mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
1 line
7.9 KiB
JSON
1 line
7.9 KiB
JSON
|
|
{"ast":null,"code":";\n(function (root, factory, undef) {\n if (typeof exports === \"object\") {\n // CommonJS\n module.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n } else if (typeof define === \"function\" && define.amd) {\n // AMD\n define([\"./core\", \"./cipher-core\"], factory);\n } else {\n // Global (browser)\n factory(root.CryptoJS);\n }\n})(this, function (CryptoJS) {\n /** @preserve\n * Counter block mode compatible with Dr Brian Gladman fileenc.c\n * derived from CryptoJS.mode.CTR\n * Jan Hruby jhruby.web@gmail.com\n */\n CryptoJS.mode.CTRGladman = function () {\n var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n function incWord(word) {\n if ((word >> 24 & 0xff) === 0xff) {\n //overflow\n var b1 = word >> 16 & 0xff;\n var b2 = word >> 8 & 0xff;\n var b3 = word & 0xff;\n if (b1 === 0xff)\n // overflow b1\n {\n b1 = 0;\n if (b2 === 0xff) {\n b2 = 0;\n if (b3 === 0xff) {\n b3 = 0;\n } else {\n ++b3;\n }\n } else {\n ++b2;\n }\n } else {\n ++b1;\n }\n word = 0;\n word += b1 << 16;\n word += b2 << 8;\n word += b3;\n } else {\n word += 0x01 << 24;\n }\n return word;\n }\n function incCounter(counter) {\n if ((counter[0] = incWord(counter[0])) === 0) {\n // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n counter[1] = incWord(counter[1]);\n }\n return counter;\n }\n var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({\n processBlock: function (words, offset) {\n // Shortcuts\n var cipher = this._cipher;\n var blockSize = cipher.blockSize;\n var iv = this._iv;\n var counter = this._counter;\n\n // Generate keystream\n if (iv) {\n counter = this._counter = iv.slice(0);\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n }\n incCounter(counter);\n var keystream = counter.slice(0);\n cipher.encryptBlock(keystream, 0);\n\n // Encrypt\n for (var i = 0; i < blockSize; i++) {\n words[offset + i] ^= keystream[i];\n }\n }\n });\n CTRGladman.Decryptor = Encryptor;\n return CTRGladman;\n }();\n return CryptoJS.mode.CTRGladman;\n});","map":{"version":3,"names":["root","factory","undef","exports","module","require","define","amd","CryptoJS","mode","CTRGladman","lib","BlockCipherMode","extend","incWord","word","b1","b2","b3","incCounter","counter","Encryptor","processBlock","words","offset","cipher","_cipher","blockSize","iv","_iv","_counter","slice","undefined","keystream","encryptBlock","i","Decryptor"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/crypto-js/mode-ctr-gladman.js"],"sourcesContent":[";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t * Counter block mode compatible with Dr Brian Gladman fileenc.c\n\t * derived from CryptoJS.mode.CTR\n\t * Jan Hruby jhruby.web@gmail.com\n\t */\n\tCryptoJS.mode.CTRGladman = (function () {\n\t var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\tfunction incWord(word)\n\t\t{\n\t\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tvar b1 = (word >> 16)&0xff;\n\t\t\tvar b2 = (word >> 8)&0xff;\n\t\t\tvar b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) // overflow b1\n\t\t\t{\n\t\t\tb1 = 0;\n\t\t\tif (b2 === 0xff)\n\t\t\t{\n\t\t\t\tb2 = 0;\n\t\t\t\tif (b3 === 0x
|