aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_kbkdf_vectors.py
diff options
context:
space:
mode:
authorJared <jamessenger@gmail.com>2016-05-29 17:32:37 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-05-29 19:32:37 -0500
commit6d7fe00c7066d8d474981b21cdadb16f021d3e6a (patch)
treef7b4010874132bec05b9a16f00f385f3d24636ae /tests/hazmat/primitives/test_kbkdf_vectors.py
parent502f8f39cbadf88ca6494e68f90e1b7e937cdb3e (diff)
downloadcryptography-6d7fe00c7066d8d474981b21cdadb16f021d3e6a.tar.gz
cryptography-6d7fe00c7066d8d474981b21cdadb16f021d3e6a.tar.bz2
cryptography-6d7fe00c7066d8d474981b21cdadb16f021d3e6a.zip
NIST SP 800-108 Counter Mode KDF (#2748)
* NIST SP 800-108 Counter Mode and Feedback Mode KDF * CounterKDF unit tests * Refactor to support multiple key based KDF modes. * Extracting supported algorithms for KBKDF Counter Mode test vectors * Adding support for different rlen and counter location in KBKDF * support for multiple L lengths and 24 bit counter length. * Adding KBKDF Documentation. * Refactoring KBKDF to KBKDFHMAC to describe hash algorithm used.
Diffstat (limited to 'tests/hazmat/primitives/test_kbkdf_vectors.py')
-rw-r--r--tests/hazmat/primitives/test_kbkdf_vectors.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_kbkdf_vectors.py b/tests/hazmat/primitives/test_kbkdf_vectors.py
new file mode 100644
index 00000000..c8263e2b
--- /dev/null
+++ b/tests/hazmat/primitives/test_kbkdf_vectors.py
@@ -0,0 +1,23 @@
+# This file is dual licensed under the terms of the Apache License, Version
+# 2.0, and the BSD License. See the LICENSE file in the root of this repository
+# for complete details.
+
+from __future__ import absolute_import, division, print_function
+
+import os
+
+import pytest
+
+from cryptography.hazmat.backends.interfaces import HMACBackend
+
+from .utils import generate_kbkdf_counter_mode_test
+from ...utils import load_nist_kbkdf_vectors
+
+
+@pytest.mark.requires_backend_interface(interface=HMACBackend)
+class TestCounterKDFCounterMode(object):
+ test_HKDFSHA1 = generate_kbkdf_counter_mode_test(
+ load_nist_kbkdf_vectors,
+ os.path.join("KDF"),
+ ["nist-800-108-KBKDF-CTR.txt"]
+ )