summaryrefslogtreecommitdiff
path: root/lib/libc/hash/rmd160.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 04:07:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-18 04:07:15 +0000
commite72814e00c9a20a45c2471c950063b8c6aef2dc2 (patch)
tree93333d084f5d8a9d20936c39e585fea22ce0fe0b /lib/libc/hash/rmd160.c
parent841380c522d141577d69425bf505ffece4917d72 (diff)
Converting u_char[] -> u_int[] is easy on little endian machines :-)
Diffstat (limited to 'lib/libc/hash/rmd160.c')
-rw-r--r--lib/libc/hash/rmd160.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c
index 508008e6d52..720c9665c47 100644
--- a/lib/libc/hash/rmd160.c
+++ b/lib/libc/hash/rmd160.c
@@ -320,12 +320,16 @@ void RMD160Update(context, data, nbytes)
{
u_int32_t i, j, X[16];
- (void)memset(X, 0, 16 * sizeof(u_int32_t));
+ (void)memset(X, 0, sizeof(X));
/* process all complete blocks */
for (i = 0; i < (nbytes >> 6); i++) {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ (void)memcpy(X, data, sizeof(X));
+#else
for (j=0; j < 16; j++)
X[j] = BYTES_TO_DWORD(data + (64 * i) + (4 * j));
+#endif
RMD160Transform(context->state, X);
}