ecdh, ecdsa tests

This commit is contained in:
Mike Hamburg
2010-10-07 21:10:46 -07:00
parent 2bb04bb02f
commit 4f316afb56
6 changed files with 56 additions and 10 deletions

15
test/ecdh_test.js Normal file
View File

@@ -0,0 +1,15 @@
new sjcl.test.TestCase("ECDH test", function (cb) {
if (!sjcl.ecc) {
this.unimplemented();
cb && cb();
return;
}
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));
cb && cb();
});