summaryrefslogtreecommitdiff
path: root/crypto/rmd256.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-06-02 21:30:38 +1000
commitd9ed4e68a897fd4334e65d981320c42b4903b1c0 (patch)
tree349ea47a31ba2db038f599e99958914cf717ec02 /crypto/rmd256.c
parent9f65c0fb28f1f7fe2083b5b4a66da9a068bfc87f (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/rmd256.c')
-rw-r--r--crypto/rmd256.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rmd256.c b/crypto/rmd256.c
index 88f2203751ae..b08852690706 100644
--- a/crypto/rmd256.c
+++ b/crypto/rmd256.c
@@ -44,7 +44,7 @@ struct rmd256_ctx {
#define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */
#define ROUND(a, b, c, d, 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)); \
}
@@ -304,7 +304,7 @@ static void rmd256_final(struct crypto_tfm *tfm, u8 *out)
/* Store state in digest */
for (i = 0; i < 8; i++)
- dst[i] = cpu_to_le32(rctx->state[i]);
+ dst[i] = cpu_to_le32p(&rctx->state[i]);
/* Wipe context */
memset(rctx, 0, sizeof(*rctx));