aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rmd256.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-07-18 13:12:00 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2018-07-27 07:28:36 -0400
commitd75f482eaface11dd30e73977c245fab5e07c3aa (patch)
treecb67569e7aec4cacc7868e93db118af3f5f8c099 /crypto/rmd256.c
parent6b0daa78207b622d768cce2a8251c830256bade9 (diff)
crypto: rmd256 - use swap macro in rmd256_transform
Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/rmd256.c')
-rw-r--r--crypto/rmd256.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/rmd256.c b/crypto/rmd256.c
index 0afbb5af4499..0e9d30676a01 100644
--- a/crypto/rmd256.c
+++ b/crypto/rmd256.c
@@ -49,7 +49,7 @@ struct rmd256_ctx {
49 49
50static void rmd256_transform(u32 *state, const __le32 *in) 50static void rmd256_transform(u32 *state, const __le32 *in)
51{ 51{
52 u32 aa, bb, cc, dd, aaa, bbb, ccc, ddd, tmp; 52 u32 aa, bb, cc, dd, aaa, bbb, ccc, ddd;
53 53
54 /* Initialize left lane */ 54 /* Initialize left lane */
55 aa = state[0]; 55 aa = state[0];
@@ -100,7 +100,7 @@ static void rmd256_transform(u32 *state, const __le32 *in)
100 ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[12], 6); 100 ROUND(bbb, ccc, ddd, aaa, F4, KK1, in[12], 6);
101 101
102 /* Swap contents of "a" registers */ 102 /* Swap contents of "a" registers */
103 tmp = aa; aa = aaa; aaa = tmp; 103 swap(aa, aaa);
104 104
105 /* round 2: left lane */ 105 /* round 2: left lane */
106 ROUND(aa, bb, cc, dd, F2, K2, in[7], 7); 106 ROUND(aa, bb, cc, dd, F2, K2, in[7], 7);
@@ -139,7 +139,7 @@ static void rmd256_transform(u32 *state, const __le32 *in)
139 ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[2], 11); 139 ROUND(bbb, ccc, ddd, aaa, F3, KK2, in[2], 11);
140 140
141 /* Swap contents of "b" registers */ 141 /* Swap contents of "b" registers */
142 tmp = bb; bb = bbb; bbb = tmp; 142 swap(bb, bbb);
143 143
144 /* round 3: left lane */ 144 /* round 3: left lane */
145 ROUND(aa, bb, cc, dd, F3, K3, in[3], 11); 145 ROUND(aa, bb, cc, dd, F3, K3, in[3], 11);
@@ -178,7 +178,7 @@ static void rmd256_transform(u32 *state, const __le32 *in)
178 ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[13], 5); 178 ROUND(bbb, ccc, ddd, aaa, F2, KK3, in[13], 5);
179 179
180 /* Swap contents of "c" registers */ 180 /* Swap contents of "c" registers */
181 tmp = cc; cc = ccc; ccc = tmp; 181 swap(cc, ccc);
182 182
183 /* round 4: left lane */ 183 /* round 4: left lane */
184 ROUND(aa, bb, cc, dd, F4, K4, in[1], 11); 184 ROUND(aa, bb, cc, dd, F4, K4, in[1], 11);
@@ -217,7 +217,7 @@ static void rmd256_transform(u32 *state, const __le32 *in)
217 ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[14], 8); 217 ROUND(bbb, ccc, ddd, aaa, F1, KK4, in[14], 8);
218 218
219 /* Swap contents of "d" registers */ 219 /* Swap contents of "d" registers */
220 tmp = dd; dd = ddd; ddd = tmp; 220 swap(dd, ddd);
221 221
222 /* combine results */ 222 /* combine results */
223 state[0] += aa; 223 state[0] += aa;