aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2013-11-11 16:05:58 -0800
committerDavid Reid <dreid@dreid.org>2013-11-11 16:05:58 -0800
commit92beb221fc0a1bd8ef1b955a98e1385daed0f207 (patch)
treebbf0a9b6fdee1423ad3a8e8f63944b5d1eaeb9bf /tests/hazmat
parent1759037b7078872e67e81f43518131a3f7021b4f (diff)
parentcf5fb332af542a6a38da8b8f481a358f32e5e154 (diff)
downloadcryptography-92beb221fc0a1bd8ef1b955a98e1385daed0f207.tar.gz
cryptography-92beb221fc0a1bd8ef1b955a98e1385daed0f207.tar.bz2
cryptography-92beb221fc0a1bd8ef1b955a98e1385daed0f207.zip
Merge pull request #242 from alex/ignore-nist-sections
Ignore the sections of the NIST files
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/test_3des.py12
-rw-r--r--tests/hazmat/primitives/test_aes.py8
-rw-r--r--tests/hazmat/primitives/test_arc4.py4
-rw-r--r--tests/hazmat/primitives/test_blowfish.py8
-rw-r--r--tests/hazmat/primitives/test_cast5.py6
5 files changed, 18 insertions, 20 deletions
diff --git a/tests/hazmat/primitives/test_3des.py b/tests/hazmat/primitives/test_3des.py
index af6bdc04..1543cfd7 100644
--- a/tests/hazmat/primitives/test_3des.py
+++ b/tests/hazmat/primitives/test_3des.py
@@ -28,7 +28,7 @@ from ...utils import load_nist_vectors_from_file
class TestTripleDES_CBC(object):
test_KAT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "CBC"),
[
"TCBCinvperm.rsp",
@@ -42,7 +42,7 @@ class TestTripleDES_CBC(object):
)
test_MMT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "CBC"),
[
"TCBCMMT1.rsp",
@@ -58,7 +58,7 @@ class TestTripleDES_CBC(object):
class TestTripleDES_OFB(object):
test_KAT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "OFB"),
[
"TOFBpermop.rsp",
@@ -72,7 +72,7 @@ class TestTripleDES_OFB(object):
)
test_MMT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "OFB"),
[
"TOFBMMT1.rsp",
@@ -88,7 +88,7 @@ class TestTripleDES_OFB(object):
class TestTripleDES_CFB(object):
test_KAT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "CFB"),
[
"TCFB64invperm.rsp",
@@ -102,7 +102,7 @@ class TestTripleDES_CFB(object):
)
test_MMT = generate_encrypt_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "3DES", "CFB"),
[
"TCFB64MMT1.rsp",
diff --git a/tests/hazmat/primitives/test_aes.py b/tests/hazmat/primitives/test_aes.py
index 66471fac..c4818409 100644
--- a/tests/hazmat/primitives/test_aes.py
+++ b/tests/hazmat/primitives/test_aes.py
@@ -26,7 +26,7 @@ from ...utils import (
class TestAES(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", "AES", "CBC"),
[
"CBCGFSbox128.rsp",
@@ -50,7 +50,7 @@ class TestAES(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", "AES", "ECB"),
[
"ECBGFSbox128.rsp",
@@ -74,7 +74,7 @@ class TestAES(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", "AES", "OFB"),
[
"OFBGFSbox128.rsp",
@@ -98,7 +98,7 @@ class TestAES(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", "AES", "CFB"),
[
"CFB128GFSbox128.rsp",
diff --git a/tests/hazmat/primitives/test_arc4.py b/tests/hazmat/primitives/test_arc4.py
index cf0c5eb4..71b5d63a 100644
--- a/tests/hazmat/primitives/test_arc4.py
+++ b/tests/hazmat/primitives/test_arc4.py
@@ -23,8 +23,8 @@ from ...utils import load_nist_vectors_from_file
class TestARC4(object):
- test_thing = generate_stream_encryption_test(
- lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
+ test_rfc = generate_stream_encryption_test(
+ lambda path: load_nist_vectors_from_file(path),
os.path.join("ciphers", "ARC4"),
[
"rfc-6229-40.txt",
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)),
diff --git a/tests/hazmat/primitives/test_cast5.py b/tests/hazmat/primitives/test_cast5.py
index b2988437..4256e2c4 100644
--- a/tests/hazmat/primitives/test_cast5.py
+++ b/tests/hazmat/primitives/test_cast5.py
@@ -24,11 +24,9 @@ from ...utils import load_nist_vectors_from_file
class TestCAST5(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", "CAST5"),
- [
- "cast5-ecb.txt",
- ],
+ ["cast5-ecb.txt"],
lambda key: algorithms.CAST5(binascii.unhexlify((key))),
lambda key: modes.ECB(),
only_if=lambda backend: backend.ciphers.supported(