Add var declaration to des.js and use strict mode

This commit is contained in:
Tankred Hase 2016-01-23 17:27:45 +07:00
parent 05e441b8ad
commit bc5eb03ccd

View File

@ -25,6 +25,7 @@
* @module crypto/cipher/des
*/
'use strict';
function des(keys, message, encrypt, mode, iv, padding) {
//declaring this locally speeds things up a bit
@ -303,7 +304,7 @@ function des_createKeys(key) {
right = temp;
//now go through and perform these shifts on the left and right keys
for (i = 0; i < shifts.length; i++) {
for (var i = 0; i < shifts.length; i++) {
//shift the keys either one or two bits to the left
if (shifts[i]) {
left = (left << 2) | (left >>> 26);