summaryrefslogtreecommitdiff
path: root/www/lib/crypto-js/mode-ctr.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-09-27 12:42:48 -0400
committerPliable Pixels <pliablepixels@gmail.com>2017-09-27 12:42:48 -0400
commit210e8feae2fb4842bfb2de38666e6c41671fef3c (patch)
treecbdafa34b1a6260bb20236d7e9de9eb1b690a1c5 /www/lib/crypto-js/mode-ctr.js
parente7e7baeaad90229ccb3e0f45f4ebd77be7d79b14 (diff)
removed lib
Diffstat (limited to 'www/lib/crypto-js/mode-ctr.js')
-rw-r--r--www/lib/crypto-js/mode-ctr.js58
1 files changed, 0 insertions, 58 deletions
diff --git a/www/lib/crypto-js/mode-ctr.js b/www/lib/crypto-js/mode-ctr.js
deleted file mode 100644
index c3d470a6..00000000
--- a/www/lib/crypto-js/mode-ctr.js
+++ /dev/null
@@ -1,58 +0,0 @@
-;(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) {
-
- /**
- * Counter block mode.
- */
- CryptoJS.mode.CTR = (function () {
- var CTR = CryptoJS.lib.BlockCipherMode.extend();
-
- var Encryptor = CTR.Encryptor = CTR.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var counter = this._counter;
-
- // Generate keystream
- if (iv) {
- counter = this._counter = iv.slice(0);
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- }
- var keystream = counter.slice(0);
- cipher.encryptBlock(keystream, 0);
-
- // Increment counter
- counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
-
- // Encrypt
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
-
- CTR.Decryptor = Encryptor;
-
- return CTR;
- }());
-
-
- return CryptoJS.mode.CTR;
-
-})); \ No newline at end of file