Exemplo n.º 1
0
 def test_miller_rabin(self):
     for prime in self.primes:
         self.assertEqual(miller_rabin_test(prime, 3), PROBABLY_PRIME)
     for composite in self.composites:
         self.assertEqual(miller_rabin_test(composite, 3), COMPOSITE)
     self.assertRaises(ValueError, miller_rabin_test, -1, 3)
Exemplo n.º 2
0
 def test_miller_rabin(self):
     for prime in self.primes:
         self.assertEqual(miller_rabin_test(prime, 3), PROBABLY_PRIME)
     for composite in self.composites:
         self.assertEqual(miller_rabin_test(composite, 3), COMPOSITE)