aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-20 08:18:06 +0000
committerlloyd <[email protected]>2006-09-20 08:18:06 +0000
commit7dc1f8c8ce6b1f959c4f90cb99661b76eec60bbb (patch)
tree2de9a96ad2cdf709ffd39fbfe9cb68b5e3b36a51
parent70d37c35ae4d4ef048db90b28cc83bd6e20f42af (diff)
Make the implementation of the round function a bit easier to read.
-rw-r--r--src/seed.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/seed.cpp b/src/seed.cpp
index 05dd82d51..3bb748b6c 100644
--- a/src/seed.cpp
+++ b/src/seed.cpp
@@ -36,12 +36,15 @@ void SEED::enc(const byte in[], byte out[]) const
T0 = B2 ^ K[2*j];
T1 = G(T0 ^ B3 ^ K[2*j+1]);
T0 = G(T1 + T0);
- B1 ^= (T1 = G(T1 + T0));
+ T1 = G(T1 + T0);
+ B1 ^= T1;
+ B0 ^= T0 + T1;
- T0 = (B0 ^= T0 + T1) ^ K[2*j+2];
+ T0 = B0 ^ K[2*j+2];
T1 = G(T0 ^ B1 ^ K[2*j+3]);
T0 = G(T1 + T0);
- B3 ^= (T1 = G(T1 + T0));
+ T1 = G(T1 + T0);
+ B3 ^= T1;
B2 ^= T0 + T1;
}
@@ -74,12 +77,15 @@ void SEED::dec(const byte in[], byte out[]) const
T0 = B2 ^ K[30-2*j];
T1 = G(T0 ^ B3 ^ K[31-2*j]);
T0 = G(T1 + T0);
- B1 ^= (T1 = G(T1 + T0));
+ T1 = G(T1 + T0);
+ B1 ^= T1;
+ B0 ^= T0 + T1;
- T0 = (B0 ^= T0 + T1) ^ K[28-2*j];
+ T0 = B0 ^ K[28-2*j];
T1 = G(T0 ^ B1 ^ K[29-2*j]);
T0 = G(T1 + T0);
- B3 ^= (T1 = G(T1 + T0));
+ T1 = G(T1 + T0);
+ B3 ^= T1;
B2 ^= T0 + T1;
}