commit ea7f29bb49ef3312c0bc22a3db2186c20162e09e
parent 6bcce333963bff1bb588abbe20156abf07004928
Author: Kévin Le Gouguec <kevin.legouguec@airbus.com>
Date: Wed, 13 Mar 2019 17:53:15 +0100
Génération de vecteurs Python selon la structure crypto_aead
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git 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