aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-29 13:44:07 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-29 13:44:07 -0600
commit6fb1a5a99d3742763961d907c9f297f89f2f0b91 (patch)
treea642b45148b810e174d2d68ff4443a1acc2da8b8 /tests
parent831c04b669a8a2723c92407c029909850365db09 (diff)
downloadcryptography-6fb1a5a99d3742763961d907c9f297f89f2f0b91.tar.gz
cryptography-6fb1a5a99d3742763961d907c9f297f89f2f0b91.tar.bz2
cryptography-6fb1a5a99d3742763961d907c9f297f89f2f0b91.zip
add test for null char replacement
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index f852f3ab..8ecb33f9 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -180,6 +180,25 @@ def test_load_nist_vectors():
]
+def test_load_nist_vectors_with_null_chars():
+ vector_data = textwrap.dedent("""
+ COUNT = 0
+ KEY = thing\\0withnulls
+
+ COUNT = 1
+ KEY = 00000000000000000000000000000000
+ """).splitlines()
+
+ assert load_nist_vectors(vector_data) == [
+ {
+ "key": b"thing\x00withnulls",
+ },
+ {
+ "key": b"00000000000000000000000000000000",
+ },
+ ]
+
+
def test_load_cryptrec_vectors():
vector_data = textwrap.dedent("""
# Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/