summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}