Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f68f7f7e
authored
Jul 16, 2019
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for xoody
parent
fbf91878
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
8 deletions
+18
-8
.gitignore
+2
-0
compile_all.py
+11
-1
logs/.mkdir
+0
-0
templates/uno/configure
+1
-1
test.py
+4
-6
No files found.
.gitignore
View file @
f68f7f7e
build/
measurements/
logs/
all-lwc-submission-files/
*.log
compile_all.py
View file @
f68f7f7e
...
...
@@ -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
)
...
...
logs/.mkdir
0 → 100644
View file @
f68f7f7e
templates/uno/configure
View file @
f68f7f7e
#!/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
test.py
View file @
f68f7f7e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment