Lines Matching refs:rsa

21 from rsa._compat import range
22 import rsa.prime
23 import rsa.randnum
31 self.assertFalse(rsa.prime.is_prime(-1))
32 self.assertFalse(rsa.prime.is_prime(0))
33 self.assertFalse(rsa.prime.is_prime(1))
34 self.assertTrue(rsa.prime.is_prime(2))
35 self.assertFalse(rsa.prime.is_prime(42))
36 self.assertTrue(rsa.prime.is_prime(41))
41 [x for x in range(901, 1000) if rsa.prime.is_prime(x)]
45 self.assertTrue(rsa.prime.is_prime(982451653))
46 self.assertFalse(rsa.prime.is_prime(982451653 * 961748941))
59 orig_randint = rsa.randnum.randint
60 rsa.randnum.randint = fake_randint
64 self.assertEqual(False, rsa.prime.miller_rabin_primality_testing(2787998641, 7))
73 self.assertEqual(True, rsa.prime.miller_rabin_primality_testing(2211417913,
77 rsa.randnum.randint = orig_randint
96 self.assertTrue(rsa.prime.is_prime(2**exp - 1))
101 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 63), 10)
102 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 127), 10)
103 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 255), 10)
104 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 511), 7)
105 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 767), 7)
106 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 1023), 4)
107 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 1279), 4)
108 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 1535), 3)
109 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 2047), 3)
110 self.assertEqual(rsa.prime.get_primality_testing_rounds(1 << 4095), 3)