From 60140a6489ba780477fd92b21670e5d8e4d2e2bf Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Mon, 1 Jul 2019 17:16:01 +0200 Subject: Mise à jour des vecteurs de test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/i-128/test-ae-decrypt.c | 42 +++++++++++++++++++++--------------------- test/i-128/test-ae-encrypt.c | 42 +++++++++++++++++++++--------------------- test/i-128/test-tbc-decrypt.c | 8 ++++---- test/i-128/test-tbc-encrypt.c | 8 ++++---- test/i-128/test-tweakey.c | 6 +++--- 5 files changed, 53 insertions(+), 53 deletions(-) (limited to 'test') diff --git a/test/i-128/test-ae-decrypt.c b/test/i-128/test-ae-decrypt.c index 043185b..0a5934a 100644 --- a/test/i-128/test-ae-decrypt.c +++ b/test/i-128/test-ae-decrypt.c @@ -47,18 +47,18 @@ const vector VECTORS[] = { }, .ciphertext_len = 64, .ciphertext = (uint8_t[]) { - 0x86, 0x09, 0xbe, 0x90, 0xa2, 0x9f, 0xa0, 0xed, - 0x9a, 0xf6, 0xeb, 0x8d, 0x96, 0x0e, 0x83, 0x81, - 0x0a, 0x6b, 0x00, 0xf4, 0x76, 0x99, 0xf4, 0x62, - 0x4e, 0x3d, 0x91, 0x4c, 0x95, 0x96, 0x56, 0x91, - 0x94, 0xf2, 0x29, 0x55, 0x20, 0x11, 0x2c, 0x93, - 0x15, 0x23, 0x59, 0xe2, 0xa3, 0xc4, 0xc4, 0x62, - 0xbb, 0xa3, 0x11, 0xf1, 0x39, 0xa2, 0xe2, 0xc9, - 0x47, 0x6b, 0xe5, 0x6a, 0x97, 0x07, 0xc0, 0x87 + 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, + 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, + 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, + 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, + 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, + 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, + 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, + 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80 }, .tag = { - 0x2e, 0xe5, 0xbf, 0x50, 0x87, 0x71, 0x17, 0x40, - 0x1b, 0xa7, 0xe9, 0xed, 0xd5, 0xcb, 0xec, 0x6d + 0x47, 0x5b, 0x2c, 0x0e, 0x5f, 0xcf, 0x6f, 0xc0, + 0xab, 0x3c, 0x24, 0xc1, 0x66, 0x88, 0x83, 0x38 }, .message = (uint8_t[]) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -95,19 +95,19 @@ const vector VECTORS[] = { }, .ciphertext_len = 66, .ciphertext = (uint8_t[]) { - 0x86, 0x09, 0xbe, 0x90, 0xa2, 0x9f, 0xa0, 0xed, - 0x9a, 0xf6, 0xeb, 0x8d, 0x96, 0x0e, 0x83, 0x81, - 0x0a, 0x6b, 0x00, 0xf4, 0x76, 0x99, 0xf4, 0x62, - 0x4e, 0x3d, 0x91, 0x4c, 0x95, 0x96, 0x56, 0x91, - 0x94, 0xf2, 0x29, 0x55, 0x20, 0x11, 0x2c, 0x93, - 0x15, 0x23, 0x59, 0xe2, 0xa3, 0xc4, 0xc4, 0x62, - 0xbb, 0xa3, 0x11, 0xf1, 0x39, 0xa2, 0xe2, 0xc9, - 0x47, 0x6b, 0xe5, 0x6a, 0x97, 0x07, 0xc0, 0x87, - 0x4f, 0x09 + 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, + 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, + 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, + 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, + 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, + 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, + 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, + 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80, + 0x27, 0x3f }, .tag = { - 0x04, 0x10, 0xbc, 0x6f, 0xe5, 0x88, 0xe0, 0xd5, - 0x09, 0x59, 0x26, 0x17, 0x12, 0x49, 0x35, 0x9a + 0xd4, 0xef, 0x1f, 0x11, 0x81, 0x90, 0xbe, 0xfd, + 0x1e, 0xa7, 0x32, 0xbe, 0x63, 0xe2, 0x18, 0x90 }, .message = (uint8_t[]) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, diff --git a/test/i-128/test-ae-encrypt.c b/test/i-128/test-ae-encrypt.c index 522a3e6..06f3b88 100644 --- a/test/i-128/test-ae-encrypt.c +++ b/test/i-128/test-ae-encrypt.c @@ -57,18 +57,18 @@ const vector VECTORS[] = { 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, }, .ciphertext = (uint8_t[]) { - 0x86, 0x09, 0xbe, 0x90, 0xa2, 0x9f, 0xa0, 0xed, - 0x9a, 0xf6, 0xeb, 0x8d, 0x96, 0x0e, 0x83, 0x81, - 0x0a, 0x6b, 0x00, 0xf4, 0x76, 0x99, 0xf4, 0x62, - 0x4e, 0x3d, 0x91, 0x4c, 0x95, 0x96, 0x56, 0x91, - 0x94, 0xf2, 0x29, 0x55, 0x20, 0x11, 0x2c, 0x93, - 0x15, 0x23, 0x59, 0xe2, 0xa3, 0xc4, 0xc4, 0x62, - 0xbb, 0xa3, 0x11, 0xf1, 0x39, 0xa2, 0xe2, 0xc9, - 0x47, 0x6b, 0xe5, 0x6a, 0x97, 0x07, 0xc0, 0x87 + 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, + 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, + 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, + 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, + 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, + 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, + 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, + 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80 }, .tag = { - 0x2e, 0xe5, 0xbf, 0x50, 0x87, 0x71, 0x17, 0x40, - 0x1b, 0xa7, 0xe9, 0xed, 0xd5, 0xcb, 0xec, 0x6d + 0x47, 0x5b, 0x2c, 0x0e, 0x5f, 0xcf, 0x6f, 0xc0, + 0xab, 0x3c, 0x24, 0xc1, 0x66, 0x88, 0x83, 0x38 } }, { @@ -106,19 +106,19 @@ const vector VECTORS[] = { 0x40, 0x01 }, .ciphertext = (uint8_t[]) { - 0x86, 0x09, 0xbe, 0x90, 0xa2, 0x9f, 0xa0, 0xed, - 0x9a, 0xf6, 0xeb, 0x8d, 0x96, 0x0e, 0x83, 0x81, - 0x0a, 0x6b, 0x00, 0xf4, 0x76, 0x99, 0xf4, 0x62, - 0x4e, 0x3d, 0x91, 0x4c, 0x95, 0x96, 0x56, 0x91, - 0x94, 0xf2, 0x29, 0x55, 0x20, 0x11, 0x2c, 0x93, - 0x15, 0x23, 0x59, 0xe2, 0xa3, 0xc4, 0xc4, 0x62, - 0xbb, 0xa3, 0x11, 0xf1, 0x39, 0xa2, 0xe2, 0xc9, - 0x47, 0x6b, 0xe5, 0x6a, 0x97, 0x07, 0xc0, 0x87, - 0x4f, 0x09 + 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, + 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, + 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, + 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, + 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, + 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, + 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, + 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80, + 0x27, 0x3f }, .tag = { - 0x04, 0x10, 0xbc, 0x6f, 0xe5, 0x88, 0xe0, 0xd5, - 0x09, 0x59, 0x26, 0x17, 0x12, 0x49, 0x35, 0x9a + 0xd4, 0xef, 0x1f, 0x11, 0x81, 0x90, 0xbe, 0xfd, + 0x1e, 0xa7, 0x32, 0xbe, 0x63, 0xe2, 0x18, 0x90 } } }; diff --git a/test/i-128/test-tbc-decrypt.c b/test/i-128/test-tbc-decrypt.c index 6b558cb..b76f6c0 100644 --- a/test/i-128/test-tbc-decrypt.c +++ b/test/i-128/test-tbc-decrypt.c @@ -33,8 +33,8 @@ const vector VECTORS[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, .ciphertext = { - 0x8d, 0x95, 0xa2, 0x10, 0xe6, 0xb2, 0xce, 0xc2, - 0x52, 0x0b, 0x06, 0xaf, 0x26, 0x00, 0xce, 0xe5 + 0x03, 0xb0, 0x31, 0x5e, 0xd8, 0x98, 0x43, 0x7e, + 0xc5, 0x06, 0x4a, 0x83, 0x64, 0x11, 0xf8, 0x02 }, .message = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -53,8 +53,8 @@ const vector VECTORS[] = { 0x7f, 0xf4, 0x23, 0x4d, 0x3d, 0xd5, 0xf9, 0x9b }, .ciphertext = { - 0x5b, 0x5a, 0x1c, 0xfe, 0x25, 0x6e, 0x85, 0x69, - 0x3e, 0x71, 0x3e, 0x43, 0x30, 0xa8, 0x4c, 0x82 + 0x97, 0xff, 0x85, 0x27, 0xb6, 0x09, 0x1f, 0x51, + 0xf3, 0xcb, 0xfd, 0xd0, 0xf2, 0x72, 0xa5, 0x90 }, .message = { 0xbc, 0xd7, 0xf0, 0x29, 0x84, 0xb6, 0xc8, 0xf9, diff --git a/test/i-128/test-tbc-encrypt.c b/test/i-128/test-tbc-encrypt.c index c83754b..6503455 100644 --- a/test/i-128/test-tbc-encrypt.c +++ b/test/i-128/test-tbc-encrypt.c @@ -37,8 +37,8 @@ const vector VECTORS[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, }, .ciphertext = { - 0x8d, 0x95, 0xa2, 0x10, 0xe6, 0xb2, 0xce, 0xc2, - 0x52, 0x0b, 0x06, 0xaf, 0x26, 0x00, 0xce, 0xe5 + 0x03, 0xb0, 0x31, 0x5e, 0xd8, 0x98, 0x43, 0x7e, + 0xc5, 0x06, 0x4a, 0x83, 0x64, 0x11, 0xf8, 0x02 } }, { @@ -57,8 +57,8 @@ const vector VECTORS[] = { 0x9c, 0x9d, 0x1d, 0xbd, 0x0d, 0x30, 0x94, 0x0b }, .ciphertext = { - 0x5b, 0x5a, 0x1c, 0xfe, 0x25, 0x6e, 0x85, 0x69, - 0x3e, 0x71, 0x3e, 0x43, 0x30, 0xa8, 0x4c, 0x82 + 0x97, 0xff, 0x85, 0x27, 0xb6, 0x09, 0x1f, 0x51, + 0xf3, 0xcb, 0xfd, 0xd0, 0xf2, 0x72, 0xa5, 0x90 } } }; diff --git a/test/i-128/test-tweakey.c b/test/i-128/test-tweakey.c index a9b8b5f..ba27340 100644 --- a/test/i-128/test-tweakey.c +++ b/test/i-128/test-tweakey.c @@ -32,7 +32,7 @@ const vector VECTORS[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, .last_rtk = { - 0xec, 0xb3, 0x30, 0xd0, 0xe2, 0x90, 0xc8, 0x56 + 0x53, 0x40, 0x95, 0x96, 0xea, 0x82, 0x2b, 0x28 } }, { @@ -63,7 +63,7 @@ const vector VECTORS[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, .last_rtk = { - 0xda, 0xcd, 0xb4, 0x0b, 0x7b, 0x80, 0x1e, 0x9a + 0xfa, 0xd6, 0x9e, 0x4d, 0x08, 0x9a, 0x46, 0x5b } }, { @@ -78,7 +78,7 @@ const vector VECTORS[] = { 0x7f, 0xf4, 0x23, 0x4d, 0x3d, 0xd5, 0xf9, 0x9b }, .last_rtk = { - 0xdd, 0xc6, 0x4e, 0xd7, 0x1a, 0x82, 0x11, 0xf3 + 0xc2, 0xd1, 0xb0, 0x98, 0xf3, 0x74, 0x8a, 0xc0 } } }; -- cgit v1.2.3 From 607a7f94f90ef2963e242674eaf9f74b590bdb6c Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 5 Jul 2019 10:34:16 +0200 Subject: Ajout d'un script de vérification plus exhaustif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/check-all.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/check-all.sh (limited to 'test') diff --git a/test/check-all.sh b/test/check-all.sh new file mode 100755 index 0000000..e59b98c --- /dev/null +++ b/test/check-all.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -eux + +run () +{ + make clean + "$@" +} + +add_implems=(src/add_felicsref src/add_tweakeyloop src/add_threshold) + +for implem in ref ${add_implems[@]} +do + run make test IMPLEMENTATION=$(basename $implem) +done + +run make traces +run make traces IMPLEMENTATION=add_threshold + +for implem in ${add_implems[@]} +do + run ./test/check-implementation.sh $(basename $implem) +done + +run make nist +./test/python.sh -- cgit v1.2.3 From 2b512dfe165ff9337208b7e366e816d4731abef4 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 13 Jun 2019 15:16:19 +0200 Subject: Adaptation des tests et des traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mise à jour des vecteurs de test i-128/test-ae-*crypt - affichage des tableaux d'octets par indices croissants --- test/debug.h | 24 ++++++++++-------------- test/i-128/test-ae-decrypt.c | 42 +++++++++++++++++++++--------------------- test/i-128/test-ae-encrypt.c | 42 +++++++++++++++++++++--------------------- test/i-128/traces-ae.c | 4 ++-- test/i-192/traces-ae.c | 4 ++-- test/i-256/traces-ae.c | 4 ++-- test/ii-128/traces-ae.c | 4 ++-- test/ii-192/traces-ae.c | 4 ++-- test/ii-256/traces-ae.c | 4 ++-- 9 files changed, 64 insertions(+), 68 deletions(-) (limited to 'test') diff --git a/test/debug.h b/test/debug.h index 24b7787..d958475 100644 --- a/test/debug.h +++ b/test/debug.h @@ -17,9 +17,7 @@ static inline void debug_dump_lanes(const char *header, size_t len, const uint8_ fprintf(DUMP, "%*s", indent, ""); for (size_t b=0; b<8; b++) { - /* start with MSB */ - size_t byte_index = len-(1+line*8+b); - fprintf(DUMP, "%*s%02x", 5, "", buf[byte_index]); + fprintf(DUMP, "%*s%02x", 5, "", buf[line*8+b]); } fprintf(DUMP, "\n"); } @@ -30,26 +28,24 @@ static inline void debug_dump_buffer(const char *header, size_t len, const uint8 { fprintf(DUMP, "%*s%s\n", indent, "", header); - if (len%8 != 0) + for (size_t line=0; line %zu]", line, b, line*8+b); */ + fprintf(DUMP, "%02x ", buf[line*8+b]); } fprintf(DUMP, "\n"); } - for (size_t line=0; line %zu]", line, b, byte_index); */ - fprintf(DUMP, "%02x ", buf[byte_index]); + fprintf(DUMP, "%02x ", buf[len-rest+b]); } fprintf(DUMP, "\n"); } diff --git a/test/i-128/test-ae-decrypt.c b/test/i-128/test-ae-decrypt.c index 0a5934a..812eda2 100644 --- a/test/i-128/test-ae-decrypt.c +++ b/test/i-128/test-ae-decrypt.c @@ -47,18 +47,18 @@ const vector VECTORS[] = { }, .ciphertext_len = 64, .ciphertext = (uint8_t[]) { - 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, - 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, - 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, - 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, - 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, - 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, - 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, - 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80 + 0xa2, 0xd5, 0xa6, 0x38, 0xca, 0xcf, 0xce, 0x90, + 0xaf, 0xc3, 0xb8, 0x99, 0x36, 0xba, 0xf1, 0x12, + 0x94, 0x13, 0x87, 0xb8, 0x7e, 0x6c, 0x07, 0x48, + 0x25, 0x25, 0x66, 0xd8, 0xa4, 0x05, 0xc9, 0xd3, + 0xc0, 0xaa, 0x27, 0xc6, 0xa6, 0x67, 0x53, 0x8f, + 0xcc, 0xd9, 0xd3, 0xdb, 0xf5, 0xdc, 0xad, 0xa0, + 0x4b, 0x3e, 0x9a, 0xfb, 0x7c, 0xe9, 0x17, 0x9c, + 0xb8, 0x17, 0x13, 0x9f, 0x32, 0x70, 0x5c, 0x62 }, .tag = { - 0x47, 0x5b, 0x2c, 0x0e, 0x5f, 0xcf, 0x6f, 0xc0, - 0xab, 0x3c, 0x24, 0xc1, 0x66, 0x88, 0x83, 0x38 + 0x04, 0xaa, 0xc8, 0x19, 0x32, 0x70, 0x32, 0x24, + 0xe8, 0x27, 0xb7, 0xab, 0xec, 0xd8, 0x2f, 0x6c }, .message = (uint8_t[]) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -95,19 +95,19 @@ const vector VECTORS[] = { }, .ciphertext_len = 66, .ciphertext = (uint8_t[]) { - 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, - 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, - 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, - 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, - 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, - 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, - 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, - 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80, - 0x27, 0x3f + 0xa2, 0xd5, 0xa6, 0x38, 0xca, 0xcf, 0xce, 0x90, + 0xaf, 0xc3, 0xb8, 0x99, 0x36, 0xba, 0xf1, 0x12, + 0x94, 0x13, 0x87, 0xb8, 0x7e, 0x6c, 0x07, 0x48, + 0x25, 0x25, 0x66, 0xd8, 0xa4, 0x05, 0xc9, 0xd3, + 0xc0, 0xaa, 0x27, 0xc6, 0xa6, 0x67, 0x53, 0x8f, + 0xcc, 0xd9, 0xd3, 0xdb, 0xf5, 0xdc, 0xad, 0xa0, + 0x4b, 0x3e, 0x9a, 0xfb, 0x7c, 0xe9, 0x17, 0x9c, + 0xb8, 0x17, 0x13, 0x9f, 0x32, 0x70, 0x5c, 0x62, + 0x88, 0x5a }, .tag = { - 0xd4, 0xef, 0x1f, 0x11, 0x81, 0x90, 0xbe, 0xfd, - 0x1e, 0xa7, 0x32, 0xbe, 0x63, 0xe2, 0x18, 0x90 + 0x64, 0xa2, 0x24, 0x03, 0xc5, 0x79, 0x4f, 0xec, + 0xe7, 0x7d, 0xc1, 0xf6, 0xc9, 0xc6, 0x77, 0x2c }, .message = (uint8_t[]) { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, diff --git a/test/i-128/test-ae-encrypt.c b/test/i-128/test-ae-encrypt.c index 06f3b88..09fbb32 100644 --- a/test/i-128/test-ae-encrypt.c +++ b/test/i-128/test-ae-encrypt.c @@ -57,18 +57,18 @@ const vector VECTORS[] = { 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, }, .ciphertext = (uint8_t[]) { - 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, - 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, - 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, - 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, - 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, - 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, - 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, - 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80 + 0xa2, 0xd5, 0xa6, 0x38, 0xca, 0xcf, 0xce, 0x90, + 0xaf, 0xc3, 0xb8, 0x99, 0x36, 0xba, 0xf1, 0x12, + 0x94, 0x13, 0x87, 0xb8, 0x7e, 0x6c, 0x07, 0x48, + 0x25, 0x25, 0x66, 0xd8, 0xa4, 0x05, 0xc9, 0xd3, + 0xc0, 0xaa, 0x27, 0xc6, 0xa6, 0x67, 0x53, 0x8f, + 0xcc, 0xd9, 0xd3, 0xdb, 0xf5, 0xdc, 0xad, 0xa0, + 0x4b, 0x3e, 0x9a, 0xfb, 0x7c, 0xe9, 0x17, 0x9c, + 0xb8, 0x17, 0x13, 0x9f, 0x32, 0x70, 0x5c, 0x62 }, .tag = { - 0x47, 0x5b, 0x2c, 0x0e, 0x5f, 0xcf, 0x6f, 0xc0, - 0xab, 0x3c, 0x24, 0xc1, 0x66, 0x88, 0x83, 0x38 + 0x04, 0xaa, 0xc8, 0x19, 0x32, 0x70, 0x32, 0x24, + 0xe8, 0x27, 0xb7, 0xab, 0xec, 0xd8, 0x2f, 0x6c } }, { @@ -106,19 +106,19 @@ const vector VECTORS[] = { 0x40, 0x01 }, .ciphertext = (uint8_t[]) { - 0xca, 0x16, 0x03, 0x71, 0x0c, 0xca, 0x10, 0x2f, - 0xac, 0x46, 0x0c, 0xb4, 0x13, 0x2a, 0x55, 0x0d, - 0xc0, 0x59, 0x90, 0xb7, 0xca, 0xf2, 0x17, 0x9f, - 0x8f, 0xd6, 0x5a, 0x73, 0x49, 0x65, 0x14, 0xec, - 0x3e, 0xf4, 0xc5, 0xd0, 0x08, 0x3d, 0x85, 0x5c, - 0x11, 0x70, 0x42, 0x3b, 0x91, 0x61, 0xa7, 0xf2, - 0x7a, 0xbf, 0x51, 0x2c, 0xe3, 0x88, 0xc9, 0x97, - 0x34, 0x92, 0xed, 0xf9, 0x5b, 0xb4, 0x2a, 0x80, - 0x27, 0x3f + 0xa2, 0xd5, 0xa6, 0x38, 0xca, 0xcf, 0xce, 0x90, + 0xaf, 0xc3, 0xb8, 0x99, 0x36, 0xba, 0xf1, 0x12, + 0x94, 0x13, 0x87, 0xb8, 0x7e, 0x6c, 0x07, 0x48, + 0x25, 0x25, 0x66, 0xd8, 0xa4, 0x05, 0xc9, 0xd3, + 0xc0, 0xaa, 0x27, 0xc6, 0xa6, 0x67, 0x53, 0x8f, + 0xcc, 0xd9, 0xd3, 0xdb, 0xf5, 0xdc, 0xad, 0xa0, + 0x4b, 0x3e, 0x9a, 0xfb, 0x7c, 0xe9, 0x17, 0x9c, + 0xb8, 0x17, 0x13, 0x9f, 0x32, 0x70, 0x5c, 0x62, + 0x88, 0x5a }, .tag = { - 0xd4, 0xef, 0x1f, 0x11, 0x81, 0x90, 0xbe, 0xfd, - 0x1e, 0xa7, 0x32, 0xbe, 0x63, 0xe2, 0x18, 0x90 + 0x64, 0xa2, 0x24, 0x03, 0xc5, 0x79, 0x4f, 0xec, + 0xe7, 0x7d, 0xc1, 0xf6, 0xc9, 0xc6, 0x77, 0x2c } } }; diff --git a/test/i-128/traces-ae.c b/test/i-128/traces-ae.c index 441ae37..a22260d 100644 --- a/test/i-128/traces-ae.c +++ b/test/i-128/traces-ae.c @@ -78,7 +78,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -90,7 +90,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; diff --git a/test/i-192/traces-ae.c b/test/i-192/traces-ae.c index 6448928..328204a 100644 --- a/test/i-192/traces-ae.c +++ b/test/i-192/traces-ae.c @@ -80,7 +80,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -92,7 +92,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; diff --git a/test/i-256/traces-ae.c b/test/i-256/traces-ae.c index 946518e..9b75273 100644 --- a/test/i-256/traces-ae.c +++ b/test/i-256/traces-ae.c @@ -82,7 +82,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -94,7 +94,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; diff --git a/test/ii-128/traces-ae.c b/test/ii-128/traces-ae.c index 441ae37..a22260d 100644 --- a/test/ii-128/traces-ae.c +++ b/test/ii-128/traces-ae.c @@ -78,7 +78,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -90,7 +90,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; diff --git a/test/ii-192/traces-ae.c b/test/ii-192/traces-ae.c index 6448928..328204a 100644 --- a/test/ii-192/traces-ae.c +++ b/test/ii-192/traces-ae.c @@ -80,7 +80,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -92,7 +92,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; diff --git a/test/ii-256/traces-ae.c b/test/ii-256/traces-ae.c index 946518e..9b75273 100644 --- a/test/ii-256/traces-ae.c +++ b/test/ii-256/traces-ae.c @@ -82,7 +82,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 }, .message_len = 66, .message = (uint8_t[]) { @@ -94,7 +94,7 @@ const vector VECTORS[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x01 + 0x40, 0x41 } } }; -- cgit v1.2.3 From 6539c825b51dcb1bf5181e5aba91cdc41ff0850f Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 4 Jul 2019 17:24:52 +0200 Subject: Ajout d'indices dans les traces --- test/debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/debug.h b/test/debug.h index d958475..56cd123 100644 --- a/test/debug.h +++ b/test/debug.h @@ -30,7 +30,7 @@ static inline void debug_dump_buffer(const char *header, size_t len, const uint8 for (size_t line=0; line %zu]", line, b, line*8+b); */ @@ -42,7 +42,7 @@ static inline void debug_dump_buffer(const char *header, size_t len, const uint8 size_t rest = len%8; if (rest != 0) { - fprintf(DUMP, "%*s", indent, ""); + fprintf(DUMP, "%*s[0x%02zx] ", indent, "", len-rest); for (size_t b=0; b