def keygen(self,scheme='paillier'): id = str(random.randint(0,2**32)) r = requests.get('http://'+self.host+':'+self.port+'/keygen/'+id+'/'+scheme+'/') pk = PublicKey.deserialize(r.content.decode()) pk.id = id return pk
def keygen(self, scheme='paillier'): id = str(random.randint(0, 2**32)) task_kwargs = { "id": id, "scheme": scheme, } self.task_socket.send_string( str({ "task": "create_keys", "task_kwargs": task_kwargs })) r = self.task_socket.recv() pk = PublicKey.deserialize(r) pk.id = id return pk