Twofish test is working once more.
This commit is contained in:
parent
3537b92a51
commit
c77a17cf31
File diff suppressed because one or more lines are too long
|
@ -309,11 +309,11 @@ function TF(key) {
|
||||||
this.tf.open(util.str2bin(key),0);
|
this.tf.open(util.str2bin(key),0);
|
||||||
|
|
||||||
this.encrypt = function(block) {
|
this.encrypt = function(block) {
|
||||||
return tf.encrypt(block, 0);
|
return this.tf.encrypt([].concat(block), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = TF;
|
module.exports = TF;
|
||||||
module.exports.keySize = TF.prototype.keySize = 32;
|
module.exports.keySize = TF.prototype.keySize = 32;
|
||||||
module.exports.blockSize = TF.prototype.blockSize = 32;
|
module.exports.blockSize = TF.prototype.blockSize = 16;
|
||||||
|
|
|
@ -3,7 +3,12 @@ unittests.register("Twofish test with test vectors from http://www.schneier.com/
|
||||||
var openpgp = require('openpgp'),
|
var openpgp = require('openpgp'),
|
||||||
util = openpgp.util;
|
util = openpgp.util;
|
||||||
|
|
||||||
function TFencrypt() { return [];}
|
function TFencrypt(block, key) {
|
||||||
|
var tf = new openpgp.cipher.twofish(key);
|
||||||
|
|
||||||
|
return tf.encrypt(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var result = new Array();
|
var result = new Array();
|
||||||
var start = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
var start = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user