def prss_share_zero(self, field, quantity): """Generate *quantity* shares of the zero element from the field given. Communication cost: none. """ # Key used for PRSS. prss_key = self.prss_key() prfs = self.players[self.id].prfs(field.modulus) zero_share = prss_zero(self.num_players, self.threshold, self.id, field, prfs, prss_key, quantity) return [Share(self, field, zero_share[i]) for i in range(quantity)]
def test_prss_zero(self): share = prss.prss_zero(None, None, None, self.field, None, None, 1)[0] self.assertEquals(share, self.field(0))