summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-13 17:53:15 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2019-03-13 17:53:15 +0100
commitea7f29bb49ef3312c0bc22a3db2186c20162e09e (patch)
tree0bbd5664656b8b9d499a98458d7e9abeb2df2fdc /python
parent6bcce333963bff1bb588abbe20156abf07004928 (diff)
downloadlilliput-ae-implem-ea7f29bb49ef3312c0bc22a3db2186c20162e09e.tar.xz
Génération de vecteurs Python selon la structure crypto_aead
Diffstat (limited to 'python')
-rwxr-xr-xpython/genkat_aead.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/python/genkat_aead.py b/python/genkat_aead.py
index 5a50e03..e9f9101 100755
--- a/python/genkat_aead.py
+++ b/python/genkat_aead.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import lilliput
+from os import makedirs, path
MAX_MESSAGE_LENGTH = 32
@@ -33,10 +34,18 @@ class DecryptionError(Exception):
def generate_test_vectors(mode, keylen):
-
print('generating for', mode, keylen)
- output_path = 'LWC_AEAD_KAT_{mode}_{keylen}'.format(mode=mode, keylen=keylen)
+ directory = 'crypto_aead/lilliputae{mode}{keylen}v1'.format(
+ mode=mode*'i', keylen=keylen
+ )
+
+ makedirs(directory, exist_ok=True)
+
+ output_path = path.join(
+ directory, 'LWC_AEAD_KAT_{keylen}_120.txt'.format(keylen=keylen)
+ )
+
with open(output_path, 'w') as output:
count = 1