From 2b758679b3cc2ba936734b34e0865905b4340c5a Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 30 Oct 2013 09:01:38 -0500 Subject: restructure vectors into ciphers/hashes/hmac --- tests/test_utils.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests/test_utils.py') diff --git a/tests/test_utils.py b/tests/test_utils.py index db9ac085..93bae018 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import textwrap import pytest @@ -133,7 +134,7 @@ def test_load_nist_vectors_decrypt(): def test_load_nist_vectors_from_file_encrypt(): assert load_nist_vectors_from_file( - "AES/KAT/CBCGFSbox128.rsp", + os.path.join("ciphers", "AES", "KAT", "CBCGFSbox128.rsp"), "ENCRYPT" ) == [ { @@ -183,7 +184,7 @@ def test_load_nist_vectors_from_file_encrypt(): def test_load_nist_vectors_from_file_decrypt(): assert load_nist_vectors_from_file( - "AES/KAT/CBCGFSbox128.rsp", + os.path.join("ciphers", "AES", "KAT", "CBCGFSbox128.rsp"), "DECRYPT", ) == [ { @@ -287,7 +288,7 @@ def test_load_cryptrec_vectors_invalid(): def test_load_cryptrec_vectors_from_file_encrypt(): test_set = load_cryptrec_vectors_from_file( - "Camellia/NTT/camellia-128-ecb.txt" + os.path.join("ciphers", "Camellia", "camellia-128-ecb.txt"), ) assert test_set[0] == ( { @@ -351,7 +352,9 @@ def test_load_openssl_vectors(): def test_load_openssl_vectors_from_file(): - test_list = load_openssl_vectors_from_file("Camellia/camellia-ofb.txt") + test_list = load_openssl_vectors_from_file( + os.path.join("ciphers", "Camellia", "camellia-ofb.txt") + ) assert len(test_list) == 24 assert test_list[:4] == [ { @@ -440,7 +443,9 @@ def test_load_hash_vectors_bad_data(): def test_load_hash_vectors_from_file(): - test_list = load_hash_vectors_from_file("RFC/MD5/rfc-1321.txt") + test_list = load_hash_vectors_from_file( + os.path.join("hashes", "MD5", "rfc-1321.txt") + ) assert len(test_list) == 7 assert test_list[:4] == [ (b"", "d41d8cd98f00b204e9800998ecf8427e"), -- cgit v1.2.3 From 20884bfabe140802182e9af01e9446705b0298bc Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 31 Oct 2013 12:08:11 -0500 Subject: update tests for new test vector locations --- tests/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_utils.py') diff --git a/tests/test_utils.py b/tests/test_utils.py index 93bae018..0692c8d1 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -134,7 +134,7 @@ def test_load_nist_vectors_decrypt(): def test_load_nist_vectors_from_file_encrypt(): assert load_nist_vectors_from_file( - os.path.join("ciphers", "AES", "KAT", "CBCGFSbox128.rsp"), + os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp"), "ENCRYPT" ) == [ { @@ -184,7 +184,7 @@ def test_load_nist_vectors_from_file_encrypt(): def test_load_nist_vectors_from_file_decrypt(): assert load_nist_vectors_from_file( - os.path.join("ciphers", "AES", "KAT", "CBCGFSbox128.rsp"), + os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp"), "DECRYPT", ) == [ { -- cgit v1.2.3