Esempio n. 1
0
    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)]
Esempio n. 2
0
    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)]
Esempio n. 3
0
 def test_prss_zero(self):
     share = prss.prss_zero(None, None, None, self.field, None, None, 1)[0]
     self.assertEquals(share, self.field(0))
Esempio n. 4
0
 def test_prss_zero(self):
     share = prss.prss_zero(None, None, None, self.field, None, None, 1)[0]
     self.assertEquals(share, self.field(0))