aboutsummaryrefslogtreecommitdiff
path: root/crypto/rmd160.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-06-02 21:30:38 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 20:35:15 +0800
commit5cdcc22f25b0766fe16d5dd8e3b2efc91fa4da6e (patch)
tree90078f745a3cf28efdc32db030c3505e06c3c74a /crypto/rmd160.c
parent0936a944068ef68f8b19f437e03f4654c29f2423 (diff)
[CRYPTO] rmd: Use pointer form of endian swapping operations
This patch converts the relevant code in the rmd implementations to use the pointer form of the endian swapping operations. This allows certain architectures to generate more optimised code. For example, on sparc64 this more than halves the CPU cycles on a typical hashing operation. Based on a patch by David Miller. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/rmd160.c')
-rw-r--r--crypto/rmd160.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rmd160.c b/crypto/rmd160.c
index 136e31f56d5..e9fd5f6a0ac 100644
--- a/crypto/rmd160.c
+++ b/crypto/rmd160.c
@@ -47,7 +47,7 @@ struct rmd160_ctx {
#define F5(x, y, z) (x ^ (y | ~z))
#define ROUND(a, b, c, d, e, f, k, x, s) { \
- (a) += f((b), (c), (d)) + le32_to_cpu(x) + (k); \
+ (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
(a) = rol32((a), (s)) + (e); \
(c) = rol32((c), 10); \
}
@@ -329,7 +329,7 @@ static void rmd160_final(struct crypto_tfm *tfm, u8 *out)
/* Store state in digest */
for (i = 0; i < 5; i++)
- dst[i] = cpu_to_le32(rctx->state[i]);
+ dst[i] = cpu_to_le32p(&rctx->state[i]);
/* Wipe context */
memset(rctx, 0, sizeof(*rctx));