diff options
Diffstat (limited to 'lib/Crypto/SelfTest/Cipher/test_AES.py')
-rw-r--r-- | lib/Crypto/SelfTest/Cipher/test_AES.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Crypto/SelfTest/Cipher/test_AES.py b/lib/Crypto/SelfTest/Cipher/test_AES.py index ea7c323..a675f8e 100644 --- a/lib/Crypto/SelfTest/Cipher/test_AES.py +++ b/lib/Crypto/SelfTest/Cipher/test_AES.py @@ -1422,8 +1422,14 @@ test_data = [ def get_tests(config={}): from Crypto.Cipher import AES + from Crypto.Util import cpuid from common import make_block_tests - return make_block_tests(AES, "AES", test_data) + + tests = make_block_tests(AES, "AES", test_data, {'use_aesni': False}) + if cpuid.have_aes_ni(): + # Run tests with AES-NI instructions if they are available. + tests += make_block_tests(AES, "AESNI", test_data, {'use_aesni': True}) + return tests if __name__ == '__main__': import unittest |