def set_deterministic(self, km=None): if km is None: pub = Cipher.get_public_key(self) i = random.randrange(2, pub["p"] - 1) km = pow(pub["beta"], i, pub["p"]) Cipher.add_to_public_key(self, "km", km) return km
def set_deterministic(self,r=None): if r is None: pub = Cipher.get_public_key(self) r = random.randrange(1,pub["n"]) Cipher.add_to_public_key(self,"r",r) return r