diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-13 17:53:15 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-13 17:53:15 +0100 |
| commit | ea7f29bb49ef3312c0bc22a3db2186c20162e09e (patch) | |
| tree | 0bbd5664656b8b9d499a98458d7e9abeb2df2fdc /python/genkat_aead.py | |
| parent | 6bcce333963bff1bb588abbe20156abf07004928 (diff) | |
| download | lilliput-ae-implem-ea7f29bb49ef3312c0bc22a3db2186c20162e09e.tar.xz | |
Génération de vecteurs Python selon la structure crypto_aead
Diffstat (limited to 'python/genkat_aead.py')
| -rwxr-xr-x | python/genkat_aead.py | 13 |
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 |
