def negotiate(self, sock): sock.send(long_to_bytes(self.getPublicKey())) B = sock.recv(1024) # 8192 bits return self.update(bytes_to_long(B))