Commit f68f7f7e by Enrico Pozzobon

fixes for xoody

parent fbf91878
build/
measurements/
logs/
all-lwc-submission-files/
*.log
......@@ -148,12 +148,22 @@ def main(argv):
test_script_path = os.path.join("build", "test_all.sh")
with open(test_script_path, 'w') as test_script:
test_script.write("#!/bin/sh\n")
test_script.write("mkdir -p logs\n")
test_script.write("mkdir -p measurements\n")
for t, d in files:
print()
print(d)
try:
b = build(d, template_dir)
test_script.write("echo \"TESTING %s\"\n./test.py %s %s\n" % (d, t, os.path.join(b, 'test')))
test_script.write("echo \"TESTING %s\"\n" % d)
test_script.write("./test.py %s %s 2> %s | tee %s\n" % (
t,
os.path.join(b, 'test'),
os.path.join(b, 'test_stderr.log'),
os.path.join(b, 'test_stdout.log'))
#./test.py all-lwc-submission-files/tinyjambu/Implementations/crypto_aead/tinyjambu192/LWC_AEAD_KAT_192_96.txt build/731759111/test 2> build/731759111/test_stderr.log | tee build/731759111/test_stdout.log
print("COMPILATION SUCCESS FOR %s" % d)
except Exception:
print("COMPILATION FAILED FOR %s" % d)
......
#!/bin/bash
mv -n *.c *.C *.s *.S src/
mv -n *.h *.H include/
mv -n *.inc *.h *.H include/
sed -i src/encrypt.c -e "s/\(\s\)init(/\1_init(/g"
exit 0
......@@ -11,14 +11,13 @@ def main(argv):
if len(argv) < 3:
print("Usage: test.py LWC_AEAD_KAT.txt program [arguments]")
test_file = open(argv[1], 'r')
cmd = argv[2:]
for attempt in range(3):
print("beginning test %d of '%s' using test vectors '%s'" % (attempt, ' '.join(cmd), argv[1]))
measurements = begin_measurement()
try:
test(test_file, cmd)
test(argv[1], cmd)
print("TEST SUCCESSFUL")
return 0
except Exception as ex:
......@@ -34,6 +33,7 @@ def main(argv):
def test(test_file, cmd):
test_file = open(test_file, 'r')
p = Popen(cmd, bufsize=0, stdin=PIPE, stdout=PIPE)
def write(data):
......@@ -113,8 +113,6 @@ def test(test_file, cmd):
if m != output:
raise Exception("output of encryption is different from expected ciphertext")
elif res is not None:
if res[1].lower() == 'count':
i = int(res[2], 10)
......@@ -129,9 +127,9 @@ def test(test_file, cmd):
elif res[1].lower() == 'ct':
c = bytes.fromhex(res[2])
else:
print("ERROR: unparsed line in test vectors file: '%s'" % res)
raise Exception("ERROR: unparsed line in test vectors file: '%s'" % res)
else:
print("ERROR: unparsed line in test vectors file: '%s'" % line)
raise Exception("ERROR: unparsed line in test vectors file: '%s'" % line)
def begin_measurement():
import saleae
......
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