From ea7f29bb49ef3312c0bc22a3db2186c20162e09e Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 13 Mar 2019 17:53:15 +0100 Subject: Génération de vecteurs Python selon la structure crypto_aead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/genkat_aead.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'python') 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 -- cgit v1.2.3