From 6f95cb1f104759d198f252c3064ba061a52918c0 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Wed, 28 Nov 2018 14:56:20 +0100 Subject: Ajout de patchs pour la génération de traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … Y a probablement une façon plus simple de gérer tout ça, mais je la vois pas là tout de suite. --- Makefile | 4 + collect-traces.sh | 14 +++ traces.patch | 275 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 293 insertions(+) create mode 100755 collect-traces.sh create mode 100644 traces.patch diff --git a/Makefile b/Makefile index dbae0f9..5395158 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,10 @@ $(delegated):: make -C $$i $@; \ done +# To generate complete traces, apply this patch before running "make traces": +# $ git apply traces.patch +# To update this patch, add print statements, then run +# $ git diff src > traces.patch traces:: @ echo "Collecting traces" @ ./collect-traces.sh diff --git a/collect-traces.sh b/collect-traces.sh new file mode 100755 index 0000000..0b50adc --- /dev/null +++ b/collect-traces.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eu + +d=$(mktemp -d) + +for f in $(find . -name 'traces-*.txt') +do + cp ${f} ${d} +done + +tar czf traces.tgz -C ${d} . + +rm -r ${d} diff --git a/traces.patch b/traces.patch new file mode 100644 index 0000000..8aecdf6 --- /dev/null +++ b/traces.patch @@ -0,0 +1,275 @@ +diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ae-common.h b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ae-common.h +index 561854e..397dac0 100644 +--- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ae-common.h ++++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ae-common.h +@@ -1,3 +1,5 @@ ++#include "debug.h" ++ + #ifndef AE_COMMON_H + #define AE_COMMON_H + +@@ -105,20 +107,45 @@ static void process_associated_data( + size_t l_a = A_len / BLOCK_BYTES; + size_t rest = A_len % BLOCK_BYTES; + ++ fprintf(DUMP, "computing Auth\n"); ++ + for (size_t i=0; i + #include + #include +@@ -65,32 +67,54 @@ static void _encrypt_message( + memset(tweak, 0, TWEAK_BYTES); + memset(checksum, 0, BLOCK_BYTES); + ++ fprintf(DUMP, "message encryption\n"); ++ + for (size_t j=0; j + #include + #include +@@ -62,24 +64,40 @@ static void _generate_tag( + size_t l = M_len / BLOCK_BYTES; + size_t rest = M_len % BLOCK_BYTES; + ++ fprintf(DUMP, "computing tag\n"); ++ debug_dump_buffer("Auth", BLOCK_BYTES, Auth, 8); ++ + for (size_t j=0; j