diff options
author | Donald Stufft <donald@stufft.io> | 2013-08-10 12:24:59 -0700 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2013-08-10 12:24:59 -0700 |
commit | 2416c01a24eae37689551a05c9f7f6ad366955ea (patch) | |
tree | 575a97f1da75be15b8bcd26c210d4ad49247a78e /tests/utils.py | |
parent | 34c7a91c08413b92d6eec033a350d1d9423a3a9d (diff) | |
parent | f312a5c1c9ae436fa61debfdd8eb6ba6388fea1f (diff) | |
download | cryptography-2416c01a24eae37689551a05c9f7f6ad366955ea.tar.gz cryptography-2416c01a24eae37689551a05c9f7f6ad366955ea.tar.bz2 cryptography-2416c01a24eae37689551a05c9f7f6ad366955ea.zip |
Merge pull request #32 from alex/bytes-for-nist-vectors
Made the load NIST vectors test utility use bytes correctly
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py index 9fe35311..9362464e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,3 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os.path @@ -35,7 +48,7 @@ def load_nist_vectors(vector_data, op, fields): # We want to test only for a particular operation return [ - tuple(vector[1][f] for f in fields) + tuple(vector[1][f].encode("ascii") for f in fields) for vector in sorted(data[op].items(), key=lambda v: v[0]) ] |