diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-11 14:46:20 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-11 14:46:20 -0800 |
commit | d3ce70317016791079212d7256c3b7f195b4a375 (patch) | |
tree | 729747ea4a7d6c7e4e7e316f99317b4150c814d6 /tests/utils.py | |
parent | a3d71d471856e6c76cc1cc543efecb504dbe5c33 (diff) | |
download | cryptography-d3ce70317016791079212d7256c3b7f195b4a375.tar.gz cryptography-d3ce70317016791079212d7256c3b7f195b4a375.tar.bz2 cryptography-d3ce70317016791079212d7256c3b7f195b4a375.zip |
Ignore the sections of the NIST files
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 13 |
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): |