def testEncryptInt64Fail(self):
    logging.debug('Running testEncryptInt64Fail method.')
    # check positive overflow
    try:
      _PAILLIER1.EncryptInt64(2**63)
      self.fail()
    except ValueError:
      pass  # success
    try:
      _PAILLIER1.EncryptInt64(2**128)
      self.fail()
    except ValueError:
      pass  # success
    # check negative overflow
    try:
      _PAILLIER1.EncryptInt64(-2**63 - 1)
      self.fail()
    except ValueError:
      pass  # success
    try:
      _PAILLIER1.EncryptInt64(-2**128)
      self.fail()
    except ValueError:
      pass  # success
    # positive overflow as a result of adding
    ciphertext1 = _PAILLIER1.EncryptInt64(2**63 - 1)
    ciphertext2 = _PAILLIER1.EncryptInt64(1)
    ciphertext3 = _PAILLIER1.Add(ciphertext1, ciphertext2)
    try:
      _PAILLIER1.DecryptInt64(ciphertext3)
      self.fail()
    except OverflowError:
      pass  # success
    # negative overflow as a result of adding
    ciphertext1 = _PAILLIER1.EncryptInt64(-2**63)
    ciphertext2 = _PAILLIER1.EncryptInt64(-1)
    ciphertext3 = _PAILLIER1.Add(ciphertext1, ciphertext2)
    try:
      _PAILLIER1.DecryptInt64(ciphertext3)
      self.fail()
    except OverflowError:
      pass  # success
dataset/ETHPy150Open google/encrypted-bigquery-client/src/paillier_test.py/PaillierTest.testEncryptInt64Fail/original