summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2019-07-05 15:23:04 +0200
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2019-07-05 16:37:11 +0200
commit0af64446ca8f5685c41aae9389760fc15248c31c (patch)
treeca0f582ceb579db33f2eea7b12b7a3ea63f7f52b /src
parent5bc170749da06b16200979e58bf3999a746efa9f (diff)
downloadlilliput-ae-implem-0af64446ca8f5685c41aae9389760fc15248c31c.tar.xz
Suppression d'une variable intermédiaire dans add_felicsref
Pas sûr que la variable soit utile dans les autres… 🤷
Diffstat (limited to 'src')
-rw-r--r--src/add_felicsref/cipher.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/add_felicsref/cipher.c b/src/add_felicsref/cipher.c
index 87689df..916f0ab 100644
--- a/src/add_felicsref/cipher.c
+++ b/src/add_felicsref/cipher.c
@@ -168,18 +168,15 @@ void lilliput_tbc_decrypt(
uint8_t message[BLOCK_BYTES]
)
{
- uint8_t X[BLOCK_BYTES];
- _state_init(X, ciphertext);
+ _state_init(message, ciphertext);
uint8_t RTK[ROUNDS][ROUND_TWEAKEY_BYTES];
_compute_round_tweakeys(key, tweak, RTK);
for (size_t i=0; i<ROUNDS-1; i++)
{
- _one_round_egfn(X, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION);
+ _one_round_egfn(message, RTK[ROUNDS-1-i], PERMUTATION_DECRYPTION);
}
- _one_round_egfn(X, RTK[0], PERMUTATION_NONE);
-
- memcpy(message, X, BLOCK_BYTES);
+ _one_round_egfn(message, RTK[0], PERMUTATION_NONE);
}