def testMultipleAddWithEncryptDecryptInt64(self):
    logging.debug('Running testMultipleAddWithEncryptDecryptInt64 method.')
    c123456789 = _PAILLIER1.EncryptInt64(123456789L)
    c314159265359 = _PAILLIER1.EncryptInt64(314159265359L)
    c271828182846 = _PAILLIER1.EncryptInt64(271828182846L)
    c987654321neg = _PAILLIER1.EncryptInt64(-987654321L)
    c161803398874neg = _PAILLIER1.EncryptInt64(-161803398874L)
    c1414213562373095neg = _PAILLIER1.EncryptInt64(-1414213562373095L)
    # Add many positive numbers
    ciphertext = _PAILLIER1.Add(c123456789, c314159265359)
    ciphertext = _PAILLIER1.Add(ciphertext, c271828182846)
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    self.assertEquals(123456789 + 314159265359 + 271828182846, decryption)
    # Add many negative numbers
    ciphertext = _PAILLIER1.Add(c987654321neg, c161803398874neg)
    ciphertext = _PAILLIER1.Add(ciphertext, c1414213562373095neg)
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    self.assertEquals(-987654321 + -161803398874 + -1414213562373095,
                      decryption)
    # Add many positive and negative numbers with aggregate being positive
    ciphertext = _PAILLIER1.Add(c123456789, c314159265359)
    ciphertext = _PAILLIER1.Add(ciphertext, c271828182846)
    ciphertext = _PAILLIER1.Add(ciphertext, c987654321neg)
    ciphertext = _PAILLIER1.Add(ciphertext, c161803398874neg)
    ciphertext_3pos_2neg = ciphertext
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    sum_3pos_2neg = (123456789 + 314159265359 + 271828182846 + -987654321 +
                     -161803398874)
    self.assertEquals(sum_3pos_2neg, decryption)
    # Add many positive and negative numbers with aggregate being negative
    ciphertext = _PAILLIER1.Add(c123456789, c314159265359)
    ciphertext = _PAILLIER1.Add(ciphertext, c271828182846)
    ciphertext = _PAILLIER1.Add(ciphertext, c987654321neg)
    ciphertext = _PAILLIER1.Add(ciphertext, c161803398874neg)
    ciphertext = _PAILLIER1.Add(ciphertext, c1414213562373095neg)
    ciphertext_3pos_3neg = ciphertext
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    sum_3pos_3neg = (123456789 + 314159265359 + 271828182846 + -987654321 +
                     -161803398874 + -1414213562373095)
    self.assertEquals(sum_3pos_3neg, decryption)
    # Add many positive and negative numbers to reach 2^63 - 1.
    ciphertext = _PAILLIER1.EncryptInt64(2**63 - 1 - sum_3pos_2neg)
    ciphertext = _PAILLIER1.Add(ciphertext_3pos_2neg, ciphertext)
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    self.assertEquals(2**63 -1, decryption)
    # Add many positive and negative numbers to reach -2^63 + 1.
    ciphertext = _PAILLIER1.EncryptInt64(-2**63 + 1 - sum_3pos_3neg)
    ciphertext = _PAILLIER1.Add(ciphertext_3pos_3neg, ciphertext)
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    self.assertEquals(-2**63 + 1, decryption)
    # Add many positive and negative numbers to reach -2^63.
    ciphertext = _PAILLIER1.EncryptInt64(-2**63 - sum_3pos_3neg)
    ciphertext = _PAILLIER1.Add(ciphertext_3pos_3neg, ciphertext)
    decryption = _PAILLIER1.DecryptInt64(ciphertext)
    self.assertEquals(-2**63, decryption)
dataset/ETHPy150Open google/encrypted-bigquery-client/src/paillier_test.py/PaillierTest.testMultipleAddWithEncryptDecryptInt64/original