diff options
-rw-r--r-- | lib/libc/hash/rmd160.c | 8 | ||||
-rw-r--r-- | sys/crypto/rmd160.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c index a8c6a409611..f1d6cf72fab 100644 --- a/lib/libc/hash/rmd160.c +++ b/lib/libc/hash/rmd160.c @@ -32,7 +32,7 @@ #include <rmd160.h> #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: rmd160.c,v 1.12 2002/12/23 04:33:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: rmd160.c,v 1.13 2003/12/14 11:22:35 markus Exp $"; #endif /* LIBC_SCCS and not lint */ #define PUT_64BIT_LE(cp, value) do { \ @@ -167,7 +167,11 @@ RMD160Transform(u_int32_t state[5], const u_char block[64]) int i; for (i = 0; i < 16; i++) - x[i] = swap32(*(u_int32_t*)(block+i*4)); + x[i] = (u_int32_t)( + (u_int32_t)(block[i*4 + 0]) | + (u_int32_t)(block[i*4 + 1]) << 8 | + (u_int32_t)(block[i*4 + 2]) << 16 | + (u_int32_t)(block[i*4 + 3]) << 24); #endif a = state[0]; diff --git a/sys/crypto/rmd160.c b/sys/crypto/rmd160.c index 508944c7a22..b627a61f375 100644 --- a/sys/crypto/rmd160.c +++ b/sys/crypto/rmd160.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rmd160.c,v 1.3 2001/09/26 21:40:13 markus Exp $ */ +/* $OpenBSD: rmd160.c,v 1.4 2003/12/14 11:22:35 markus Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -164,7 +164,11 @@ RMD160Transform(u_int32_t state[5], const u_char block[64]) int i; for (i = 0; i < 16; i++) - x[i] = swap32(*(u_int32_t*)(block+i*4)); + x[i] = (u_int32_t)( + (u_int32_t)(block[i*4 + 0]) | + (u_int32_t)(block[i*4 + 1]) << 8 | + (u_int32_t)(block[i*4 + 2]) << 16 | + (u_int32_t)(block[i*4 + 3]) << 24); #endif a = state[0]; |