def test_sub_scalar_r(self): r = self.x - self.y r_enc = self.x - self.y_enc r_dec = he.decrypt(r_enc) self.assertEqual(r, r_dec)
def test_add_scalar(self): r = self.x + self.y r_enc = self.x_enc + self.y r_dec = he.decrypt(r_enc) self.assertEqual(r, r_dec)
def test_mul_scalar(self): r = self.x * self.y r_enc = self.x_enc * self.y r_dec = he.decrypt(r_enc) self.assertEqual(r, r_dec)
def test_neg_scalar(self): r = -self.x r_enc = -self.x_enc r_dec = he.decrypt(r_enc) self.assertEqual(r, r_dec)