diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-14 09:02:07 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-14 09:02:07 +0100 |
| commit | 2be282051a89cd69eba40aca79bb17daebb72dab (patch) | |
| tree | 41739b6579aabc2c11a043ca20a104a37c68dc89 /src/ref/lilliput-i.c | |
| parent | 499a04c70519f114ad14d9bbb01207a5fa9a15c3 (diff) | |
| download | lilliput-ae-implem-2be282051a89cd69eba40aca79bb17daebb72dab.tar.xz | |
Correction de la génération du tweak pour ΘCB3
L'implémentation de référence se basait sur les indices figurant dans
le papier de Deoxys. Deux questions à résoudre, que d'autres se sont
sans doute déjà posées :
- Est-ce que ce l-1 est normal dans le papier de Deoxys ?
- Est-ce que nos changements d'indices sont bien tous corrects ?
En tout cas, les implémentations Python et C sont maintenant d'accord.
Diffstat (limited to 'src/ref/lilliput-i.c')
| -rw-r--r-- | src/ref/lilliput-i.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ref/lilliput-i.c b/src/ref/lilliput-i.c index 74248a9..97c2117 100644 --- a/src/ref/lilliput-i.c +++ b/src/ref/lilliput-i.c @@ -93,7 +93,7 @@ static void _encrypt_message( if (rest == 0) { - _fill_msg_tweak(0x1, N, l-1, tweak); + _fill_msg_tweak(0x1, N, l, tweak); encrypt(key, tweak, checksum, Final); } else @@ -108,7 +108,7 @@ static void _encrypt_message( encrypt(key, tweak, _0n, Pad); xor_arrays(rest, &C[l*BLOCK_BYTES], &M[l*BLOCK_BYTES], Pad); - _fill_msg_tweak(0x5, N, l, tweak); + _fill_msg_tweak(0x5, N, l+1, tweak); encrypt(key, tweak, checksum, Final); } } @@ -140,7 +140,7 @@ static void _decrypt_message( if (rest == 0) { - _fill_msg_tweak(0x1, N, l-1, tweak); + _fill_msg_tweak(0x1, N, l, tweak); encrypt(key, tweak, checksum, Final); } else @@ -155,7 +155,7 @@ static void _decrypt_message( pad10(rest, &M[l*BLOCK_BYTES], M_rest); xor_into(checksum, M_rest); - _fill_msg_tweak(0x5, N, l, tweak); + _fill_msg_tweak(0x5, N, l+1, tweak); encrypt(key, tweak, checksum, Final); } } |
