Exemple #1
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)
Exemple #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)