elliptic curve diffie hellman

This commit is contained in:
Mike Hamburg
2010-12-09 14:16:11 -08:00
parent f28119699c
commit 54f531d8c2
2 changed files with 29 additions and 25 deletions

View File

@@ -341,6 +341,10 @@ sjcl.ecc.elGamal.publicKey.prototype = {
sjcl.ecc.elGamal.secretKey.prototype = {
unkem: function(tag) {
return sjcl.hash.sha256.hash(this._curve.fromBits(tag).mult(this._exponent).toBits());
},
dh: function(pk) {
return sjcl.hash.sha256.hash(pk._point.mult(this._exponent).toBits());
}
};