diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-12-04 11:11:16 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-12-04 11:11:16 +0100 |
| commit | efbea430fc5443e373606e3c9f79fa39388e6812 (patch) | |
| tree | 6fb8f7a7c08d92cb328a23eb298499436d00975b | |
| parent | ca5d23276808b6b6c4d069e0ce77d776b5d93306 (diff) | |
| download | lilliput-ae-implem-efbea430fc5443e373606e3c9f79fa39388e6812.tar.xz | |
Réorganisation des traces
| -rw-r--r-- | src/debug.h | 8 | ||||
| -rw-r--r-- | test/common.mk | 2 | ||||
| -rw-r--r-- | test/i-128/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/i-128/traces-tbc.c | 10 | ||||
| -rw-r--r-- | test/i-192/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/i-192/traces-tbc.c | 10 | ||||
| -rw-r--r-- | test/i-256/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/i-256/traces-tbc.c | 10 | ||||
| -rw-r--r-- | test/ii-128/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/ii-128/traces-tbc.c | 10 | ||||
| -rw-r--r-- | test/ii-192/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/ii-192/traces-tbc.c | 10 | ||||
| -rw-r--r-- | test/ii-256/traces-ae.c | 10 | ||||
| -rw-r--r-- | test/ii-256/traces-tbc.c | 10 | ||||
| -rwxr-xr-x | traces/collect-traces.sh | 4 |
15 files changed, 103 insertions, 31 deletions
diff --git a/src/debug.h b/src/debug.h index c173f58..24b7787 100644 --- a/src/debug.h +++ b/src/debug.h @@ -57,11 +57,13 @@ static inline void debug_dump_buffer(const char *header, size_t len, const uint8 fprintf(DUMP, "\n"); } -static inline void debug_open_dump(const char *suite, const char *vector_name) +static inline void debug_open_dump(const char *folder, const char *suite, const char *vector_name) { - size_t namelen = snprintf(NULL, 0, "results/traces-%s-%s.txt", suite, vector_name); + size_t namelen = snprintf( + NULL, 0, "%s/traces-%s-%s.txt", folder, suite, vector_name + ); char name[namelen+1]; - snprintf(name, sizeof(name), "results/traces-%s-%s.txt", suite, vector_name); + snprintf(name, sizeof(name), "%s/traces-%s-%s.txt", folder, suite, vector_name); DUMP = fopen(name, "w"); } diff --git a/test/common.mk b/test/common.mk index e855ad7..127d44b 100644 --- a/test/common.mk +++ b/test/common.mk @@ -41,7 +41,7 @@ $(tests): test-%: $(results_dir)/test-% $(traces): traces-%: $(results_dir)/traces-% @ echo "TRACES $@" - $(Q) $< + $(Q) $< $(results_dir) $*-$(mode)-$(keylen) $(results_dir)/test-%: $(results_dir)/test/test-%.o @ echo "LD $@" diff --git a/test/i-128/traces-ae.c b/test/i-128/traces-ae.c index 223ab2e..cb8e4e2 100644 --- a/test/i-128/traces-ae.c +++ b/test/i-128/traces-ae.c @@ -96,11 +96,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-128-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/i-128/traces-tbc.c b/test/i-128/traces-tbc.c index c128da2..0d1f6a8 100644 --- a/test/i-128/traces-tbc.c +++ b/test/i-128/traces-tbc.c @@ -40,11 +40,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-128-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/test/i-192/traces-ae.c b/test/i-192/traces-ae.c index 84d3355..c5d4820 100644 --- a/test/i-192/traces-ae.c +++ b/test/i-192/traces-ae.c @@ -98,11 +98,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-192-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/i-192/traces-tbc.c b/test/i-192/traces-tbc.c index 251141e..d024fc6 100644 --- a/test/i-192/traces-tbc.c +++ b/test/i-192/traces-tbc.c @@ -42,11 +42,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-192-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/test/i-256/traces-ae.c b/test/i-256/traces-ae.c index c233bcc..77fe7c8 100644 --- a/test/i-256/traces-ae.c +++ b/test/i-256/traces-ae.c @@ -100,11 +100,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-256-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/i-256/traces-tbc.c b/test/i-256/traces-tbc.c index 6668c8c..a135583 100644 --- a/test/i-256/traces-tbc.c +++ b/test/i-256/traces-tbc.c @@ -43,11 +43,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-256-i", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/test/ii-128/traces-ae.c b/test/ii-128/traces-ae.c index 853d3d5..cb8e4e2 100644 --- a/test/ii-128/traces-ae.c +++ b/test/ii-128/traces-ae.c @@ -96,11 +96,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-128-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/ii-128/traces-tbc.c b/test/ii-128/traces-tbc.c index 729f3fe..0d1f6a8 100644 --- a/test/ii-128/traces-tbc.c +++ b/test/ii-128/traces-tbc.c @@ -40,11 +40,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-128-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/test/ii-192/traces-ae.c b/test/ii-192/traces-ae.c index ea48b4b..c5d4820 100644 --- a/test/ii-192/traces-ae.c +++ b/test/ii-192/traces-ae.c @@ -98,11 +98,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-192-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/ii-192/traces-tbc.c b/test/ii-192/traces-tbc.c index 5f5929f..59574af 100644 --- a/test/ii-192/traces-tbc.c +++ b/test/ii-192/traces-tbc.c @@ -41,11 +41,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-192-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/test/ii-256/traces-ae.c b/test/ii-256/traces-ae.c index 343617f..77fe7c8 100644 --- a/test/ii-256/traces-ae.c +++ b/test/ii-256/traces-ae.c @@ -100,11 +100,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("ae-256-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", v->message_len, v->message, 0); debug_dump_buffer("associated data", v->auth_len, v->auth, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); diff --git a/test/ii-256/traces-tbc.c b/test/ii-256/traces-tbc.c index 217d335..3a083e8 100644 --- a/test/ii-256/traces-tbc.c +++ b/test/ii-256/traces-tbc.c @@ -42,11 +42,17 @@ const vector VECTORS[] = { }; -int main() +int main(int argc, char **argv) { + if (argc < 3) + { + fprintf(stderr, "usage: %s OUTPUT-FOLDER PREFIX\n", argv[0]); + return 1; + } + for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++) { - debug_open_dump("tbc-256-ii", v->name); + debug_open_dump(argv[1], argv[2], v->name); debug_dump_buffer("message", BLOCK_BYTES, v->message, 0); debug_dump_buffer("key", KEY_BYTES, v->key, 0); debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0); diff --git a/traces/collect-traces.sh b/traces/collect-traces.sh index 16e8408..9dc7b3e 100755 --- a/traces/collect-traces.sh +++ b/traces/collect-traces.sh @@ -16,12 +16,10 @@ git apply ${patch} for makefile in $(find test -name Makefile) do implem_dir=$(dirname ${makefile}) - make -C ${implem_dir} clean - make -C ${implem_dir} ${trace_type} - cp ${implem_dir}/results/traces*.txt ${d} done +cp results/{i,ii}-{128,192,256}/${trace_type}-*.txt ${d} tar czf results/${trace_type}.tgz -C ${d} . rm -r ${d} |
