Adding CAVP vector parsing for NIST SP 800-108 KDF vectors. (#2865)
diff --git a/tests/utils.py b/tests/utils.py
index 3970109..dc7377a 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -809,3 +809,40 @@
             vector = {}
 
     return vectors
+
+
+def load_nist_kbkdf_vectors(vector_data):
+    """
+    Load NIST SP 800-108 KDF Vectors
+    """
+    vectors = []
+    test_data = None
+    tag = {}
+
+    for line in vector_data:
+        line = line.strip()
+
+        if not line or line.startswith("#"):
+            continue
+
+        if line.startswith("[") and line.endswith("]"):
+            tag_data = line[1:-1]
+            name, value = [c.strip() for c in tag_data.split("=")]
+            if value.endswith('_BITS'):
+                value = int(value.split('_')[0])
+                tag.update({name.lower(): value})
+                continue
+
+            tag.update({name.lower(): value.lower()})
+        elif line.startswith("COUNT="):
+            test_data = dict()
+            test_data.update(tag)
+            vectors.append(test_data)
+        elif line.startswith("L"):
+            name, value = [c.strip() for c in line.split("=")]
+            test_data[name.lower()] = int(value)
+        else:
+            name, value = [c.strip() for c in line.split("=")]
+            test_data[name.lower()] = value.encode("ascii")
+
+    return vectors