Browse Source

delete the unaligned code

OPENBSD_2_1
deraadt 28 years ago
parent
commit
5ca625a603
2 changed files with 2 additions and 22 deletions
  1. +1
    -11
      src/lib/libc/crypt/crypt.c
  2. +1
    -11
      src/lib/libc/crypt/morecrypt.c

+ 1
- 11
src/lib/libc/crypt/crypt.c View File

@ -50,7 +50,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: crypt.c,v 1.9 1997/03/27 23:36:53 downsj Exp $";
static char rcsid[] = "$OpenBSD: crypt.c,v 1.10 1997/03/30 20:24:46 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -572,24 +572,14 @@ des_cipher(in, out, salt, count)
setup_salt(salt); setup_salt(salt);
#if 0
rawl = ntohl(*((u_int32_t *) in)++);
rawr = ntohl(*((u_int32_t *) in));
#else
memcpy(x, in, sizeof x); memcpy(x, in, sizeof x);
rawl = ntohl(x[0]); rawl = ntohl(x[0]);
rawr = ntohl(x[1]); rawr = ntohl(x[1]);
#endif
retval = do_des(rawl, rawr, &l_out, &r_out, count); retval = do_des(rawl, rawr, &l_out, &r_out, count);
#if 0
*((u_int32_t *) out)++ = htonl(l_out);
*((u_int32_t *) out) = htonl(r_out);
#else
x[0] = htonl(l_out); x[0] = htonl(l_out);
x[1] = htonl(r_out); x[1] = htonl(r_out);
memcpy(out, x, sizeof x); memcpy(out, x, sizeof x);
#endif
return(retval); return(retval);
} }


+ 1
- 11
src/lib/libc/crypt/morecrypt.c View File

@ -51,7 +51,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: morecrypt.c,v 1.7 1996/11/14 05:45:15 etheisen Exp $";
static char rcsid[] = "$OpenBSD: morecrypt.c,v 1.8 1997/03/30 20:24:47 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -487,24 +487,14 @@ des_cipher(in, out, salt, count)
setup_salt((int32_t)salt); setup_salt((int32_t)salt);
#if 0
rawl = ntohl(*((u_int32_t *) in)++);
rawr = ntohl(*((u_int32_t *) in));
#else
memcpy(x, in, sizeof x); memcpy(x, in, sizeof x);
rawl = ntohl(x[0]); rawl = ntohl(x[0]);
rawr = ntohl(x[1]); rawr = ntohl(x[1]);
#endif
retval = do_des(rawl, rawr, &l_out, &r_out, count); retval = do_des(rawl, rawr, &l_out, &r_out, count);
#if 0
*((u_int32_t *) out)++ = htonl(l_out);
*((u_int32_t *) out) = htonl(r_out);
#else
x[0] = htonl(l_out); x[0] = htonl(l_out);
x[1] = htonl(r_out); x[1] = htonl(r_out);
memcpy(out, x, sizeof x); memcpy(out, x, sizeof x);
#endif
return(retval); return(retval);
} }


Loading…
Cancel
Save