def METHOD_NAME(self, other_pubkey):
    ecdh_keybuffer = ctypes.create_string_buffer(32)
    r = ssl.ECDH_compute_key(ctypes.pointer(ecdh_keybuffer), 32,
                             ssl.EC_KEY_get0_public_key(other_pubkey.k),
                             self.k, 0)
    if r != 32:
        raise Exception('CKey.get_ecdh_key(): ECDH_compute_key() failed')
    return ecdh_keybuffer.raw