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
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))