def decrypt(self, encryptedMessage): tmp = self.reModulo(poly.multPoly(self.f, encryptedMessage), self.D, self.q) centered = poly.cenPoly(tmp, self.q) m1 = poly.multPoly(self.f_p, centered) tmp = self.reModulo(m1, self.D, self.p) return poly.trim(tmp)
def decryptSQ(self,encryptedMessage): F_p_sq=poly.multPoly(self.f_p,self.f_p) f_sq=poly.multPoly(self.f,self.f) tmp=self.reModulo(poly.multPoly(f_sq,encryptedMessage),self.D,self.q) centered=poly.cenPoly(tmp,self.q) m1=poly.multPoly(F_p_sq,centered) tmp=self.reModulo(m1,self.D,self.p) return poly.trim(tmp)
def decrypt(self,encryptedMessage): tmp=self.reModulo(poly.multPoly(self.f,encryptedMessage),self.D,self.q) centered=poly.cenPoly(tmp,self.q) m1=poly.multPoly(self.f_p,centered) tmp=self.reModulo(m1,self.D,self.p) return poly.trim(tmp)