only generate what is needed

This commit is contained in:
Lars Hvam 2016-11-20 09:54:00 -05:00
parent a6b81b127b
commit c69a92d694

View File

@ -189,7 +189,7 @@ S2K.prototype.produce_key = function (passphrase, numBytes) {
} }
i = 0; i = 0;
while (rlength <= numBytes) { while (rlength < numBytes) {
var result = round(prefix.subarray(0,i), this); var result = round(prefix.subarray(0,i), this);
arr.push(result); arr.push(result);
rlength += result.length; rlength += result.length;