des.js: remove decrypt and simplify.

The decrypt functionality is never used so remove it. Also, we can
assume that we are always DES encrypting 16 characters which allows
several things to be simplified in DES.

Overall this removes about 80 lines of code.
This commit is contained in:
Joel Martin
2010-09-29 14:48:19 -05:00
parent a679a97d1b
commit 12d2e7c192
2 changed files with 51 additions and 129 deletions
+2 -8
View File
@@ -602,17 +602,11 @@ function send_string(str) {
}
function genDES(password, challenge) {
var i, passwd, response;
passwd = [];
response = challenge.slice();
var i, passwd = [];
for (i=0; i < password.length; i += 1) {
passwd.push(password.charCodeAt(i));
}
DES.setKeys(passwd);
DES.encrypt(response, 0, response, 0);
DES.encrypt(response, 8, response, 8);
return response;
return DES.encrypt(passwd, challenge);
}
function flushClient() {