55 :return: Decrypted message
56 """
57 f, g = private_key
58 a = ciphertext * f^-1 % self.q 59 b = a * g % self.q
60 return b
61
28 f = self.poly_ring.random_element()
29 g = self.poly_ring.random_element()
30 F = f * g % self.q
31 h = F * g^-1 % self.q 32 public_key = h
33 private_key = (f, g)
34 return public_key, private_key
There should be one space before and after bitwise and shift operators (<<
, >>
, &
, |
, ^
).