aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2019-01-04 09:40:52 +0100
committerAnders Broman <a.broman58@gmail.com>2019-01-04 11:29:47 +0000
commite0e1f3ff31212fb1dcc05b909343711a1bdf2611 (patch)
tree27ea3b39edb6e25affb3e1a8ebc405a5b8aeab8b
parent29bfeccc8db0a880ad3aff282389298852c02323 (diff)
xtea: use same var name.
Found by clang-tidy. Change-Id: I5afce9464536cbbaf8f7f84b165d2ef56e166c2e Reviewed-on: https://code.wireshark.org/review/31357 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--wsutil/xtea.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/wsutil/xtea.c b/wsutil/xtea.c
index 6b454f81d2..626aa54567 100644
--- a/wsutil/xtea.c
+++ b/wsutil/xtea.c
@@ -16,13 +16,13 @@
#include "pint.h"
#include "xtea.h"
-void decrypt_xtea_ecb(guint8 output[8], const guint8 v_in[8], const guint32 key[4], guint num_rounds)
+void decrypt_xtea_ecb(guint8 plaintext[8], const guint8 ciphertext[8], const guint32 key[4], guint num_rounds)
{
guint i;
guint32 v[2], delta = 0x9E3779B9, sum = delta * num_rounds;
- v[0] = pntoh32(&v_in[0]);
- v[1] = pntoh32(&v_in[4]);
+ v[0] = pntoh32(&ciphertext[0]);
+ v[1] = pntoh32(&ciphertext[4]);
for (i = 0; i < num_rounds; i++) {
v[1] -= (((v[0] << 4) ^ (v[0] >> 5)) + v[0]) ^ (sum + key[(sum >> 11) & 3]);
@@ -33,16 +33,16 @@ void decrypt_xtea_ecb(guint8 output[8], const guint8 v_in[8], const guint32 key[
v[0] = GUINT32_TO_BE(v[0]);
v[1] = GUINT32_TO_BE(v[1]);
- memcpy(output, v, sizeof v);
+ memcpy(plaintext, v, sizeof v);
}
-void decrypt_xtea_le_ecb(guint8 output[8], const guint8 v_in[8], const guint32 key[4], guint num_rounds)
+void decrypt_xtea_le_ecb(guint8 plaintext[8], const guint8 ciphertext[8], const guint32 key[4], guint num_rounds)
{
guint i;
guint32 v[2], delta = 0x9E3779B9, sum = delta * num_rounds;
- v[0] = pletoh32(&v_in[0]);
- v[1] = pletoh32(&v_in[4]);
+ v[0] = pletoh32(&ciphertext[0]);
+ v[1] = pletoh32(&ciphertext[4]);
for (i = 0; i < num_rounds; i++) {
v[1] -= (((v[0] << 4) ^ (v[0] >> 5)) + v[0]) ^ (sum + key[(sum >> 11) & 3]);
@@ -53,7 +53,7 @@ void decrypt_xtea_le_ecb(guint8 output[8], const guint8 v_in[8], const guint32 k
v[0] = GUINT32_TO_LE(v[0]);
v[1] = GUINT32_TO_LE(v[1]);
- memcpy(output, v, sizeof v);
+ memcpy(plaintext, v, sizeof v);
}
/*