From 0b90498964b43fa37111701030ac693484130c8a Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 11 Dec 2018 14:02:45 +0100 Subject: Correction des shifts lors de la multiplication par MR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *Toutes* les opérations s'appliquent dans l'autre sens, *y compris les shifts*, vu que on prend (y₀…y7)ᵗ = MR(x₀…x₇)ᵗ. --- 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 84f16f3..d835342 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[]) { - 0x06, 0xb2, 0x03, 0xbc, 0x8d, 0x78, 0x42, 0x69, - 0xf0, 0x5d, 0x16, 0x13, 0x90, 0xf1, 0x71, 0x84, - 0x50, 0x44, 0xca, 0x4a, 0x06, 0x94, 0xa1, 0x1a, - 0x58, 0xde, 0x54, 0xfb, 0xe6, 0x8b, 0x53, 0x81, - 0x1a, 0x15, 0x2e, 0x3a, 0x0a, 0x69, 0xcb, 0x91, - 0x9c, 0xd8, 0x84, 0x01, 0x7b, 0x6a, 0x2d, 0x30, - 0xd1, 0xce, 0x6b, 0xe5, 0xfe, 0x21, 0x4a, 0xab, - 0xc3, 0xb3, 0xa6, 0xd1, 0x88, 0x1f, 0xa5, 0x46 + 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 }, .tag = { - 0xe7, 0xb8, 0x99, 0x12, 0x69, 0x23, 0xcf, 0x6a, - 0xe9, 0x1b, 0x5e, 0x5e, 0xd6, 0x32, 0x7c, 0x3d + 0x69, 0xb6, 0x26, 0x07, 0x4f, 0x76, 0xc6, 0x3a, + 0x0e, 0x0e, 0xcd, 0xa4, 0x4b, 0xad, 0x77, 0x1f } , .message = (uint8_t[]) { @@ -96,19 +96,19 @@ const vector VECTORS[] = { }, .ciphertext_len = 66, .ciphertext = (uint8_t[]) { - 0x06, 0xb2, 0x03, 0xbc, 0x8d, 0x78, 0x42, 0x69, - 0xf0, 0x5d, 0x16, 0x13, 0x90, 0xf1, 0x71, 0x84, - 0x50, 0x44, 0xca, 0x4a, 0x06, 0x94, 0xa1, 0x1a, - 0x58, 0xde, 0x54, 0xfb, 0xe6, 0x8b, 0x53, 0x81, - 0x1a, 0x15, 0x2e, 0x3a, 0x0a, 0x69, 0xcb, 0x91, - 0x9c, 0xd8, 0x84, 0x01, 0x7b, 0x6a, 0x2d, 0x30, - 0xd1, 0xce, 0x6b, 0xe5, 0xfe, 0x21, 0x4a, 0xab, - 0xc3, 0xb3, 0xa6, 0xd1, 0x88, 0x1f, 0xa5, 0x46, - 0xec, 0x3d + 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 }, .tag = { - 0x03, 0xd7, 0xff, 0xe1, 0xa4, 0x5d, 0x57, 0x68, - 0xd3, 0x18, 0x60, 0x43, 0x79, 0x11, 0x0e, 0x5c + 0xbf, 0xe3, 0x8e, 0x6f, 0xda, 0x02, 0x5a, 0x63, + 0x34, 0x20, 0x4a, 0x43, 0xc2, 0x54, 0x3e, 0x5b }, .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 a708fe2..442d621 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[]) { - 0x06, 0xb2, 0x03, 0xbc, 0x8d, 0x78, 0x42, 0x69, - 0xf0, 0x5d, 0x16, 0x13, 0x90, 0xf1, 0x71, 0x84, - 0x50, 0x44, 0xca, 0x4a, 0x06, 0x94, 0xa1, 0x1a, - 0x58, 0xde, 0x54, 0xfb, 0xe6, 0x8b, 0x53, 0x81, - 0x1a, 0x15, 0x2e, 0x3a, 0x0a, 0x69, 0xcb, 0x91, - 0x9c, 0xd8, 0x84, 0x01, 0x7b, 0x6a, 0x2d, 0x30, - 0xd1, 0xce, 0x6b, 0xe5, 0xfe, 0x21, 0x4a, 0xab, - 0xc3, 0xb3, 0xa6, 0xd1, 0x88, 0x1f, 0xa5, 0x46 + 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 }, .tag = { - 0xe7, 0xb8, 0x99, 0x12, 0x69, 0x23, 0xcf, 0x6a, - 0xe9, 0x1b, 0x5e, 0x5e, 0xd6, 0x32, 0x7c, 0x3d + 0x69, 0xb6, 0x26, 0x07, 0x4f, 0x76, 0xc6, 0x3a, + 0x0e, 0x0e, 0xcd, 0xa4, 0x4b, 0xad, 0x77, 0x1f } }, { @@ -106,19 +106,19 @@ const vector VECTORS[] = { 0x40, 0x01 }, .ciphertext = (uint8_t[]) { - 0x06, 0xb2, 0x03, 0xbc, 0x8d, 0x78, 0x42, 0x69, - 0xf0, 0x5d, 0x16, 0x13, 0x90, 0xf1, 0x71, 0x84, - 0x50, 0x44, 0xca, 0x4a, 0x06, 0x94, 0xa1, 0x1a, - 0x58, 0xde, 0x54, 0xfb, 0xe6, 0x8b, 0x53, 0x81, - 0x1a, 0x15, 0x2e, 0x3a, 0x0a, 0x69, 0xcb, 0x91, - 0x9c, 0xd8, 0x84, 0x01, 0x7b, 0x6a, 0x2d, 0x30, - 0xd1, 0xce, 0x6b, 0xe5, 0xfe, 0x21, 0x4a, 0xab, - 0xc3, 0xb3, 0xa6, 0xd1, 0x88, 0x1f, 0xa5, 0x46, - 0xec, 0x3d + 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 }, .tag = { - 0x03, 0xd7, 0xff, 0xe1, 0xa4, 0x5d, 0x57, 0x68, - 0xd3, 0x18, 0x60, 0x43, 0x79, 0x11, 0x0e, 0x5c + 0xbf, 0xe3, 0x8e, 0x6f, 0xda, 0x02, 0x5a, 0x63, + 0x34, 0x20, 0x4a, 0x43, 0xc2, 0x54, 0x3e, 0x5b } } }; diff --git a/test/i-128/test-tbc-decrypt.c b/test/i-128/test-tbc-decrypt.c index 6e992e8..6b558cb 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 = { - 0xdd, 0x93, 0x48, 0x8a, 0x10, 0x0c, 0xd4, 0xdc, - 0x4c, 0xa1, 0x9a, 0x53, 0x1d, 0x3d, 0x41, 0x62 + 0x8d, 0x95, 0xa2, 0x10, 0xe6, 0xb2, 0xce, 0xc2, + 0x52, 0x0b, 0x06, 0xaf, 0x26, 0x00, 0xce, 0xe5 }, .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 = { - 0xca, 0x79, 0x91, 0xe5, 0x48, 0xda, 0xdd, 0xab, - 0xcb, 0xd9, 0xd5, 0xa0, 0x43, 0x39, 0x14, 0x07 + 0x5b, 0x5a, 0x1c, 0xfe, 0x25, 0x6e, 0x85, 0x69, + 0x3e, 0x71, 0x3e, 0x43, 0x30, 0xa8, 0x4c, 0x82 }, .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 20e159a..c83754b 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 = { - 0xdd, 0x93, 0x48, 0x8a, 0x10, 0x0c, 0xd4, 0xdc, - 0x4c, 0xa1, 0x9a, 0x53, 0x1d, 0x3d, 0x41, 0x62 + 0x8d, 0x95, 0xa2, 0x10, 0xe6, 0xb2, 0xce, 0xc2, + 0x52, 0x0b, 0x06, 0xaf, 0x26, 0x00, 0xce, 0xe5 } }, { @@ -57,8 +57,8 @@ const vector VECTORS[] = { 0x9c, 0x9d, 0x1d, 0xbd, 0x0d, 0x30, 0x94, 0x0b }, .ciphertext = { - 0xca, 0x79, 0x91, 0xe5, 0x48, 0xda, 0xdd, 0xab, - 0xcb, 0xd9, 0xd5, 0xa0, 0x43, 0x39, 0x14, 0x07 + 0x5b, 0x5a, 0x1c, 0xfe, 0x25, 0x6e, 0x85, 0x69, + 0x3e, 0x71, 0x3e, 0x43, 0x30, 0xa8, 0x4c, 0x82 } } }; diff --git a/test/i-128/test-tweakey.c b/test/i-128/test-tweakey.c index d461dc2..a9b8b5f 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 = { - 0x2f, 0x16, 0x6a, 0x49, 0x47, 0xee, 0x13, 0xeb + 0xec, 0xb3, 0x30, 0xd0, 0xe2, 0x90, 0xc8, 0x56 } }, { @@ -63,7 +63,7 @@ const vector VECTORS[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, .last_rtk = { - 0x1e, 0x02, 0x99, 0x4d, 0xec, 0x97, 0xed, 0x72 + 0xda, 0xcd, 0xb4, 0x0b, 0x7b, 0x80, 0x1e, 0x9a } }, { @@ -78,7 +78,7 @@ const vector VECTORS[] = { 0x7f, 0xf4, 0x23, 0x4d, 0x3d, 0xd5, 0xf9, 0x9b }, .last_rtk = { - 0x40, 0x5d, 0x9b, 0x70, 0x8d, 0x27, 0xe5, 0x64 + 0xdd, 0xc6, 0x4e, 0xd7, 0x1a, 0x82, 0x11, 0xf3 } } }; -- cgit v1.2.3