Added SelfTest module + some fixes
[python-cryptoplus.git] / src / SelfTest / Cipher / __init__.py
blob945db7df2e804124867d6b6cb414af04bee713e6
1 # -*- coding: utf-8 -*-
3 # SelfTest/Cipher/__init__.py: Self-test for cipher modules
5 # =======================================================================
6 # Copyright (C) 2008 Dwayne C. Litzenberger <dlitz@dlitz.net>
8 # Permission is hereby granted, free of charge, to any person obtaining
9 # a copy of this software and associated documentation files (the
10 # "Software"), to deal in the Software without restriction, including
11 # without limitation the rights to use, copy, modify, merge, publish,
12 # distribute, sublicense, and/or sell copies of the Software, and to
13 # permit persons to whom the Software is furnished to do so.
15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 # =======================================================================
29 """Self-test for cipher modules"""
31 __revision__ = "$Id$"
33 def get_tests():
34 tests = []
35 import test_AES; tests += test_AES.get_tests()
36 import test_ARC2; tests += test_ARC2.get_tests()
37 import test_ARC4; tests += test_ARC4.get_tests()
38 import test_Blowfish; tests += test_Blowfish.get_tests()
39 import test_CAST; tests += test_CAST.get_tests()
40 import test_DES3; tests += test_DES3.get_tests()
41 import test_DES; tests += test_DES.get_tests()
42 import test_IDEA; tests += test_IDEA.get_tests()
43 import test_RC5; tests += test_RC5.get_tests()
44 import test_XOR; tests += test_XOR.get_tests()
45 return tests
47 if __name__ == '__main__':
48 import unittest
49 suite = lambda: unittest.TestSuite(get_tests())
50 unittest.main(defaultTest='suite')
52 # vim:set ts=4 sw=4 sts=4 expandtab: