summaryrefslogtreecommitdiff
path: root/traces/collect-traces.sh
diff options
context:
space:
mode:
Diffstat (limited to 'traces/collect-traces.sh')
-rwxr-xr-xtraces/collect-traces.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/traces/collect-traces.sh b/traces/collect-traces.sh
new file mode 100755
index 0000000..2b5eb1e
--- /dev/null
+++ b/traces/collect-traces.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -eu
+
+trace_type=$1
+patch=traces/${trace_type}.patch
+
+# To update these patches:
+# - add the tracing code you need to the source files
+# - run "git diff src > traces/foo.patch"
+
+d=$(mktemp -d)
+
+git apply ${patch}
+
+for makefile in $(find crypto_aead -name Makefile)
+do
+ implem_dir=$(dirname ${makefile})
+ make -C ${implem_dir} clean
+
+ [[ ${implem_dir} =~ lilliputae(i|ii)([0-9]+)v ]]
+
+ ae_type=${BASH_REMATCH[1]}
+ keysize=${BASH_REMATCH[2]}
+ make -C ${implem_dir} ${trace_type}-${keysize}-${ae_type}
+ cp ${implem_dir}/results/traces*.txt ${d}
+done
+
+tar czf results/${trace_type}.tgz -C ${d} .
+
+rm -r ${d}
+
+git apply --reverse ${patch}