Ejemplo n.º 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)
Ejemplo n.º 2
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)
Ejemplo n.º 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)
Ejemplo n.º 4
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)