def _generate_u_v_and_d(self): self.u, self.v, self.d = [], [], [] for i in range(self.m): ui = rand_int_signed(self.random, 2**(2 * self.k)) vi, di = self.paillier.encrypt_r(ui) assert abs(ui) <= 2**(2 * self.k) self.u.append(mpz(ui)) self.v.append(mpz(vi)) self.d.append(mpz(di))
def _generate_test_ciphertexts(self, random, runtime, k, s, prover_id): paillier = ModifiedPaillier(runtime, random) xs, rs, cs = [], [], [] for i in range(s): x = rand_int_signed(random, 2 ** k) r, c = paillier.encrypt_r(x, player_id=prover_id) xs.append(mpz(x)) rs.append(mpz(r)) cs.append(mpz(c)) return xs, rs, cs
def _generate_test_ciphertexts(self, random, runtime, k, s, prover_id): paillier = ModifiedPaillier(runtime, random) xs, rs, cs = [], [], [] for i in range(s): x = rand_int_signed(random, 2**k) r, c = paillier.encrypt_r(x, player_id=prover_id) xs.append(mpz(x)) rs.append(mpz(r)) cs.append(mpz(c)) return xs, rs, cs