示例#1
0
 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)
示例#2
0
文件: ntru.py 项目: intangere/Essence
	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) 
示例#3
0
	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) 
示例#4
0
文件: ntru.py 项目: intangere/Essence
	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)