Skip to content

Commit

Permalink
Merge pull request #74 from GiacomoPope/test_typo
Browse files Browse the repository at this point in the history
fix typo in comment
  • Loading branch information
GiacomoPope authored Jul 24, 2024
2 parents 015ce9e + be0dc9b commit 91bbd21
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_drbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ def test_bad_seed(self):
self.assertRaises(ValueError, lambda: AES256_CTR_DRBG(seed))

def test_personalization(self):
# if the personalization is longer than 48 bytes, fail
seed = os.urandom(48)
personalization = os.urandom(24)
drbg = AES256_CTR_DRBG(seed, personalization)
self.assertEqual(AES256_CTR_DRBG, type(drbg))
self.assertEqual(32, len(drbg.random_bytes(32)))
self.assertEqual(bytes, type(drbg.random_bytes(32)))

def test_bad_personalization(self):
# if the personalization is longer than 48 bytes, fail
Expand All @@ -41,11 +42,11 @@ def test_bad_personalization(self):
def test_additional(self):
drbg = AES256_CTR_DRBG()
additional = os.urandom(24)
b = drbg.random_bytes(32, additional)
self.assertEqual(len(b), 32)
self.assertEqual(type(b), bytes)
self.assertEqual(32, len(drbg.random_bytes(32, additional)))
self.assertEqual(bytes, type(drbg.random_bytes(32, additional)))

def test_bad_additional(self):
# if the additional data is longer than 48 bytes, fail
drbg = AES256_CTR_DRBG()
additional = os.urandom(49)
self.assertRaises(
Expand Down

0 comments on commit 91bbd21

Please sign in to comment.