restore ecc, cbc

This commit is contained in:
Mike Hamburg
2011-05-23 13:56:45 -07:00
parent 28b0b389ac
commit 117fce4fa2
7 changed files with 992 additions and 0 deletions

18
test/ecdh_test.js Normal file
View File

@@ -0,0 +1,18 @@
new sjcl.test.TestCase("ECDH test", function (cb) {
if (!sjcl.ecc) {
this.unimplemented();
cb && cb();
return;
}
try {
var keys = sjcl.ecc.elGamal.generateKeys(192,0),
keyTag = keys.pub.kem(0),
key2 = keys.sec.unkem(keyTag.tag);
this.require(sjcl.bitArray.equal(keyTag.key, key2));
} catch(e) {
this.fail(e);
}
cb && cb();
});