Commit b9b46f04 by Enrico Pozzobon

get test vectors from internal directory instead of submission

parent d1739748
...@@ -54,6 +54,9 @@ def build(algo_dir, template_dir, build_dir): ...@@ -54,6 +54,9 @@ def build(algo_dir, template_dir, build_dir):
env['SRC_FILES'] = ' '.join(cfiles) env['SRC_FILES'] = ' '.join(cfiles)
env['ASM_FILES'] = ' '.join(sfiles) env['ASM_FILES'] = ' '.join(sfiles)
env['HDR_FILES'] = ' '.join(hfiles) env['HDR_FILES'] = ' '.join(hfiles)
print("SRC_FILES is '%s'" % env['SRC_FILES'])
print("ASM_FILES is '%s'" % env['ASM_FILES'])
print("HDR_FILES is '%s'" % env['HDR_FILES'])
# enter the directory and execute the makefile # enter the directory and execute the makefile
wd = os.getcwd() wd = os.getcwd()
...@@ -80,22 +83,15 @@ def build(algo_dir, template_dir, build_dir): ...@@ -80,22 +83,15 @@ def build(algo_dir, template_dir, build_dir):
return True return True
# Find test vectors in directory or one of the parent directories # Find test vectors in the test_vectors directory
def find_test_vectors(d): def find_test_vectors(variant):
kat = None kat = None
while True: test_vectors_dir = os.path.join("test_vectors", variant)
if d == '': for f in os.listdir(test_vectors_dir):
raise Exception("Test vector not found")
for f in os.listdir(d):
if f.startswith("LWC_AEAD_KAT_") and f.endswith(".txt"): if f.startswith("LWC_AEAD_KAT_") and f.endswith(".txt"):
if kat is not None: if kat is not None:
raise Exception("Multiple test vectors?") raise Exception("Multiple test vectors?")
kat = f kat = os.path.join(test_vectors_dir, f)
if kat is None:
d = os.path.split(d)[0]
else:
break
kat = os.path.join(d, kat)
return kat return kat
...@@ -173,7 +169,7 @@ def main(argv): ...@@ -173,7 +169,7 @@ def main(argv):
print(d) print(d)
# Test vectors file t # Test vectors file t
t = find_test_vectors(d) t = find_test_vectors(variant)
print(t) print(t)
# if include_list was provided, skip elements not in the list # if include_list was provided, skip elements not in the list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment