summaryrefslogtreecommitdiff
path: root/tests/test_rc4.py
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-02-25 18:23:10 +0200
committerMatěj Cepl <mcepl@cepl.eu>2015-11-18 17:39:06 +0100
commitd0a05f8fc075ce00768c75388955c45a9d69a9bd (patch)
tree7bcebdd6ae4587deccc2803bc39d75d3fac4690c /tests/test_rc4.py
parent02216b5dde835dee8abfead52688eb8736bc1e8b (diff)
downloadm2crypto-d0a05f8fc075ce00768c75388955c45a9d69a9bd.tar.gz
Cleanup of test_rc4.py (just whitespace changes).
Diffstat (limited to 'tests/test_rc4.py')
-rw-r--r--tests/test_rc4.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/test_rc4.py b/tests/test_rc4.py
index 523285f..017324f 100644
--- a/tests/test_rc4.py
+++ b/tests/test_rc4.py
@@ -8,8 +8,8 @@ try:
import unittest2 as unittest
except ImportError:
import unittest
+from M2Crypto import RC4, Rand
from binascii import hexlify
-from M2Crypto import RC4
from fips import fips_mode
@@ -22,27 +22,28 @@ class RC4TestCase(unittest.TestCase):
"""
vectors = (('Key', 'Plaintext', 'BBF316E8D940AF0AD3'),
('Wiki', 'pedia', '1021BF0420'),
- ('Secret', 'Attack at dawn', '45A01F645FC35B383552544B9BF5'))
-
+ ('Secret', 'Attack at dawn',
+ '45A01F645FC35B383552544B9BF5'))
+
rc4 = RC4.RC4()
for key, plaintext, ciphertext in vectors:
rc4.set_key(key)
- self.assertEqual(hexlify(rc4.update(plaintext)).upper(), ciphertext)
+ self.assertEqual(hexlify(rc4.update(plaintext)).upper(),
+ ciphertext)
self.assertEqual(rc4.final(), '')
-
+
@unittest.skipIf(fips_mode, "Can't be run in FIPS mode")
def test_bad(self):
rc4 = RC4.RC4('foo')
self.assertNotEqual(hexlify(rc4.update('bar')).upper(), '45678')
-
-
+
+
def suite():
return unittest.makeSuite(RC4TestCase)
-
+
if __name__ == '__main__':
- Rand.load_file('randpool.dat', -1)
+ Rand.load_file('randpool.dat', -1)
unittest.TextTestRunner().run(suite())
Rand.save_file('randpool.dat')
-