diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-02-12 11:00:04 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-02-12 11:00:04 +0100 |
| commit | 97114264906ae8e100f6b39baffb12cf2cf0e14e (patch) | |
| tree | 6029c5adfc262e6f5d4bfac4200b8764c0e178a9 /traces/traces-ae.patch | |
| parent | ff3c6e7f52c8eae698d11a55b8153dd4c61fad87 (diff) | |
| download | lilliput-ae-implem-97114264906ae8e100f6b39baffb12cf2cf0e14e.tar.xz | |
Mise à jour des patchs de génération de traces
Diffstat (limited to 'traces/traces-ae.patch')
| -rw-r--r-- | traces/traces-ae.patch | 139 |
1 files changed, 74 insertions, 65 deletions
diff --git a/traces/traces-ae.patch b/traces/traces-ae.patch index 35dc0c9..cfe6cdb 100644 --- a/traces/traces-ae.patch +++ b/traces/traces-ae.patch @@ -1,70 +1,17 @@ -diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h -index 561854e..397dac0 100644 ---- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h -+++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h -@@ -1,3 +1,5 @@ -+#include "debug.h" -+ - #ifndef LILLIPUT_AE_UTILS_H - #define LILLIPUT_AE_UTILS_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<l_a; i++) - { -+ fprintf(DUMP, " i=%zu\n", i); -+ - fill_index_tweak(0x2, i, tweak); -+ -+ debug_dump_buffer("tweak", TWEAK_BYTES, tweak, 8); -+ - encrypt(key, tweak, &A[i*BLOCK_BYTES], Ek_Ai); -+ -+ debug_dump_buffer("Ai", BLOCK_BYTES, &A[i*BLOCK_BYTES], 8); -+ debug_dump_buffer("Ek(Ai)", BLOCK_BYTES, Ek_Ai, 8); -+ - xor_into(Auth, Ek_Ai); -+ -+ debug_dump_buffer("Auth", BLOCK_BYTES, Auth, 8); - } - - if (rest != 0) - { - uint8_t A_rest[BLOCK_BYTES]; - pad10(rest, &A[l_a*BLOCK_BYTES], A_rest); -+ -+ fprintf(DUMP, " l_a=%zu (padding)\n", l_a); -+ - fill_index_tweak(0x6, l_a, tweak); -+ -+ debug_dump_buffer("pad10*(A*)", BLOCK_BYTES, A_rest, 8); -+ debug_dump_buffer("tweak", TWEAK_BYTES, tweak, 8); -+ - encrypt(key, tweak, A_rest, Ek_Ai); -+ -+ debug_dump_buffer("Ek(A*)", BLOCK_BYTES, Ek_Ai, 8); -+ - xor_into(Auth, Ek_Ai); -+ -+ debug_dump_buffer("Auth", BLOCK_BYTES, Auth, 8); - } - } - diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-i.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-i.c -index b1758c9..5cbb3f4 100644 +index 2754fbb..061a24e 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-i.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-i.c -@@ -1,3 +1,5 @@ +@@ -15,6 +15,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ + This file implements Lilliput-AE's nonce-respecting mode based on ΘCB3. + */ + +#include "debug.h" + #include <stdbool.h> #include <stdint.h> #include <string.h> -@@ -65,32 +67,54 @@ static void _encrypt_message( +@@ -82,32 +84,54 @@ static void _encrypt_message( memset(tweak, 0, TWEAK_BYTES); memset(checksum, 0, BLOCK_BYTES); @@ -119,7 +66,7 @@ index b1758c9..5cbb3f4 100644 } } -@@ -112,32 +136,54 @@ static void _decrypt_message( +@@ -129,32 +153,54 @@ static void _decrypt_message( memset(tweak, 0, TWEAK_BYTES); memset(checksum, 0, BLOCK_BYTES); @@ -174,7 +121,7 @@ index b1758c9..5cbb3f4 100644 } } -@@ -147,7 +193,13 @@ static void _generate_tag( +@@ -164,7 +210,13 @@ static void _generate_tag( uint8_t tag[TAG_BYTES] ) { @@ -189,16 +136,19 @@ index b1758c9..5cbb3f4 100644 diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-ii.c b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-ii.c -index 26885e5..88f9ae0 100644 +index 862892c..7dfb38e 100644 --- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-ii.c +++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-ii.c -@@ -1,3 +1,5 @@ +@@ -15,6 +15,8 @@ http://creativecommons.org/publicdomain/zero/1.0/ + This file implements Lilliput-AE's nonce-misuse-resistant mode based on SCT-2. + */ + +#include "debug.h" + #include <stdbool.h> #include <stdint.h> #include <string.h> -@@ -62,24 +64,40 @@ static void _generate_tag( +@@ -79,24 +81,40 @@ static void _generate_tag( size_t l = M_len / BLOCK_BYTES; size_t rest = M_len % BLOCK_BYTES; @@ -239,7 +189,7 @@ index 26885e5..88f9ae0 100644 } static void _encrypt_message( -@@ -103,18 +121,33 @@ static void _encrypt_message( +@@ -120,18 +138,33 @@ static void _encrypt_message( size_t l = M_len / BLOCK_BYTES; size_t rest = M_len % BLOCK_BYTES; @@ -273,3 +223,62 @@ index 26885e5..88f9ae0 100644 } } +diff --git a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h +index 6b60adc..0bd77cf 100644 +--- a/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h ++++ b/SOUMISSION_NIST/REFERENCE_IMPLEMENTATION/src/ref/lilliput-ae-utils.h +@@ -18,6 +18,8 @@ This file provides functions used by both authenticated encryption modes. + #ifndef LILLIPUT_AE_UTILS_H + #define LILLIPUT_AE_UTILS_H + ++#include "debug.h" ++ + #include <stddef.h> + #include <stdint.h> + #include <string.h> +@@ -122,20 +124,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<l_a; i++) + { ++ fprintf(DUMP, " i=%zu\n", i); ++ + fill_index_tweak(0x2, i, tweak); ++ ++ debug_dump_buffer("tweak", TWEAK_BYTES, tweak, 8); ++ + encrypt(key, tweak, &A[i*BLOCK_BYTES], Ek_Ai); ++ ++ debug_dump_buffer("Ai", BLOCK_BYTES, &A[i*BLOCK_BYTES], 8); ++ debug_dump_buffer("Ek(Ai)", BLOCK_BYTES, Ek_Ai, 8); ++ + xor_into(Auth, Ek_Ai); ++ ++ debug_dump_buffer("Auth", BLOCK_BYTES, Auth, 8); + } + + if (rest != 0) + { + uint8_t A_rest[BLOCK_BYTES]; + pad10(rest, &A[l_a*BLOCK_BYTES], A_rest); ++ ++ fprintf(DUMP, " l_a=%zu (padding)\n", l_a); ++ + fill_index_tweak(0x6, l_a, tweak); ++ ++ debug_dump_buffer("pad10*(A*)", BLOCK_BYTES, A_rest, 8); ++ debug_dump_buffer("tweak", TWEAK_BYTES, tweak, 8); ++ + encrypt(key, tweak, A_rest, Ek_Ai); ++ ++ debug_dump_buffer("Ek(A*)", BLOCK_BYTES, Ek_Ai, 8); ++ + xor_into(Auth, Ek_Ai); ++ ++ debug_dump_buffer("Auth", BLOCK_BYTES, Auth, 8); + } + } + |
