aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-20 01:12:35 -1000
committerAlex Gaynor <alex.gaynor@gmail.com>2017-06-20 07:12:35 -0400
commita923b005a117d80549b923e286e6f7c7803976bf (patch)
tree9e7dff35e2afd6395b4b1878fbabccc2f2096caf /tests/utils.py
parent2ff4d01ac1d11e271a0e2a4267b74e89cc0bbfe1 (diff)
downloadcryptography-a923b005a117d80549b923e286e6f7c7803976bf.tar.gz
cryptography-a923b005a117d80549b923e286e6f7c7803976bf.tar.bz2
cryptography-a923b005a117d80549b923e286e6f7c7803976bf.zip
ed25519 vector loader (#3707)
* ed25519 vector loader * refactor to use unpacking
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 455b6bfe..0377c57d 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -817,3 +817,20 @@ def load_nist_kbkdf_vectors(vector_data):
test_data[name.lower()] = value.encode("ascii")
return vectors
+
+
+def load_ed25519_vectors(vector_data):
+ data = []
+ for line in vector_data:
+ secret_key, public_key, message, signature, _ = line.split(':')
+ # In the vectors the first element is secret key + public key
+ secret_key = secret_key[0:64]
+ # In the vectors the signature section is signature + message
+ signature = signature[0:128]
+ data.append({
+ "secret_key": secret_key,
+ "public_key": public_key,
+ "message": message,
+ "signature": signature
+ })
+ return data