summaryrefslogtreecommitdiff
path: root/usr.bin/bdes
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-01-20 22:12:43 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-01-20 22:12:43 +0000
commite8be0d63e8b997b1a130850434f8ee1fe168b746 (patch)
treeff5ac9006fbed5ed96e4938d7c4d4bb1293689c9 /usr.bin/bdes
parent4f80dc88237a5059b145ea34822dcc53b27c0193 (diff)
- remove some dead code, since we #define something and test for it on the next
line, the #else part can go. ok miod@
Diffstat (limited to 'usr.bin/bdes')
-rw-r--r--usr.bin/bdes/bdes.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/usr.bin/bdes/bdes.c b/usr.bin/bdes/bdes.c
index ce072188fbb..e5c503d7524 100644
--- a/usr.bin/bdes/bdes.c
+++ b/usr.bin/bdes/bdes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bdes.c,v 1.16 2009/10/27 23:59:36 deraadt Exp $ */
+/* $OpenBSD: bdes.c,v 1.17 2011/01/20 22:12:42 jasper Exp $ */
/* $NetBSD: bdes.c,v 1.2 1995/03/26 03:33:19 glass Exp $ */
/*-
@@ -102,31 +102,12 @@ void usage(void);
#define MEMZERO(dest,len) bzero((dest),(len))
/* Hide the calls to the primitive encryption routines. */
-#define FASTWAY
-#ifdef FASTWAY
#define DES_KEY(buf) \
if (des_setkey(buf)) \
err(1, "des_setkey");
#define DES_XFORM(buf) \
if (des_cipher(buf, buf, 0L, (inverse ? -1 : 1))) \
err(1, "des_cipher");
-#else
-#define DES_KEY(buf) { \
- char bits1[64]; /* bits of key */ \
- expand(buf, bits1); \
- if (setkey(bits1)) \
- err(1, "setkey"); \
- }
-#define DES_XFORM(buf) { \
- char bits1[64]; /* bits of message */ \
- expand(buf, bits1); \
- if (encrypt(bits1, inverse)) \
- err(1, "encrypt"); \
- compress(bits1, buf); \
- }
-void expand(Desbuf, char *);
-void compress(Desbuf, char *);
-#endif
/*
* this does an error-checking write
@@ -1010,36 +991,6 @@ cfbauth(void)
}
}
-#ifndef FASTWAY
-/*
- * change from 8 bits/Uchar to 1 bit/Uchar
- */
-void
-expand(Desbuf from, char *to)
-{
- int i, j; /* counters in for loop */
-
- for (i = 0; i < 8; i++)
- for (j = 0; j < 8; j++)
- *to++ = (CHAR(from, i)>>(7-j))&01;
-}
-
-/*
- * change from 1 bit/char to 8 bits/Uchar
- */
-void
-compress(char *from, Desbuf to)
-{
- int i, j; /* counters in for loop */
-
- for (i = 0; i < 8; i++) {
- CHAR(to, i) = 0;
- for (j = 0; j < 8; j++)
- CHAR(to, i) = ((*from++)<<(7-j))|CHAR(to, i);
- }
-}
-#endif
-
extern char *__progname;
/*
* message about usage