aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/utils.py b/tests/utils.py
index cc56a9ac..0b215543 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -14,7 +14,7 @@
import os.path
-def load_nist_vectors(vector_data, op):
+def load_nist_vectors(vector_data):
section = None
count = None
data = {}
@@ -35,32 +35,29 @@ def load_nist_vectors(vector_data, op):
section = line[1:-1]
continue
- if section != op:
- continue
-
# Build our data using a simple Key = Value format
name, value = line.split(" = ")
# COUNT is a special token that indicates a new block of data
if name.upper() == "COUNT":
count = value
- data[count] = {}
+ data[section, count] = {}
# For all other tokens we simply want the name, value stored in
# the dictionary
else:
- data[count][name.lower()] = value.encode("ascii")
+ data[section, count][name.lower()] = value.encode("ascii")
# We want to test only for a particular operation, we sort them for the
# benefit of the tests of this function.
return [v for k, v in sorted(data.items(), key=lambda kv: kv[0])]
-def load_nist_vectors_from_file(filename, op):
+def load_nist_vectors_from_file(filename):
base = os.path.join(
os.path.dirname(__file__), "hazmat", "primitives", "vectors",
)
with open(os.path.join(base, filename), "r") as vector_file:
- return load_nist_vectors(vector_file, op)
+ return load_nist_vectors(vector_file)
def load_cryptrec_vectors_from_file(filename):