From d3ce70317016791079212d7256c3b7f195b4a375 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 11 Nov 2013 14:46:20 -0800 Subject: Ignore the sections of the NIST files --- tests/hazmat/primitives/test_blowfish.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/hazmat/primitives/test_blowfish.py') diff --git a/tests/hazmat/primitives/test_blowfish.py b/tests/hazmat/primitives/test_blowfish.py index a7f13823..6f670ad7 100644 --- a/tests/hazmat/primitives/test_blowfish.py +++ b/tests/hazmat/primitives/test_blowfish.py @@ -24,7 +24,7 @@ from ...utils import load_nist_vectors_from_file class TestBlowfish(object): test_ECB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + lambda path: load_nist_vectors_from_file(path), os.path.join("ciphers", "Blowfish"), ["bf-ecb.txt"], lambda key: algorithms.Blowfish(binascii.unhexlify(key)), @@ -36,7 +36,7 @@ class TestBlowfish(object): ) test_CBC = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + lambda path: load_nist_vectors_from_file(path), os.path.join("ciphers", "Blowfish"), ["bf-cbc.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), @@ -48,7 +48,7 @@ class TestBlowfish(object): ) test_OFB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + lambda path: load_nist_vectors_from_file(path), os.path.join("ciphers", "Blowfish"), ["bf-ofb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), @@ -60,7 +60,7 @@ class TestBlowfish(object): ) test_CFB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + lambda path: load_nist_vectors_from_file(path), os.path.join("ciphers", "Blowfish"), ["bf-cfb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), -- cgit v1.2.3 From f7f6a9f77ade1b190766c37cc8967375b5093175 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 11 Nov 2013 20:43:52 -0600 Subject: Remove separate file loaders and replace with one All tests updated to work with the new simplified loader --- tests/hazmat/primitives/test_blowfish.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/hazmat/primitives/test_blowfish.py') diff --git a/tests/hazmat/primitives/test_blowfish.py b/tests/hazmat/primitives/test_blowfish.py index 6f670ad7..eea0ac33 100644 --- a/tests/hazmat/primitives/test_blowfish.py +++ b/tests/hazmat/primitives/test_blowfish.py @@ -19,12 +19,12 @@ import os from cryptography.hazmat.primitives.ciphers import algorithms, modes from .utils import generate_encrypt_test -from ...utils import load_nist_vectors_from_file +from ...utils import load_nist_vectors class TestBlowfish(object): test_ECB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path), + load_nist_vectors, os.path.join("ciphers", "Blowfish"), ["bf-ecb.txt"], lambda key: algorithms.Blowfish(binascii.unhexlify(key)), @@ -36,7 +36,7 @@ class TestBlowfish(object): ) test_CBC = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path), + load_nist_vectors, os.path.join("ciphers", "Blowfish"), ["bf-cbc.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), @@ -48,7 +48,7 @@ class TestBlowfish(object): ) test_OFB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path), + load_nist_vectors, os.path.join("ciphers", "Blowfish"), ["bf-ofb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), @@ -60,7 +60,7 @@ class TestBlowfish(object): ) test_CFB = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path), + load_nist_vectors, os.path.join("ciphers", "Blowfish"), ["bf-cfb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), -- cgit v1.2.3 From e5aa205070877852ff2d54eebcc0d4ac9cf8465e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 13 Nov 2013 09:49:23 -0800 Subject: Also remove teh ciphers specific class --- tests/hazmat/primitives/test_blowfish.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/hazmat/primitives/test_blowfish.py') diff --git a/tests/hazmat/primitives/test_blowfish.py b/tests/hazmat/primitives/test_blowfish.py index eea0ac33..d5fbed6f 100644 --- a/tests/hazmat/primitives/test_blowfish.py +++ b/tests/hazmat/primitives/test_blowfish.py @@ -29,7 +29,7 @@ class TestBlowfish(object): ["bf-ecb.txt"], lambda key: algorithms.Blowfish(binascii.unhexlify(key)), lambda key: modes.ECB(), - only_if=lambda backend: backend.ciphers.supported( + only_if=lambda backend: backend.cipher_supported( algorithms.Blowfish("\x00" * 56), modes.ECB() ), skip_message="Does not support Blowfish ECB", @@ -41,7 +41,7 @@ class TestBlowfish(object): ["bf-cbc.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.CBC(binascii.unhexlify(iv)), - only_if=lambda backend: backend.ciphers.supported( + only_if=lambda backend: backend.cipher_supported( algorithms.Blowfish("\x00" * 56), modes.CBC("\x00" * 8) ), skip_message="Does not support Blowfish CBC", @@ -53,7 +53,7 @@ class TestBlowfish(object): ["bf-ofb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.OFB(binascii.unhexlify(iv)), - only_if=lambda backend: backend.ciphers.supported( + only_if=lambda backend: backend.cipher_supported( algorithms.Blowfish("\x00" * 56), modes.OFB("\x00" * 8) ), skip_message="Does not support Blowfish OFB", @@ -65,7 +65,7 @@ class TestBlowfish(object): ["bf-cfb.txt"], lambda key, iv: algorithms.Blowfish(binascii.unhexlify(key)), lambda key, iv: modes.CFB(binascii.unhexlify(iv)), - only_if=lambda backend: backend.ciphers.supported( + only_if=lambda backend: backend.cipher_supported( algorithms.Blowfish("\x00" * 56), modes.CFB("\x00" * 8) ), skip_message="Does not support Blowfish CFB", -- cgit v1.2.3