diff --git a/.jshintrc b/.jshintrc index 72c2b12..c4b19e9 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,5 @@ { + "esversion": 6, "bitwise": false, // Prohibits the use of bitwise operators (not confuse & with &&) "curly": true, // Requires to always put curly braces around blocks in loops and conditionals "eqeqeq": false, // Prohibits the use of == and != in favor of === and !== @@ -28,6 +29,8 @@ "Uint8ClampedArray": true, "ArrayBuffer": true, "Float32Array": true, - "Float64Array": true + "Float64Array": true, + "self": false, + "globalThis": false } } diff --git a/src/cipher-core.js b/src/cipher-core.js index 125632c..32e2205 100644 --- a/src/cipher-core.js +++ b/src/cipher-core.js @@ -772,15 +772,16 @@ CryptoJS.lib.Cipher || (function (undefined) { } // Derive key and IV + let key; if (!hasher) { - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); } else { - var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt); + key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt); } // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + const iv = WordArray.create(key.words.slice(keySize), ivSize * 4); key.sigBytes = keySize * 4; // Return params