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):
env['SRC_FILES'] = ' '.join(cfiles)
env['ASM_FILES'] = ' '.join(sfiles)
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
wd = os.getcwd()
......@@ -80,22 +83,15 @@ def build(algo_dir, template_dir, build_dir):
return True
# Find test vectors in directory or one of the parent directories
def find_test_vectors(d):
# Find test vectors in the test_vectors directory
def find_test_vectors(variant):
kat = None
while True:
if d == '':
raise Exception("Test vector not found")
for f in os.listdir(d):
if f.startswith("LWC_AEAD_KAT_") and f.endswith(".txt"):
if kat is not None:
raise Exception("Multiple test vectors?")
kat = f
if kat is None:
d = os.path.split(d)[0]
else:
break
kat = os.path.join(d, kat)
test_vectors_dir = os.path.join("test_vectors", variant)
for f in os.listdir(test_vectors_dir):
if f.startswith("LWC_AEAD_KAT_") and f.endswith(".txt"):
if kat is not None:
raise Exception("Multiple test vectors?")
kat = os.path.join(test_vectors_dir, f)
return kat
......@@ -173,7 +169,7 @@ def main(argv):
print(d)
# Test vectors file t
t = find_test_vectors(d)
t = find_test_vectors(variant)
print(t)
# 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