2010-10-08 06:10:46 +02:00
|
|
|
new sjcl.test.TestCase("ECDH test", function (cb) {
|
|
|
|
if (!sjcl.ecc) {
|
|
|
|
this.unimplemented();
|
|
|
|
cb && cb();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-10-09 01:02:09 +02:00
|
|
|
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);
|
|
|
|
}
|
2010-10-08 06:10:46 +02:00
|
|
|
cb && cb();
|
|
|
|
});
|