Skip to content

Commit

Permalink
fixed no longer working unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardThiessen committed Oct 9, 2017
1 parent 34d4004 commit 567e3f7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/test_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,23 @@ 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
# properly rejected.
primes = [64123, 64123, 64123, 50957, 39317, 33107]
primes = [64123, 64123,#discarded because identical
61871, 61909,#rejected because too close
64123, 50957,#discarded because of custom exponent
61871, 46877]#should be returned

def getprime(_):
def getprime(a,b):
return primes.pop(0)

# This exponent will cause two other primes to be generated.
exponent = 136407

(p, q, e, d) = rsa.key.gen_keys(64,
(p, q, e, d) = rsa.key.gen_keys(32,
accurate=False,
getprime_func=getprime,
exponent=exponent)
self.assertEqual(39317, p)
self.assertEqual(33107, q)
self.assertEqual(61871, p)
self.assertEqual(46877, q)


class HashTest(unittest.TestCase):
Expand Down

0 comments on commit 567e3f7

Please sign in to comment.