Exemple #1
0
    def _share_single(self, si, degree, field):
        inputters = range(1, self.num_players + 1)
        if self._hyper is None:
            self._hyper = hyper(self.num_players, field)

        svec = self.shamir_share(inputters, field, si, degree)
        rvec = self._hyper * Matrix([svec]).transpose()
        rvec = rvec.transpose().rows[0]
        return svec, rvec
Exemple #2
0
    def _share_single(self, si, degree, field):
        inputters = range(1, self.num_players + 1)
        if self._hyper is None:
            self._hyper = hyper(self.num_players, field)

        svec = self.shamir_share(inputters, field, si, degree)
        rvec = self._hyper * Matrix([svec]).transpose()
        rvec = rvec.transpose().rows[0]
        return svec, rvec
Exemple #3
0
 def test_hyper(self):
     """Checks that a generated matrix is hyper-invertible."""
     Zp = GF(47)
     for i in range(1, 6):
         m = hyper(i, Zp)
         self.assertTrue(self.is_hyper(m))
Exemple #4
0
 def test_hyper(self):
     """Checks that a generated matrix is hyper-invertible."""
     Zp = GF(47)
     for i in range(1, 6):
         m = hyper(i, Zp)
         self.assertTrue(self.is_hyper(m))