summaryrefslogtreecommitdiff
path: root/tests/test_key.py
diff options
context:
space:
mode:
authorMichael Manganiello <adamantike@users.noreply.github.com>2017-01-05 09:51:12 -0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-01-05 13:51:12 +0100
commit0c906333048f1760d27e579ce5fd7a140ee2b62c (patch)
treef15f81e1c64d53368e7e85f4a281817f716f9fc4 /tests/test_key.py
parentdc57888fe2ead24f111aee4c38427a8f411a5eb6 (diff)
downloadrsa-git-0c906333048f1760d27e579ce5fd7a140ee2b62c.tar.gz
Remove custom PrivateKey exponents/coefficient (#71)
Thanks for the improvements!
Diffstat (limited to 'tests/test_key.py')
-rw-r--r--tests/test_key.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_key.py b/tests/test_key.py
index afefa3a..9db30ce 100644
--- a/tests/test_key.py
+++ b/tests/test_key.py
@@ -41,6 +41,13 @@ class KeyGenTest(unittest.TestCase):
self.assertEqual(0x10001, priv.e)
self.assertEqual(0x10001, pub.e)
+ def test_exponents_coefficient_calculation(self):
+ pk = rsa.key.PrivateKey(3727264081, 65537, 3349121513, 65063, 57287)
+
+ self.assertEqual(pk.exp1, 55063)
+ self.assertEqual(pk.exp2, 10095)
+ self.assertEqual(pk.coef, 50797)
+
def test_custom_getprime_func(self):
# List of primes to test with, in order [p, q, p, q, ....]
# By starting with two of the same primes, we test that this is