PRESENT: inverse PBox is calculated on import -> speed gain
[python-cryptoplus.git] / test / test_doctests.py
blob06ba82497c346803ec398b86796230e552a089ef
1 #!/usr/bin/env python
3 import unittest
4 import doctest
5 from pkg_resources import require
6 require("CryptoPlus>=1.0")
7 #import CryptoPlus.Cipher.python_AES
8 from CryptoPlus.Cipher import python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT
9 try:
10 from CryptoPlus.Cipher import IDEA
11 from CryptoPlus.Cipher import RC5
12 import_error = 0
13 except ImportError:
14 import_error = 1
16 suite = unittest.TestSuite()
17 #for mod in (CryptoPlus.Cipher.python_AES,CryptoPlus.Cipher.python_AES):
18 for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT:
19 suite.addTest(doctest.DocTestSuite(mod))
20 if not import_error:
21 suite.addTest(doctest.DocTestSuite(IDEA))
22 suite.addTest(doctest.DocTestSuite(RC5))
23 runner = unittest.TextTestRunner(verbosity=2)
24 runner.run(suite)