Beispiel #1
0
 def L(self, u, n):
     return integer(int(u - 1)) / n
Beispiel #2
0
 def encode(self, modulus, message):
     # takes a string and represents as a bytes object
     elem = integer(message)
     return elem % modulus
Beispiel #3
0
 def randomize(self, r): # need to provide random value
     lhs = dict.__getitem__(self, self.key)
     rhs = (integer(r) ** self.pk['n']) % self.pk['n2']
     return Ciphertext({self.key:(lhs * rhs) % self.pk['n2']})