コード例 #1
0
    def test_retrieve(self):
        for key in self.keys:
            points = crypto.split_key(key, n=5, k=5)
            reconstruction = crypto.retrieve_key(points)
            self.assertEqual(key, reconstruction)

            points = crypto.split_key(key, n=5, k=3)
            reconstruction = crypto.retrieve_key(points[:3])
            self.assertEqual(key, reconstruction)

            points = crypto.split_key(key, n=5, k=1)
            reconstruction = crypto.retrieve_key(points[:1])
            self.assertEqual(key, reconstruction)
コード例 #2
0
ファイル: test_crypto.py プロジェクト: EaterOA/sesamecontract
    def test_retrieve(self):
        for key in self.keys:
            points = crypto.split_key(key, n=5, k=5)
            reconstruction = crypto.retrieve_key(points)
            self.assertEqual(key, reconstruction)

            points = crypto.split_key(key, n=5, k=3)
            reconstruction = crypto.retrieve_key(points[:3])
            self.assertEqual(key, reconstruction)

            points = crypto.split_key(key, n=5, k=1)
            reconstruction = crypto.retrieve_key(points[:1])
            self.assertEqual(key, reconstruction)
コード例 #3
0
 def test_random_keys(self):
     for _ in range(100):
         key = self.generate_key()
         points = crypto.split_key(key, n=5, k=3)
         reconstruction = crypto.retrieve_key(points[:3])
         self.assertEqual(key, reconstruction)
コード例 #4
0
ファイル: test_crypto.py プロジェクト: EaterOA/sesamecontract
 def test_random_keys(self):
     for _ in range(100):
         key = self.generate_key()
         points = crypto.split_key(key, n=5, k=3)
         reconstruction = crypto.retrieve_key(points[:3])
         self.assertEqual(key, reconstruction)