You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
privatebin/test/ecdh_test.js

16 lines
339 B

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();
});