示例#1
0
文件: EC.py 项目: rodrigc/m2crypto
 def compute_dh_key(self, pub_key):
     """
     Compute the ECDH shared key of this key pair and the given public
     key object. They must both use the same curve. Returns the
     shared key in binary as a buffer object. No Key Derivation Function is
     applied.
     """
     assert self.check_key(), 'key is not initialised'
     return m2.ecdh_compute_key(self.ec, pub_key.ec)
示例#2
0
 def compute_dh_key(self, pub_key):
     """
     Compute the ECDH shared key of this key pair and the given public
     key object. They must both use the same curve. Returns the
     shared key in binary as a buffer object. No Key Derivation Function is
     applied.
     """
     assert self.check_key(), 'key is not initialised'
     return m2.ecdh_compute_key(self.ec, pub_key.ec)